@Test public void getStrategyQueriesKvsOnlyOnceForEachTable() { for (int i = 0; i < 5; i++) { partitioner.getStrategy(getWriteInfoWithFixedCellHash(NOTHING, i)); partitioner.getStrategy(getWriteInfoWithFixedCellHash(CONSERVATIVE, i)); } verify(mockKvs, times(1)).getMetadataForTable(NOTHING); verify(mockKvs, times(1)).getMetadataForTable(CONSERVATIVE); verifyNoMoreInteractions(mockKvs); }
@VisibleForTesting Optional<SweeperStrategy> getStrategy(WriteInfo writeInfo) { return cache.getUnchecked(writeInfo.tableRef()); }
WriteInfoPartitioner { @VisibleForTesting Optional<SweeperStrategy> getStrategy(WriteInfo writeInfo) { return cache.getUnchecked(writeInfo.tableRef()); } }
WriteInfoPartitioner { @VisibleForTesting Optional<SweeperStrategy> getStrategy(WriteInfo writeInfo) { return cache.getUnchecked(writeInfo.tableRef()); } WriteInfoPartitioner(KeyValueService kvs, Supplier<Integer> numShards); }
WriteInfoPartitioner { @VisibleForTesting Optional<SweeperStrategy> getStrategy(WriteInfo writeInfo) { return cache.getUnchecked(writeInfo.tableRef()); } WriteInfoPartitioner(KeyValueService kvs, Supplier<Integer> numShards); Map<PartitionInfo, List<WriteInfo>> filterAndPartition(List<WriteInfo> writes); }
WriteInfoPartitioner { @VisibleForTesting Optional<SweeperStrategy> getStrategy(WriteInfo writeInfo) { return cache.getUnchecked(writeInfo.tableRef()); } WriteInfoPartitioner(KeyValueService kvs, Supplier<Integer> numShards); Map<PartitionInfo, List<WriteInfo>> filterAndPartition(List<WriteInfo> writes);  }