assertEquals(partitionEntries.get(4), pentries);
}
@Test
public void testPartitionListWithEmptyPartitions() {
PartitionListIterator plistItr = new PartitionListIterator(store, Arrays.asList(2,
3,
4,
5,
6));
HashMap<Integer, Set<String>> retrievedPartitionEntries = new HashMap<Integer, Set<String>>();
while(plistItr.hasNext()) {
String key = new String(plistItr.next().getFirst().get());
int p = strategy.getMasterPartition(key.getBytes());
if(!retrievedPartitionEntries.containsKey(p))
retrievedPartitionEntries.put(p, new HashSet<String>());
retrievedPartitionEntries.get(p).add(key);
}
plistItr.close();
// should only have retrieved entries for even partitions
assertEquals(3, retrievedPartitionEntries.size());
for(Integer p: Arrays.asList(2, 3, 4, 5, 6)) {
if(p % 2 == 0) {