### Question:
RowHashingPartitioner extends Partitioner<BulkIngestKey,Value> implements DelegatePartitioner { @Override public int getPartition(BulkIngestKey bKey, Value value, int reducers) { HashCodeBuilder hcb = new HashCodeBuilder(157, 41); Key key = bKey.getKey(); Text cf = key.getColumnFamily(); if (colFams.contains(cf)) { hcb.append(cf); } hcb.append(key.getRow()); int partition = (hcb.toHashCode() >>> 1) % reducers; if (log.isTraceEnabled()) { log.trace("Returning " + partition + " for BIK " + bKey); } return partition; }  @Override int getPartition(BulkIngestKey bKey, Value value, int reducers); @Override Configuration getConf(); @Override void setConf(Configuration conf); @Override void configureWithPrefix(String prefix); @Override int getNumPartitions(); @Override void initializeJob(Job job); static final String COLUMN_FAMILIES; }### Answer:
@Test public void testShardPartitioning() { RowHashingPartitioner sdp = new RowHashingPartitioner(); final int nRed = 30; Text tbl = new Text("table"); for (int i = 0; i < 10; ++i) { String shard = "20110101_" + i; int expectedReducer = sdp.getPartition(new BulkIngestKey(tbl, new Key(shard, "fluff", "fluff")), null, nRed); for (int j = 0; j < 10; ++j) { Assert.assertEquals(expectedReducer, sdp.getPartition(new BulkIngestKey(tbl, new Key(shard, Integer.toHexString(j), "u")), null, nRed)); } } }