@Test public void testAssignmentCorrectness() { Map<String, Long> fileToComparisons = new HashMap<String, Long>() { { put("f1", 40L); put("f2", 35L); put("f3", 20L); } }; BucketizedBloomCheckPartitioner p = new BucketizedBloomCheckPartitioner(4, fileToComparisons, 10); Map<String, List<Integer>> assignments = p.getFileGroupToPartitions(); assertEquals(4, assignments.get("f1").size(), "f1 should have 4 buckets"); assertEquals(4, assignments.get("f2").size(), "f2 should have 4 buckets"); assertEquals(2, assignments.get("f3").size(), "f3 should have 2 buckets"); assertArrayEquals(new Integer[] {0, 0, 1, 3}, assignments.get("f1").toArray(), "f1 spread across 3 partitions"); assertArrayEquals(new Integer[] {1, 2, 2, 0}, assignments.get("f2").toArray(), "f2 spread across 3 partitions"); assertArrayEquals(new Integer[] {3, 1}, assignments.get("f3").toArray(), "f3 spread across 2 partitions"); }
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);  }