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 SweepBatch readConservative(int shard, long partition, long minExclusive, long maxExclusive) { return sweepableCells.getBatchForPartition(conservative(shard), partition, minExclusive, maxExclusive); }
private SweepBatch readThorough(long partition, long minExclusive, long maxExclusive) { return sweepableCells.getBatchForPartition(thorough(shardThor), partition, minExclusive, maxExclusive); }
private void assertSweepableCellsHasNoEntriesInPartitionOfTimestamp(long timestamp) { SweepBatch batch = sweepableCells.getBatchForPartition( ShardAndStrategy.conservative(CONS_SHARD), tsPartitionFine(timestamp), -1L, Long.MAX_VALUE); assertThat(batch.writes()).isEmpty(); }
private void assertSweepableCellsHasEntryForTimestamp(long timestamp) { SweepBatch batch = sweepableCells.getBatchForPartition( ShardAndStrategy.conservative(CONS_SHARD), tsPartitionFine(timestamp), -1L, timestamp + 1); assertThat(batch.writes()).containsExactly(WriteInfo.write(TABLE_CONS, DEFAULT_CELL, timestamp)); }
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)); } }