![]() Hence abc has xyz, def and cxf as friendscxf has xyz abc and yyy as friends. Tried to implement the same using mapreduce by creating custom writables, with the mapper emitting following key values, key being pair of friends and value being related friends of the first friend in the key (ie, pair of friends) Given the above the mutual friends between abc and cxf is xyz. The key here is actually a Custom writable, created a class which extends WritableComparable and i have overridden the compareTo method so that both these pairs (a,b) and (b,a) are same. But the problem i am facing is that the compareTo method is not invoked for all combinations of pairs and hence the reducer logic is failing.īased on the above example, there are 6 K, V pairs emitted by the mapper. ![]() Īelow is the code as per the logic suggested by f11ler But compareTo is invoked only 5 times pareTo(key2), pareTo(ke圓), ke圓.compareTo(key4),pareTo(key5),pareTo(key6). The customWritables (used to represent a friend and friendpair)įi11er fi11er Not the answer you're looking for? Browse other questions tagged javajsonhadoopmapreduce or ask your own question.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |