SweepBatch getNextBatchToSweep(ShardAndStrategy shardStrategy, long lastSweptTs, long sweepTs) { return sweepableTimestamps.nextSweepableTimestampPartition(shardStrategy, lastSweptTs, sweepTs) .map(fine -> sweepableCells.getBatchForPartition(shardStrategy, fine, lastSweptTs, sweepTs)) .orElse(SweepBatch.of(ImmutableList.of(), DedicatedRows.of(ImmutableList.of()), sweepTs - 1L)); } }
private void assertNoEntriesInSweepableTimestampsBeforeSweepTimestamp() { assertThat(sweepableTimestamps .nextSweepableTimestampPartition(ShardAndStrategy.conservative(CONS_SHARD), -1L, getSweepTsCons())) .isEmpty(); }
private void assertLowestFinePartitionInSweepableTimestampsEquals(long partitionFine) { assertThat(sweepableTimestamps .nextSweepableTimestampPartition(ShardAndStrategy.conservative(CONS_SHARD), -1L, getSweepTsCons())) .contains(partitionFine); }
private Optional<Long> readThorough(int shardNumber) { return sweepableTimestamps.nextSweepableTimestampPartition( thorough(shardNumber), progress.getLastSweptTimestamp(ShardAndStrategy.thorough(shardNumber)), Sweeper.THOROUGH.getSweepTimestamp(timestampsSupplier)); }
private Optional<Long> readConservative(int shardNumber) { return sweepableTimestamps.nextSweepableTimestampPartition( conservative(shardNumber), progress.getLastSweptTimestamp(ShardAndStrategy.conservative(shardNumber)), Sweeper.CONSERVATIVE.getSweepTimestamp(timestampsSupplier)); }
SweepBatch getNextBatchToSweep(ShardAndStrategy shardStrategy, long lastSweptTs, long sweepTs) { return sweepableTimestamps.nextSweepableTimestampPartition(shardStrategy, lastSweptTs, sweepTs) .map(fine -> sweepableCells.getBatchForPartition(shardStrategy, fine, lastSweptTs, sweepTs)) .orElse(SweepBatch.of(ImmutableList.of(), DedicatedRows.of(ImmutableList.of()), sweepTs - 1L)); } }