} else { PartitionKeys newPks = new PartitionKeys(reducedMask, Sets.newHashSet(partitionKey & reducedMask)); newPartition.getPartitionKeys().put(e.getKey(), new PartitionKeys(newMask, Sets.newHashSet(key))); newPartitions.add(newPartition);
} else { PartitionKeys newPks = new PartitionKeys(reducedMask, Sets.newHashSet(partitionKey & reducedMask)); newPartition.getPartitionKeys().put(e.getKey(), new PartitionKeys(newMask, Sets.newHashSet(key))); newPartitions.add(newPartition);
p.getPartitionKeys().put(inputPort, new PartitionKeys(partitionMask, Sets.newHashSet(i))); } else { pks.partitions.add(i);
new PartitionKeys(mask, set[0]), new PartitionKeys(mask, set[1]), new PartitionKeys(mask, set[2]) };
private Collection<Partition<TestPartition>> getPartitions(Collection<Partition<TestPartition>> partitions, PartitioningContext context) { // create array of partitions to return Collection<Partition<TestPartition>> result = new ArrayList<Partition<TestPartition>>(nPartitions); int mask = getMask(nPartitions); for (int i = 0; i < nPartitions; ++i) { HashSet<Integer> set = new HashSet<>(); set.add(i); PartitionKeys keys = new PartitionKeys(mask, set); Partition partition = new DefaultPartition<TestPartition>(new TestPartition()); partition.getPartitionKeys().put(in, keys); } return result; } // getPartitions