use of com.couchbase.connector.cluster.consul.ConsulContext in project couchbase-elasticsearch-connector by couchbase.
the class PauseCommand method run.
@Override
public void run() {
final ConsulContext ctx = new ConsulContext(consulBuilder(), group, null);
validateGroup(ctx);
final Consul consul = ctx.consul();
final String configKey = ctx.keys().config();
final String configString = consul.keyValueClient().getValueAsString(configKey, UTF_8).orElse(null);
if (Strings.isNullOrEmpty(configString)) {
System.err.println("ERROR: Connector configuration document does not exist, or is empty.");
System.exit(1);
}
final ConnectorConfig config = ConnectorConfig.from(configString);
try {
CheckpointBackup.backup(config, output);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
Aggregations