Commit 60d8589b authored by Daniel Seybold's avatar Daniel Seybold

next try

parent 4c107f1d
Pipeline #55371 passed with stage
in 10 minutes and 47 seconds
......@@ -57,7 +57,7 @@ public class ScenarioApiServiceImpl extends ScenarioApiService {
evaluationContext.setRunCounter(0);
evaluationContext.setStartTime(System.currentTimeMillis());
ClusterContext clusterContext = new ClusterContext();
clusterContext.setIdApplicationInstance("1376257");
clusterContext.setIdApplicationInstance("1605632");
RemoteCommand remoteCommand = new RemoteCommand(evaluationContext,clusterContext,"cassandra");
remoteCommand.call();
......
......@@ -143,8 +143,6 @@ public class RemoteCommand extends EvaluationTask {
session.disconnect();
/**
* Log the cluster state
*/
......@@ -163,6 +161,10 @@ public class RemoteCommand extends EvaluationTask {
ChannelExec channel2 = (ChannelExec) session2.openChannel("exec");
channel2.setCommand(recordCountCommand);
/*
channel2.setInputStream(null);
InputStream output2 = channel2.getInputStream();
channel2.setErrStream(System.err);
......@@ -178,6 +180,52 @@ public class RemoteCommand extends EvaluationTask {
session2.disconnect();
*/
InputStream commandOutput = channel2.getExtInputStream();
StringBuilder outputBuffer = new StringBuilder();
StringBuilder errorBuffer = new StringBuilder();
InputStream in = channel2.getInputStream();
InputStream err = channel2.getExtInputStream();
channel2.connect();
byte[] tmp = new byte[1024];
while (true) {
while (in.available() > 0) {
int i = in.read(tmp, 0, 1024);
if (i < 0) break;
outputBuffer.append(new String(tmp, 0, i));
}
while (err.available() > 0) {
int i = err.read(tmp, 0, 1024);
if (i < 0) break;
errorBuffer.append(new String(tmp, 0, i));
}
if (channel2.isClosed()) {
if ((in.available() > 0) || (err.available() > 0)) continue;
LOGGER.debug(this.loggerPrefix + "The remote recordCount command exit-status: " + channel2.getExitStatus());
break;
}
try {
Thread.sleep(1000);
} catch (Exception ee) {
LOGGER.debug("Exception while executing record count command!",ee);
}
}
String recordCountResult = outputBuffer.toString();
String recordCountError = errorBuffer.toString();
LOGGER.debug(this.loggerPrefix + "The remote recordCount command result is: " + recordCountResult);
LOGGER.debug(this.loggerPrefix + "The remote recordCount error result is: " + recordCountError);
channel2.disconnect();
/**
* Log the total number of records
*/
......
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