Commit 3529c153 authored by Daniel Seybold's avatar Daniel Seybold

added mongodb command builder for tsbs

parent 05e8848b
Pipeline #81628 passed with stage
in 16 minutes and 1 second
......@@ -320,7 +320,7 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
String loadCommand = "";
loadCommand = TSBSCommandBuilder.generateLoadCommand(TSBS_BINARY, properties.getProperty(WorkloadApiProperties.WORKLOAD_DATA_FOLDER), workload.getDbms(), workload.getTsbsLoadExecution(),workload.getDbEndpoints());
loadCommand += " &> " + properties.getProperty(WorkloadApiProperties.WORKLOAD_RESULTS_FOLDER) + TSBS_RESULT_FOLDER + taskId.trim() + "_load.txt";
workloadProcess
.startWorkload(TSBS_BINARY, UNIX_SHELL, UNIX_COMMAND_PARAM, loadCommand, taskId,
......
......@@ -229,6 +229,8 @@ public class TSBSCommandBuilder {
queriesCommand += timescaledbCommand(dbmsProperties, dbEndpoints,query);
}else if(dbms.equals(DbmsEnum.CASSANDRA)){
queriesCommand += cassandraCommand(dbmsProperties,dbEndpoints,query);
}else if(dbms.equals(DbmsEnum.MONGODB)){
queriesCommand += mongodbCommand(dbmsProperties,dbEndpoints,query);
}
else {
......@@ -238,6 +240,27 @@ public class TSBSCommandBuilder {
return queriesCommand;
}
private static String mongodbCommand(List<TSDBMSDBMSProperties> dbmsProperties,
DBEndpoints dbEndpoints, Phase query){
String mongodbCommand = " ";
StringJoiner mongosHosts = new StringJoiner(",");
for (DBEndpoint dbEndpoint: dbEndpoints) {
mongosHosts.add(dbEndpoint.getIpAddress()+ ":27017");
LOGGER.warn("Custom ports for MongoDB currently not supported, using default port 27017!");
}
mongodbCommand += "--url " + mongosHosts;
//TODO: check for supported but optional MongoDB commands
//TODO: check if TSBS needs to be extended to support dedicated write and read consistency settings
return mongodbCommand;
}
private static String influxCommand(
List<TSDBMSDBMSProperties> dbmsProperties,
......
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