@Override public void compactInternally(TableReference tableRef) { delegate1.compactInternally(tableRef); delegate2.compactInternally(tableRef); }
@Override public void compactInternally(TableReference tableRef, boolean inMaintenanceMode) { delegate1.compactInternally(tableRef, inMaintenanceMode); delegate2.compactInternally(tableRef, inMaintenanceMode); }
/** * Some compaction operations might block reads and writes. * These operations will trigger only if inMaintenanceMode is set to true. */ default void compactInternally(TableReference tableRef, boolean inMaintenanceMode) { compactInternally(tableRef); }
@Override public void compactInternally(TableReference tableRef, boolean inMaintenanceMode) { delegate().compactInternally(tableRef, inMaintenanceMode); }
@Test public void compactingShouldNotFail() { keyValueService.compactInternally(TEST_TABLE); }
@Override public void compactInternally(TableReference tableRef) { getDelegate(tableRef).compactInternally(tableRef); }
@Override public void compactInternally(TableReference tableRef, boolean inMaintenanceMode) { getDelegate(tableRef).compactInternally(tableRef, inMaintenanceMode); }
@Override public void compactInternally(TableReference tableRef) { delegate().compactInternally(tableRef); }
@Override public void compactInternally(TableReference tableRef) { try { delegate().compactInternally(tableMapper.getMappedTableName(tableRef)); } catch (TableMappingNotFoundException e) { throw new IllegalArgumentException(e); } }
@Override public void compactInternally(TableReference tableRef, boolean inMaintenanceMode) { try { delegate().compactInternally(tableMapper.getMappedTableName(tableRef), inMaintenanceMode); } catch (TableMappingNotFoundException e) { throw new IllegalArgumentException(e); } }
@Override public void compactInternally(TableReference tableRef) { maybeLog(() -> delegate.compactInternally(tableRef), logTimeAndTable("compactInternally", tableRef)); }
public void compactInternally(TableReference tableRef, boolean inMaintenanceMode) { //noinspection unused - try-with-resources closes trace try (CloseableTrace trace = startLocalTrace("compactInternally({})", tableRef)) { delegate().compactInternally(tableRef, inMaintenanceMode); } }
private void compactTable(String tableToCompact, CompactorConfig config) { // System tables MAY be involved in this process. keyValueService.compactInternally(TableReference.createUnsafe(tableToCompact), config.inMaintenanceMode()); }
@Override public void compactInternally(TableReference tableRef) { //noinspection unused - try-with-resources closes trace try (CloseableTrace trace = startLocalTrace("compactInternally({})", LoggingArgs.safeTableOrPlaceholder(tableRef))) { delegate().compactInternally(tableRef); } }
@Test public void compactInternally() throws Exception { kvs.compactInternally(TABLE_REF); checkSpan("atlasdb-kvs.compactInternally({table})"); verify(delegate).compactInternally(TABLE_REF); verifyNoMoreInteractions(delegate); }
@Test public void canReturnCompactionFailure() throws InterruptedException { doThrow(new RuntimeException()) .when(kvs).compactInternally(TABLE, true); BackgroundCompactor.CompactionOutcome outcome = compactor.grabLockAndRunOnce(lockService); assertThat(outcome).isEqualTo(BackgroundCompactor.CompactionOutcome.FAILED_TO_COMPACT); }
@Test public void passesMaintenanceHoursCorrectly() throws InterruptedException { BackgroundCompactor backgroundCompactor = new BackgroundCompactor(metricsManager, txManager, kvs, mock(LockService.class), createAlternatingInMaintenanceHoursSupplier(), priorityCalculator); BackgroundCompactor.CompactionOutcome firstOutcome = backgroundCompactor.grabLockAndRunOnce(lockService); verify(kvs).compactInternally(TABLE, true); BackgroundCompactor.CompactionOutcome secondOutcome = backgroundCompactor.grabLockAndRunOnce(lockService); verify(kvs).compactInternally(TABLE, false); assertThat(firstOutcome).isEqualTo(BackgroundCompactor.CompactionOutcome.SUCCESS); assertThat(secondOutcome).isEqualTo(BackgroundCompactor.CompactionOutcome.SUCCESS); verifyNoMoreInteractions(kvs); }
@Override public void compactInternally(TableReference tableRef, boolean inMaintenanceMode) { long startTime = System.currentTimeMillis(); maybeLog(() -> delegate.compactInternally(tableRef, inMaintenanceMode), (logger, stopwatch) -> { if (inMaintenanceMode) { // Log differently in maintenance mode - if a compactInternally is slow this might be bad in normal // operational hours, but is probably okay in maintenance mode. logger.log("Call to KVS.compactInternally (in maintenance mode) at time {}, on table {} took {} ms.", LoggingArgs.startTimeMillis(startTime), LoggingArgs.tableRef(tableRef), LoggingArgs.durationMillis(stopwatch)); } else { logger.log("Call to KVS.{} at time {}, on table {} took {} ms.", LoggingArgs.method("compactInternally"), LoggingArgs.startTimeMillis(startTime), LoggingArgs.tableRef(tableRef), LoggingArgs.durationMillis(stopwatch)); } }); }
public void compactInternally(TableReference tableRef, boolean inMaintenanceMode) { //noinspection unused - try-with-resources closes trace try (CloseableTrace trace = startLocalTrace("compactInternally({})", tableRef)) { delegate().compactInternally(tableRef, inMaintenanceMode); } }
@Override public void compactInternally(TableReference tableRef) { //noinspection unused - try-with-resources closes trace try (CloseableTrace trace = startLocalTrace("compactInternally({})", LoggingArgs.safeTableOrPlaceholder(tableRef))) { delegate().compactInternally(tableRef); } }