@Test public void smokeTest() throws Exception { createTable(TABLE_1, SweepStrategy.CONSERVATIVE); createTable(TABLE_2, SweepStrategy.THOROUGH); createTable(TABLE_3, SweepStrategy.NOTHING); putManyCells(TABLE_1, 100, 110); putManyCells(TABLE_1, 103, 113); putManyCells(TABLE_1, 105, 115); putManyCells(TABLE_2, 101, 111); putManyCells(TABLE_2, 104, 114); putManyCells(TABLE_3, 120, 130); try (SingleLockService sweepLocks = backgroundSweeper.createSweepLocks()) { for (int i = 0; i < 50; ++i) { backgroundSweeper.checkConfigAndRunSweep(sweepLocks); } } verifyTableSwept(TABLE_1, 75, true); verifyTableSwept(TABLE_2, 58, false); List<SweepPriority> priorities = txManager.runTaskReadOnly( tx -> SweepPriorityStoreImpl.create(kvs, SweepTableFactory.of(), false).loadNewPriorities(tx)); Assert.assertTrue(priorities.stream().anyMatch(p -> p.tableRef().equals(TABLE_1))); Assert.assertTrue(priorities.stream().anyMatch(p -> p.tableRef().equals(TABLE_2))); }
@Override @Before public void setup() { super.setup(); sweeperService = new SweeperServiceImpl(specificTableSweeper, sweepBatchConfigSource); }
@Before public void setup() { InMemoryTimestampService tsService = new InMemoryTimestampService(); kvs = SweepStatsKeyValueService.create(getKeyValueService(), tsService, () -> AtlasDbConstants.DEFAULT_SWEEP_WRITE_THRESHOLD, () -> AtlasDbConstants.DEFAULT_SWEEP_WRITE_SIZE_THRESHOLD
@Before public void setup() { InMemoryTimestampService tsService = new InMemoryTimestampService(); kvs = SweepStatsKeyValueService.create(getKeyValueService(), tsService, () -> AtlasDbConstants.DEFAULT_SWEEP_WRITE_THRESHOLD, () -> AtlasDbConstants.DEFAULT_SWEEP_WRITE_SIZE_THRESHOLD
@Test public void smokeTest() throws Exception { createTable(TABLE_1, SweepStrategy.CONSERVATIVE); createTable(TABLE_2, SweepStrategy.THOROUGH); createTable(TABLE_3, SweepStrategy.NOTHING); putManyCells(TABLE_1, 100, 110); putManyCells(TABLE_1, 103, 113); putManyCells(TABLE_1, 105, 115); putManyCells(TABLE_2, 101, 111); putManyCells(TABLE_2, 104, 114); putManyCells(TABLE_3, 120, 130); try (SingleLockService sweepLocks = backgroundSweeper.createSweepLocks()) { for (int i = 0; i < 50; ++i) { backgroundSweeper.checkConfigAndRunSweep(sweepLocks); } } verifyTableSwept(TABLE_1, 75, true); verifyTableSwept(TABLE_2, 58, false); List<SweepPriority> priorities = txManager.runTaskReadOnly( tx -> SweepPriorityStoreImpl.create(kvs, SweepTableFactory.of(), false).loadNewPriorities(tx)); Assert.assertTrue(priorities.stream().anyMatch(p -> p.tableRef().equals(TABLE_1))); Assert.assertTrue(priorities.stream().anyMatch(p -> p.tableRef().equals(TABLE_2))); }
@Override @Before public void setup() { super.setup(); sweeperService = new SweeperServiceImpl(specificTableSweeper, sweepBatchConfigSource); }