@Test public void filterOutUnsweepableRemovesWritesWithStrategyNothing() { List<WriteInfo> writes = ImmutableList.of( getWriteInfoWithFixedCellHash(CONSERVATIVE, 0), getWriteInfoWithFixedCellHash(NOTHING, 1), getWriteInfoWithFixedCellHash(CONSERVATIVE, 0), getWriteInfoWithFixedCellHash(CONSERVATIVE2, 1), getWriteInfoWithFixedCellHash(THOROUGH, 2), getWriteInfoWithFixedCellHash(NOTHING, 0)); assertThat(partitioner.filterOutUnsweepableTables(writes)) .containsExactly( getWriteInfoWithFixedCellHash(CONSERVATIVE, 0), getWriteInfoWithFixedCellHash(CONSERVATIVE, 0), getWriteInfoWithFixedCellHash(CONSERVATIVE2, 1), getWriteInfoWithFixedCellHash(THOROUGH, 2)); }
@VisibleForTesting List<WriteInfo> filterOutUnsweepableTables(List<WriteInfo> writes) { return writes.stream() .filter(writeInfo -> getStrategy(writeInfo).isPresent()) .collect(Collectors.toList()); }
WriteInfoPartitioner { @VisibleForTesting List<WriteInfo> filterOutUnsweepableTables(List<WriteInfo> writes) { return writes.stream() .filter(writeInfo -> getStrategy(writeInfo).isPresent()) .collect(Collectors.toList()); } }
WriteInfoPartitioner { @VisibleForTesting List<WriteInfo> filterOutUnsweepableTables(List<WriteInfo> writes) { return writes.stream() .filter(writeInfo -> getStrategy(writeInfo).isPresent()) .collect(Collectors.toList()); } WriteInfoPartitioner(KeyValueService kvs, Supplier<Integer> numShards); }
WriteInfoPartitioner { @VisibleForTesting List<WriteInfo> filterOutUnsweepableTables(List<WriteInfo> writes) { return writes.stream() .filter(writeInfo -> getStrategy(writeInfo).isPresent()) .collect(Collectors.toList()); } WriteInfoPartitioner(KeyValueService kvs, Supplier<Integer> numShards); Map<PartitionInfo, List<WriteInfo>> filterAndPartition(List<WriteInfo> writes); }
WriteInfoPartitioner { @VisibleForTesting List<WriteInfo> filterOutUnsweepableTables(List<WriteInfo> writes) { return writes.stream() .filter(writeInfo -> getStrategy(writeInfo).isPresent()) .collect(Collectors.toList()); } WriteInfoPartitioner(KeyValueService kvs, Supplier<Integer> numShards); Map<PartitionInfo, List<WriteInfo>> filterAndPartition(List<WriteInfo> writes);  }