@Test public void testUniformPacking() { Map<String, Long> comparisons1 = new HashMap<String, Long>() { { IntStream.range(0, 10).forEach(f -> put("f" + f, 100L)); } }; BucketizedBloomCheckPartitioner partitioner = new BucketizedBloomCheckPartitioner(100, comparisons1, 10); Map<String, List<Integer>> assignments = partitioner.getFileGroupToPartitions(); assignments.forEach((key, value) -> assertEquals(10, value.size())); Map<Integer, Long> partitionToNumBuckets = assignments.entrySet().stream().flatMap(e -> e.getValue().stream().map(p -> Pair.of(p, e.getKey()))) .collect(Collectors.groupingBy(Pair::getLeft, Collectors.counting())); partitionToNumBuckets.forEach((key, value) -> assertEquals(1L, value.longValue())); }
Map<String, List<Integer>> getFileGroupToPartitions() { return fileGroupToPartitions; }
BucketizedBloomCheckPartitioner extends Partitioner { Map<String, List<Integer>> getFileGroupToPartitions() { return fileGroupToPartitions; } }
BucketizedBloomCheckPartitioner extends Partitioner { Map<String, List<Integer>> getFileGroupToPartitions() { return fileGroupToPartitions; } BucketizedBloomCheckPartitioner(int targetPartitions, Map<String, Long> fileGroupToComparisons,
      int keysPerBucket); }
BucketizedBloomCheckPartitioner extends Partitioner { Map<String, List<Integer>> getFileGroupToPartitions() { return fileGroupToPartitions; } BucketizedBloomCheckPartitioner(int targetPartitions, Map<String, Long> fileGroupToComparisons,
      int keysPerBucket); @Override int numPartitions(); @Override int getPartition(Object key); }
BucketizedBloomCheckPartitioner extends Partitioner { Map<String, List<Integer>> getFileGroupToPartitions() { return fileGroupToPartitions; } BucketizedBloomCheckPartitioner(int targetPartitions, Map<String, Long> fileGroupToComparisons,
      int keysPerBucket); @Override int numPartitions(); @Override int getPartition(Object key);  }