/** * Filters out all writes made into tables with SweepStrategy NOTHING, then partitions the writes according to * shard, strategy, and start timestamp of the transaction that performed the write. */ public Map<PartitionInfo, List<WriteInfo>> filterAndPartition(List<WriteInfo> writes) { return partitionWritesByShardStrategyTimestamp(filterOutUnsweepableTables(writes)); }
@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)); }
/** * Filters out all writes made into tables with SweepStrategy NOTHING, then partitions the writes according to * shard, strategy, and start timestamp of the transaction that performed the write. */ public Map<PartitionInfo, List<WriteInfo>> filterAndPartition(List<WriteInfo> writes) { return partitionWritesByShardStrategyTimestamp(filterOutUnsweepableTables(writes)); }