class TableSplitsCache extends BaseHdfsFileCacheUtil {

    public static List<Text> trimSplits(List<Text> tableSplits, int maxSplits) {
        if (tableSplits.size() <= maxSplits) {
            return tableSplits;
        }
        double r = (maxSplits + 1) / (double) (tableSplits.size());
        double pos = 0;
        
        ArrayList<Text> subset = new ArrayList<>(maxSplits);
        
        int numberSplitsUsed = 0;
        for (int i = 0; i < tableSplits.size() && numberSplitsUsed < maxSplits; i++) {
            pos += r;
            while (pos > 1) {
                subset.add(tableSplits.get(i));
                numberSplitsUsed++;
                pos -= 1;
            }
        }
        
        return subset;
    }

    public  TableSplitsCache(Configuration conf);

}