@Test void vacuumAfterPathWasScheduledForHousekeeping() throws IOException { initialiseApp(); setUnpartitionedTable(); HousekeepingPath path = new HousekeepingPath.Builder().databaseName(databaseName) .tableName(tableName) .path("file:" + snapshot0Dir.toString()) .housekeepingStatus(SCHEDULED) .creationTimestamp(LocalDateTime.now()) .cleanupDelay(Duration.parse("P3D")) .lifecycleType(UNREFERENCED.toString()) .build(); repository.save(path); application.run(args); verifyNoInteractions(schedulerService); }
@Override public void run(ApplicationArguments args) { log.warn("Do not run this tool at the same time as replicating to the target table!"); if (isDryRun) { log.warn("Dry-run only!"); } try { metastore = clientSupplier.get(); housekeepingPaths = fetchHousekeepingPaths(beekeeperRepository); vacuumTable(databaseName, tableName); } catch (URISyntaxException | TException | IOException e) { throw new RuntimeException(e); } finally { if (metastore != null) { metastore.close(); } } }
BeekeeperVacuumToolApplication implements ApplicationRunner { @Override public void run(ApplicationArguments args) { log.warn("Do not run this tool at the same time as replicating to the target table!"); if (isDryRun) { log.warn("Dry-run only!"); } try { metastore = clientSupplier.get(); housekeepingPaths = fetchHousekeepingPaths(beekeeperRepository); vacuumTable(databaseName, tableName); } catch (URISyntaxException | TException | IOException e) { throw new RuntimeException(e); } finally { if (metastore != null) { metastore.close(); } } } }
BeekeeperVacuumToolApplication implements ApplicationRunner { @Override public void run(ApplicationArguments args) { log.warn("Do not run this tool at the same time as replicating to the target table!"); if (isDryRun) { log.warn("Dry-run only!"); } try { metastore = clientSupplier.get(); housekeepingPaths = fetchHousekeepingPaths(beekeeperRepository); vacuumTable(databaseName, tableName); } catch (URISyntaxException | TException | IOException e) { throw new RuntimeException(e); } finally { if (metastore != null) { metastore.close(); } } } @Autowired  BeekeeperVacuumToolApplication(
      Supplier<CloseableMetaStoreClient> clientSupplier,
      SchedulerService schedulerService,
      BeekeeperRepository beekeeperRepository,
      HiveConf conf,
      @Value("${database}") String databaseName,
      @Value("${table}") String tableName,
      @Value("${default-cleanup-delay:P3D}") String cleanupDelay,
      @Value("${dry-run:false}") boolean isDryRun,
      @Value("${partition-batch-size:1000}") short batchSize); }
BeekeeperVacuumToolApplication implements ApplicationRunner { @Override public void run(ApplicationArguments args) { log.warn("Do not run this tool at the same time as replicating to the target table!"); if (isDryRun) { log.warn("Dry-run only!"); } try { metastore = clientSupplier.get(); housekeepingPaths = fetchHousekeepingPaths(beekeeperRepository); vacuumTable(databaseName, tableName); } catch (URISyntaxException | TException | IOException e) { throw new RuntimeException(e); } finally { if (metastore != null) { metastore.close(); } } } @Autowired  BeekeeperVacuumToolApplication(
      Supplier<CloseableMetaStoreClient> clientSupplier,
      SchedulerService schedulerService,
      BeekeeperRepository beekeeperRepository,
      HiveConf conf,
      @Value("${database}") String databaseName,
      @Value("${table}") String tableName,
      @Value("${default-cleanup-delay:P3D}") String cleanupDelay,
      @Value("${dry-run:false}") boolean isDryRun,
      @Value("${partition-batch-size:1000}") short batchSize); @Override void run(ApplicationArguments args); }
BeekeeperVacuumToolApplication implements ApplicationRunner { @Override public void run(ApplicationArguments args) { log.warn("Do not run this tool at the same time as replicating to the target table!"); if (isDryRun) { log.warn("Dry-run only!"); } try { metastore = clientSupplier.get(); housekeepingPaths = fetchHousekeepingPaths(beekeeperRepository); vacuumTable(databaseName, tableName); } catch (URISyntaxException | TException | IOException e) { throw new RuntimeException(e); } finally { if (metastore != null) { metastore.close(); } } } @Autowired  BeekeeperVacuumToolApplication(
      Supplier<CloseableMetaStoreClient> clientSupplier,
      SchedulerService schedulerService,
      BeekeeperRepository beekeeperRepository,
      HiveConf conf,
      @Value("${database}") String databaseName,
      @Value("${table}") String tableName,
      @Value("${default-cleanup-delay:P3D}") String cleanupDelay,
      @Value("${dry-run:false}") boolean isDryRun,
      @Value("${partition-batch-size:1000}") short batchSize); @Override void run(ApplicationArguments args);  }