Commit 0744f0c3 authored by Daniel Seybold's avatar Daniel Seybold

switched execution order of cluster state and record count command

parent 8f90b233
Pipeline #54293 passed with stage
in 13 minutes and 16 seconds
......@@ -61,14 +61,14 @@ public class RemoteCommand extends EvaluationTask {
}
String seedEnpoint = endpoints.get(0);
String command = null;
String recordCountCommand = null;
String statusCommand = null;
if(this.DBMSType.toLowerCase().equals("cassandra")){
command = getCassandraRecordCountCommand();
recordCountCommand = getCassandraRecordCountCommand();
statusCommand = getCassandraClusterStateCommand();
}else if(this.DBMSType.toLowerCase().equals("couchbase")){
command = getCouchbaseRecordCountCommand();
recordCountCommand = getCouchbaseRecordCountCommand();
statusCommand = getCouchbaseClusterStateCommand();
}else {
LOGGER.error(this.loggerPrefix + "Unsupported command target: " + this.DBMSType + "! Skipping RemoteCommand Task!");
......@@ -110,7 +110,7 @@ public class RemoteCommand extends EvaluationTask {
jsch.addIdentity("test_rsa", privateKeyPlain.getBytes(), publicKeyPlain.getBytes(), "secret".getBytes());
/**
* get Records session
* get cluster state session
*/
Session session = jsch.getSession(user, seedEnpoint, port);
session.setConfig("StrictHostKeyChecking", "no");
......@@ -121,23 +121,23 @@ public class RemoteCommand extends EvaluationTask {
channel.setInputStream(null);
InputStream output = channel.getInputStream();
channel.setErrStream(System.err);
channel.setCommand(command);
channel.setCommand(statusCommand);
channel.connect();
String result = CharStreams.toString(new InputStreamReader(output));
String clusterStateResult = CharStreams.toString(new InputStreamReader(output));
//printOutput(channel);
channel.disconnect();
LOGGER.debug(this.loggerPrefix + "The remote result command is: " + result);
LOGGER.debug(this.loggerPrefix + "The remote clusterState command is: " + clusterStateResult);
/**
* Log the total number of records
*/
logCustomEntry("CLUSTER_STATE",result);
logCustomEntry("CLUSTER_STATE",clusterStateResult);
/**
* get Cluster state session
* get record count session
*/
session = jsch.getSession(user, seedEnpoint, port);
session.setConfig("StrictHostKeyChecking", "no");
......@@ -148,19 +148,19 @@ public class RemoteCommand extends EvaluationTask {
channel.setInputStream(null);
output = channel.getInputStream();
channel.setErrStream(System.err);
channel.setCommand(statusCommand);
channel.setCommand(recordCountCommand);
channel.connect();
String clusterResult = CharStreams.toString(new InputStreamReader(output));
String recordCountResult = CharStreams.toString(new InputStreamReader(output));
//printOutput(channel);
channel.disconnect();
LOGGER.debug(this.loggerPrefix + "The remote result command is: " + clusterResult);
LOGGER.debug(this.loggerPrefix + "The remote recordCount command result is: " + recordCountResult);
/**
* Log the total number of records
*/
logCustomEntry("CLUSTER_STATE",clusterResult);
logCustomEntry("RECORD_COUNT",recordCountResult);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment