Professional Documents
Culture Documents
GROUP MEMBERS:
Project Certificate.......................................................................................23
AMAR KESHRI
ABHINAV BIKASH
ANKIT KUMAR
CHINTAN LAKHLANI
HIMANSHI SINGH
The study found that the social network’s mutual friends feature
“creates myriad security risks and privacy concerns,” adding that
even though users can adjust their privacy settings, hackers can
still access information that is intended to be private. With such a
huge user base in such systems, a minor privacy breach can have a
significant impact. It is important to understand all possible privacy
threats to users of social networking sites so that appropriate
mechanisms can be developed. This work of ours is an effort to
comprehensively understand such threats related to the mutual-
friend feature so that appropriate measures can be taken. In future
we need to develop such technology that will breach the privacy of
any user.
#IMPORTING PACKAGES
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.*;
this.user = user;
this.mutualFriend = mutualFriend;
public FriendCountWritable() {
this(-1L, -1L);
@Override
out.writeLong(user);
out.writeLong(mutualFriend);
@Override
user = in.readLong();
mutualFriend = in.readLong();
@Override
#MAPPER CLASS
@Override
if (line.length == 2) {
while (tokenizer.hasMoreTokens()) {
toUsers.add(toUser);
#REDUCER CLASS
@Override
// key is the recommended friend, and value is the list of mutual friends
if (mutualFriends.containsKey(toUser)) {
if (isAlreadyFriend) {
mutualFriends.get(toUser).add(mutualFriend);
} else {
if (!isAlreadyFriend) {
add(mutualFriend);
});
} else {
mutualFriends.put(toUser, null);
@Override
Integer v1 = mutualFriends.get(key1).size();
Integer v2 = mutualFriends.get(key2).size();
return -1;
return -1;
return 1;
});
if (entry.getValue() != null) {
sortedMutualFriends.put(entry.getKey(), entry.getValue());
Integer i = 0;
if (i == 0) {
} else {
++i;
#DRIVER CLASS
job.setJarByClass(FriendRecommendation.class);
job.setOutputKeyClass(LongWritable.class);
job.setOutputValueClass(FriendCountWritable.class);
job.setMapperClass(Map.class);
job.setReducerClass(Reduce.class);
job.setInputFormatClass(TextInputFormat.class);
job.setOutputFormatClass(TextOutputFormat.class);
job.waitForCompletion(true);
[ AMAR KESHRI]
Globsyn Finishing School
[ ABHINAV BIKASH ]
Globsyn Finishing School
[ ANKIT KUMAR ]
Globsyn Finishing School
ROYCHOWDHURY.
[ HIMANSHI SINGH ]
Globsyn Finishing School
[ CHINTAN LAKHLANI ]
Globsyn Finishing School