@Test void vacuumWithFilesThatShouldNotBeScheduled() throws TException, IOException { initialiseApp(); setPartitionedTable("partition1_"); Files.createTempDirectory(snapshot1Dir, ".hidden1_"); Files.createTempDirectory(snapshot1Dir, "_hidden2_"); Files.createTempDirectory(tableDir, "snapshot3_"); application.run(args); verify(schedulerService, times(2)).scheduleForHousekeeping(housekeepingPath.capture()); assertThat(assertBytesLogged(14)).isTrue(); }
@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);  }