public static SpecialTimestampsSupplier create(TransactionManager txnManager) { return new SpecialTimestampsSupplier(txnManager::getUnreadableTimestamp, txnManager::getImmutableTimestamp); }
public SweepTaskRunner( KeyValueService keyValueService, LongSupplier unreadableTsSupplier, LongSupplier immutableTsSupplier, TransactionService transactionService, SweepStrategyManager sweepStrategyManager, CellsSweeper cellsSweeper, LegacySweepMetrics metricsManager) { this.keyValueService = keyValueService; this.specialTimestampsSupplier = new SpecialTimestampsSupplier(unreadableTsSupplier, immutableTsSupplier); this.sweepStrategyManager = sweepStrategyManager; this.cellsSweeper = cellsSweeper; this.metricsManager = Optional.ofNullable(metricsManager); this.commitTsCache = CommitTsCache.create(transactionService); }
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; }
public static SpecialTimestampsSupplier create(TransactionManager txnManager) { return new SpecialTimestampsSupplier(txnManager::getUnreadableTimestamp, txnManager::getImmutableTimestamp); }
@Before public void setup() { numShards = DEFAULT_SHARDS; unreadableTs = SweepQueueUtils.TS_COARSE_GRANULARITY * 5; immutableTs = SweepQueueUtils.TS_COARSE_GRANULARITY * 5; metricsManager = MetricsManagers.createForTests(); timestampsSupplier = new SpecialTimestampsSupplier(() -> unreadableTs, () -> immutableTs); spiedKvs = spy(new SafeTableClearerKeyValueService( timestampsSupplier::getImmutableTimestamp, new InMemoryKeyValueService(true))); spiedKvs.createTable(TABLE_CONS, metadataBytes(TableMetadataPersistence.SweepStrategy.CONSERVATIVE)); spiedKvs.createTable(TABLE_THOR, metadataBytes(TableMetadataPersistence.SweepStrategy.THOROUGH)); spiedKvs.createTable(TABLE_NOTH, metadataBytes(TableMetadataPersistence.SweepStrategy.NOTHING)); partitioner = new WriteInfoPartitioner(spiedKvs, () -> numShards); txnService = TransactionServices.createV1TransactionService(spiedKvs); }
public SweepTaskRunner( KeyValueService keyValueService, LongSupplier unreadableTsSupplier, LongSupplier immutableTsSupplier, TransactionService transactionService, SweepStrategyManager sweepStrategyManager, CellsSweeper cellsSweeper, LegacySweepMetrics metricsManager) { this.keyValueService = keyValueService; this.specialTimestampsSupplier = new SpecialTimestampsSupplier(unreadableTsSupplier, immutableTsSupplier); this.sweepStrategyManager = sweepStrategyManager; this.cellsSweeper = cellsSweeper; this.metricsManager = Optional.ofNullable(metricsManager); this.commitTsCache = CommitTsCache.create(transactionService); }