class ShardIdPartitioner extends Partitioner<BulkIngestKey,Value> implements Configurable, DelegatePartitioner {

    @Override
    public synchronized int getPartition(BulkIngestKey key, Value value, int numReduceTasks) {
        String shardId = key.getKey().getRow().toString();
        try {
            long shardIndex = generateNumberForShardId(shardId, getBaseTime());
            return (int) (shardIndex % numReduceTasks);
            
        } catch (Exception e) {
            return (shardId.hashCode() & Integer.MAX_VALUE) % numReduceTasks;
        }
    }

}