org.apache.mahout.cf.taste.hadoop.similarity.item
Class CountUsersKeyWritable
java.lang.Object
org.apache.mahout.cf.taste.hadoop.similarity.item.CountUsersKeyWritable
- All Implemented Interfaces:
- Comparable<CountUsersKeyWritable>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<CountUsersKeyWritable>
public class CountUsersKeyWritable
- extends Object
- implements org.apache.hadoop.io.WritableComparable<CountUsersKeyWritable>
a writable key that is used by CountUsersMapper
and CountUsersReducer
to
count unique users by sending all userIDs to the same reducer and have them sorted in
ascending order so that there's no buffering necessary when counting them
CountUsersKeyWritable
public CountUsersKeyWritable()
CountUsersKeyWritable
public CountUsersKeyWritable(long userID)
getUserID
public long getUserID()
readFields
public void readFields(DataInput in)
throws IOException
- Specified by:
readFields
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
write
public void write(DataOutput out)
throws IOException
- Specified by:
write
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
compareTo
public int compareTo(CountUsersKeyWritable other)
- Specified by:
compareTo
in interface Comparable<CountUsersKeyWritable>
equals
public boolean equals(Object other)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.