class MultiTableRangePartitioner extends Partitioner<BulkIngestKey,Value> implements DelegatePartitioner {

    @Override
    public int getPartition(BulkIngestKey key, Value value, int numPartitions) {
        readCacheFilesIfNecessary();
        
        String tableName = key.getTableName().toString();
        Text[] cutPointArray = splitsByTable.get().get(tableName);
        
        if (null == cutPointArray)
            return (tableName.hashCode() & Integer.MAX_VALUE) % numPartitions;
        key.getKey().getRow(holder);
        int index = Arrays.binarySearch(cutPointArray, holder);
        index = calculateIndex(index, numPartitions, tableName, cutPointArray.length);
        
        index = partitionLimiter.limit(numPartitions, index);
        
        TaskInputOutputContext<?,?,?,?> c = context;
        if (c != null && collectStats) {
            c.getCounter("Partitions: " + key.getTableName(), "part." + formatter.format(index)).increment(1);
        }
        
        return index;
    }

}