use of com.instaclustr.esop.impl.remove.RemoveBackupOperation in project esop by instaclustr.
the class RemoveBackupApplication method run.
@Override
public void run() {
Esop.logCommandVersionInformation(spec);
final List<Module> modules = Collections.singletonList(new RemoveBackupModule());
Esop.init(this, jmxSpec, new HashSpec(), request, logger, modules);
if (rate.value == 0) {
final Operation<?> operation = operationsService.submitOperationRequest(request);
await().forever().until(() -> operation.state.isTerminalState());
if (operation.state == FAILED) {
throw new IllegalStateException(format("List operation %s was not successful.", operation.id));
}
} else {
final Supplier<RemoveBackupOperation> supplier = () -> new RemoveBackupOperation(request, cassandraJMXService, restorerFactoryMap, objectMapper);
final DaemonScheduler<RemoveBackupRequest, RemoveBackupOperation> scheduler = new DaemonScheduler<>(rate, supplier);
scheduler.setup();
scheduler.execute();
}
}
Aggregations