Map<Cell, Long> maxTimestampByCellPartition = cells.stream() .collect(Collectors.toMap(Function.identity(), entry.getValue()::get)); follower.run(entry.getKey(), maxTimestampByCellPartition.keySet()); if (sweeper.shouldAddSentinels()) { kvs.addGarbageCollectionSentinelValues(entry.getKey(),
@Test public void thoroughSweepCallsFollower() { enqueueWriteCommitted(TABLE_THOR, LOW_TS); enqueueWriteCommitted(TABLE_THOR, LOW_TS2); sweepQueue.sweepNextBatch(ShardAndStrategy.thorough(THOR_SHARD)); ArgumentCaptor<Set> captor = ArgumentCaptor.forClass(Set.class); verify(mockFollower, times(1)).run(eq(TABLE_THOR), captor.capture()); assertThat(Iterables.getOnlyElement(captor.getAllValues())).containsExactly(DEFAULT_CELL); }
@Test public void conservativeSweepCallsFollower() { enqueueWriteCommitted(TABLE_CONS, LOW_TS); enqueueWriteCommitted(TABLE_CONS, LOW_TS2); sweepQueue.sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); ArgumentCaptor<Set> captor = ArgumentCaptor.forClass(Set.class); verify(mockFollower, times(1)).run(eq(TABLE_CONS), captor.capture()); assertThat(Iterables.getOnlyElement(captor.getAllValues())).containsExactly(DEFAULT_CELL); }
Map<Cell, Long> maxTimestampByCellPartition = cells.stream() .collect(Collectors.toMap(Function.identity(), entry.getValue()::get)); follower.run(entry.getKey(), maxTimestampByCellPartition.keySet()); if (sweeper.shouldAddSentinels()) { kvs.addGarbageCollectionSentinelValues(entry.getKey(),