@Test @Timeout(value = 10) void doNotInfiniteLoopOnDryRunCleanup() { pagingCleanupService = new PagingMetadataCleanupService(handlers, 2, true); List<HousekeepingMetadata> tables = List .of(createHousekeepingMetadata("table1", "s3: createHousekeepingMetadata("table2", "s3: createHousekeepingMetadata("table3", "s3: metadataRepository.saveAll(tables); pagingCleanupService.cleanUp(Instant.now()); metadataRepository.findAll().forEach(table -> { assertThat(table.getCleanupAttempts()).isEqualTo(0); assertThat(table.getHousekeepingStatus()).isEqualTo(SCHEDULED); }); }
@Override @Timed("metadata-cleanup-job") public void cleanUp(Instant referenceTime) { try { metadataHandlers.forEach(handler -> pagingCleanup(handler, referenceTime)); } catch (Exception e) { throw new BeekeeperException(format("Metadata cleanup failed for instant %s", referenceTime.toString()), e); } }
PagingMetadataCleanupService implements CleanupService { @Override @Timed("metadata-cleanup-job") public void cleanUp(Instant referenceTime) { try { metadataHandlers.forEach(handler -> pagingCleanup(handler, referenceTime)); } catch (Exception e) { throw new BeekeeperException(format("Metadata cleanup failed for instant %s", referenceTime.toString()), e); } } }
PagingMetadataCleanupService implements CleanupService { @Override @Timed("metadata-cleanup-job") public void cleanUp(Instant referenceTime) { try { metadataHandlers.forEach(handler -> pagingCleanup(handler, referenceTime)); } catch (Exception e) { throw new BeekeeperException(format("Metadata cleanup failed for instant %s", referenceTime.toString()), e); } } PagingMetadataCleanupService(
      List<MetadataHandler> metadataHandlers,
      int pageSize,
      boolean dryRunEnabled); }
PagingMetadataCleanupService implements CleanupService { @Override @Timed("metadata-cleanup-job") public void cleanUp(Instant referenceTime) { try { metadataHandlers.forEach(handler -> pagingCleanup(handler, referenceTime)); } catch (Exception e) { throw new BeekeeperException(format("Metadata cleanup failed for instant %s", referenceTime.toString()), e); } } PagingMetadataCleanupService(
      List<MetadataHandler> metadataHandlers,
      int pageSize,
      boolean dryRunEnabled); @Override @Timed("metadata-cleanup-job") void cleanUp(Instant referenceTime); }
PagingMetadataCleanupService implements CleanupService { @Override @Timed("metadata-cleanup-job") public void cleanUp(Instant referenceTime) { try { metadataHandlers.forEach(handler -> pagingCleanup(handler, referenceTime)); } catch (Exception e) { throw new BeekeeperException(format("Metadata cleanup failed for instant %s", referenceTime.toString()), e); } } PagingMetadataCleanupService(
      List<MetadataHandler> metadataHandlers,
      int pageSize,
      boolean dryRunEnabled); @Override @Timed("metadata-cleanup-job") void cleanUp(Instant referenceTime);  }