private TargetedSweeper initializeAndGet(TargetedSweeper sweeper, TransactionManager txManager) { sweeper.initializeWithoutRunning( new SpecialTimestampsSupplier(txManager::getImmutableTimestamp, txManager::getImmutableTimestamp), txManager.getTimelockService(), txManager.getKeyValueService(), TransactionServices.createForTesting( txManager.getKeyValueService(), txManager.getTimestampService(), false), new TargetedSweepFollower(ImmutableList.of(FOLLOWER), txManager)); sweeper.runInBackground(); return sweeper; }
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); }
public void initializeWithoutRunning(TransactionManager txManager) { initializeWithoutRunning(SpecialTimestampsSupplier.create(txManager), txManager.getTimelockService(), txManager.getKeyValueService(), TransactionServices.createTransactionService(txManager.getKeyValueService(), CoordinationServices.createDefault( txManager.getKeyValueService(), txManager.getTimestampService(), false)), new TargetedSweepFollower(followers, txManager)); }
@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); }
public void initializeWithoutRunning(TransactionManager txManager) { initializeWithoutRunning(SpecialTimestampsSupplier.create(txManager), txManager.getTimelockService(), txManager.getKeyValueService(), TransactionServices.createTransactionService(txManager.getKeyValueService(), CoordinationServices.createDefault( txManager.getKeyValueService(), txManager.getTimestampService(), false)), new TargetedSweepFollower(followers, txManager)); }
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(),