## 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:
  java.lang.Comparable<CountUsersKeyWritable>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<CountUsersKeyWritable>

    public class CountUsersKeyWritable

extends java.lang.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

Nested Class Summary
`static class` `CountUsersKeyWritable.CountUsersGroupComparator` all userIDs go to the same reducer
`static class` `CountUsersKeyWritable.CountUsersPartitioner` all userIDs go to the same partition

Constructor Summary
`CountUsersKeyWritable()`
`CountUsersKeyWritable(long userID)`

Method Summary
`int` `compareTo(CountUsersKeyWritable other)`
`boolean` `equals(java.lang.Object other)`
`long` `getUserID()`
`int` `hashCode()`
`void` `readFields(java.io.DataInput in)`
`void` `write(java.io.DataOutput out)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CountUsersKeyWritable

    public CountUsersKeyWritable()

### CountUsersKeyWritable

    public CountUsersKeyWritable(long userID)

Method Detail

### getUserID

    public long getUserID()

### readFields

    public void readFields(java.io.DataInput in)
                    throws java.io.IOException

  Specified by:
    `readFields` in interface `org.apache.hadoop.io.Writable`
  Throws:
    `java.io.IOException`

### write

    public void write(java.io.DataOutput out)
               throws java.io.IOException

  Specified by:
    `write` in interface `org.apache.hadoop.io.Writable`
  Throws:
    `java.io.IOException`

### compareTo

    public int compareTo(CountUsersKeyWritable other)

  Specified by:
    `compareTo` in interface `java.lang.Comparable<CountUsersKeyWritable>`

### equals

    public boolean equals(java.lang.Object other)

  Overrides:
    `equals` in class `java.lang.Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.