class 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);

}