code: public int getPartition(Shard key, IntermediateForm value, int numPartitions) {
      int partition = map.get(key).intValue();
      if (partition < numPartitions) {
        return partition;
      } else {
        return numPartitions - 1;
      }
    }
docs: /* (non-Javadoc)
  @see org.apache.hadoop.mapred.Partitioner#getPartition(java.lang.Object, java.lang.Object, int)