Commit 057cfefa authored by Daniel Seybold's avatar Daniel Seybold

another approach to get cassandra record count

parent a8e51bfe
Pipeline #54428 passed with stage
in 10 minutes and 11 seconds
......@@ -60,11 +60,20 @@ public class RemoteCommand extends EvaluationTask {
return new DefaultWorkReport(WorkStatus.FAILED);
}
List<String> privateEndpoints = ColosseumUtils
.getEndpoints(appInstanceId, "PRIVATE", DBMSNodeType.SEED);
if (privateEndpoints.isEmpty() || privateEndpoints.size()>1){
LOGGER.error( this.loggerPrefix + "Invalid number of Seed private endpoints: " + privateEndpoints.size());
return new DefaultWorkReport(WorkStatus.FAILED);
}
String seedEnpoint = endpoints.get(0);
String seedPrivateEndpoint = privateEndpoints.get(0);
String recordCountCommand = null;
String statusCommand = null;
if(this.DBMSType.toLowerCase().equals("cassandra")){
recordCountCommand = getCassandraRecordCountCommand();
recordCountCommand = getCassandraRecordCountCommand(seedPrivateEndpoint);
statusCommand = getCassandraClusterStateCommand();
}else if(this.DBMSType.toLowerCase().equals("couchbase")){
......@@ -211,7 +220,7 @@ public class RemoteCommand extends EvaluationTask {
}
private static String getCassandraRecordCountCommand(){
private static String getCassandraRecordCountCommand(String host){
//TODO: check if these values need to be derived dynamically based on total number of records?
/**
......@@ -223,7 +232,7 @@ public class RemoteCommand extends EvaluationTask {
*/
int numOfSplits = 256;
String command = "source /etc/environment && sudo -E timeout 180 ./cassandra-count -host $LOCAL_ADDRESS -keyspace ycsb -table usertable -splitSize " + splitSize + " -numSplits " + numOfSplits;
String command = "sudo timeout 180 ./cassandra-count -host " + host + " -keyspace ycsb -table usertable -splitSize " + splitSize + " -numSplits " + numOfSplits;
/**
* limited memory usage
......
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