Commit 1ed3956f authored by Daniel Seybold's avatar Daniel Seybold

applied several bugfixes for tsbs with influx test case

parent 244519ab
Pipeline #80402 passed with stage
in 21 minutes and 26 seconds
......@@ -23,7 +23,7 @@ import javax.validation.constraints.*;
/**
* DBEndpoint
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class DBEndpoint {
@JsonProperty("ipAddress")
private String ipAddress = null;
......
......@@ -22,7 +22,7 @@ import javax.validation.constraints.*;
* a list of the database endpoints to issue the workload
*/
@ApiModel(description = "a list of the database endpoints to issue the workload")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class DBEndpoints extends java.util.ArrayList<DBEndpoint> {
@Override
......
......@@ -25,7 +25,7 @@ import javax.validation.constraints.*;
/**
* DatabaseConfig
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class DatabaseConfig {
/**
* Gets or Sets databaseBinding
......
......@@ -23,7 +23,7 @@ import javax.validation.constraints.*;
/**
* DatabaseConfigProperty
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class DatabaseConfigProperty {
@JsonProperty("name")
private String name = null;
......
......@@ -23,7 +23,7 @@ import javax.validation.constraints.*;
/**
* Error
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class Error {
@JsonProperty("code")
private Integer code = null;
......
......@@ -24,7 +24,7 @@ import javax.validation.constraints.*;
/**
* MeasurementConfig
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class MeasurementConfig {
@JsonProperty("interval")
private Integer interval = null;
......
......@@ -25,7 +25,7 @@ import javax.validation.constraints.*;
/**
* TPCCWorkload
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class TPCCWorkload {
@JsonProperty("dbEndpoints")
private DBEndpoints dbEndpoints = null;
......
......@@ -23,7 +23,7 @@ import javax.validation.constraints.*;
/**
* TPCCWorkloadConfig
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class TPCCWorkloadConfig {
@JsonProperty("activeWarehouses")
private Integer activeWarehouses = null;
......
......@@ -25,7 +25,7 @@ import javax.validation.constraints.*;
* parameters for the data generation phase
*/
@ApiModel(description = "parameters for the data generation phase")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class TSBSDataGeneration {
@JsonProperty("usecase")
private String usecase = null;
......
......@@ -25,7 +25,7 @@ import javax.validation.constraints.*;
/**
* TSBSLoadExecution
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class TSBSLoadExecution {
@JsonProperty("workers")
private BigDecimal workers = null;
......
......@@ -25,7 +25,7 @@ import javax.validation.constraints.*;
/**
* TSBSQueryExecution
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class TSBSQueryExecution {
@JsonProperty("workers")
private BigDecimal workers = null;
......
......@@ -25,7 +25,7 @@ import javax.validation.constraints.*;
* parameters for the query generation phase
*/
@ApiModel(description = "parameters for the query generation phase")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class TSBSQueryGeneration {
@JsonProperty("usecase")
private String usecase = null;
......
......@@ -29,7 +29,7 @@ import javax.validation.constraints.*;
/**
* TSBSWorkload
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class TSBSWorkload {
@JsonProperty("dbEndpoints")
private DBEndpoints dbEndpoints = null;
......
......@@ -23,7 +23,7 @@ import javax.validation.constraints.*;
/**
* TSDBMSDBMSProperties
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class TSDBMSDBMSProperties {
@JsonProperty("name")
private String name = null;
......@@ -41,7 +41,7 @@ public class TSDBMSDBMSProperties {
* @return name
**/
@JsonProperty("name")
@ApiModelProperty(example = "-urls", value = "")
@ApiModelProperty(example = "consistency", value = "")
public String getName() {
return name;
}
......@@ -60,7 +60,7 @@ public class TSDBMSDBMSProperties {
* @return value
**/
@JsonProperty("value")
@ApiModelProperty(example = "http://localhost:8086", value = "")
@ApiModelProperty(example = "all", value = "")
public String getValue() {
return value;
}
......
......@@ -24,7 +24,7 @@ import javax.validation.constraints.*;
/**
* WorkloadConfig
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class WorkloadConfig {
/**
* Gets or Sets workloadType
......
......@@ -25,7 +25,7 @@ import javax.validation.constraints.*;
/**
* WorkloadProcessInstance
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class WorkloadProcessInstance {
@JsonProperty("processId")
private String processId = null;
......
......@@ -23,7 +23,7 @@ import javax.validation.constraints.*;
/**
* WorkloadProcessSubmissionError
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class WorkloadProcessSubmissionError {
@JsonProperty("message")
private String message = null;
......
......@@ -27,7 +27,7 @@ import javax.validation.constraints.*;
/**
* YCSBWorkload
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class YCSBWorkload {
@JsonProperty("dbEndpoints")
private DBEndpoints dbEndpoints = null;
......
package de.uulm.omi.dbms.workload.api;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class ApiException extends Exception{
private int code;
public ApiException (int code, String msg) {
......
......@@ -5,7 +5,7 @@ import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class ApiOriginFilter implements javax.servlet.Filter {
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
......
......@@ -3,7 +3,7 @@ package de.uulm.omi.dbms.workload.api;
import javax.xml.bind.annotation.XmlTransient;
@javax.xml.bind.annotation.XmlRootElement
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class ApiResponseMessage {
public static final int ERROR = 1;
public static final int WARNING = 2;
......
package de.uulm.omi.dbms.workload.api;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class NotFoundException extends ApiException {
private int code;
public NotFoundException (int code, String msg) {
......
package de.uulm.omi.dbms.workload.api;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
......
......@@ -35,7 +35,7 @@ import javax.validation.constraints.*;
@Produces({ "application/json" })
@io.swagger.annotations.Api(description = "the workload API")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class WorkloadApi {
private final WorkloadApiService delegate;
......
......@@ -21,7 +21,7 @@ import java.io.InputStream;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.validation.constraints.*;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public abstract class WorkloadApiService {
public abstract Response workloadResultGet( @NotNull String taskId, @NotNull String workloadType,SecurityContext securityContext) throws NotFoundException;
public abstract Response workloadStatusGet( String applicationInstanceId,SecurityContext securityContext) throws NotFoundException;
......
......@@ -3,7 +3,7 @@ package de.uulm.omi.dbms.workload.api.factories;
import de.uulm.omi.dbms.workload.api.WorkloadApiService;
import de.uulm.omi.dbms.workload.api.impl.WorkloadApiServiceImpl;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-06T14:02:53.472+02:00")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2020-05-07T15:01:13.551+02:00")
public class WorkloadApiServiceFactory {
private final static WorkloadApiService service = new WorkloadApiServiceImpl();
......
......@@ -45,8 +45,8 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
//TSBS constants
private final String TSBS_DATA_FOLDER = "/tmp/"; // TODO CHANGE
private final String TSBS_RESULT_FOLDER = "/tmp/"; // TODO CHANGE
private final String TSBS_DATA_FOLDER = "TSBS/"; // TODO CHANGE
private final String TSBS_RESULT_FOLDER = "TSBS/"; // TODO CHANGE
private static final String TSBS_BINARY = "/opt/workloads/tsbs/bin/";
private static final String TSBS_SCRIPTS = "/opt/workloads/tsbs/src/github.com/timescale/tsbs/scripts/";
......@@ -250,7 +250,8 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
e.printStackTrace();
}
}
LOGGER.debug("Phase 1; data generation finished!");
LOGGER.debug("Phase 1: data generation finished with exit code: " + processData.exitValue());
//Phase 2: query generation
......@@ -276,11 +277,33 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
e.printStackTrace();
}
}
LOGGER.debug("Phase 2: query generation finished!");
LOGGER.debug("Phase 2: query generation finished with exit code: " + processGenQueries.exitValue());
//Phase 3: executing insert/load phase
//clear database
String clearDBCommand = TSBSCommandBuilder.clearDB(workload.getDbms(), workload.getTsbsLoadExecution().getDbName(),workload.getDbEndpoints());
ProcessBuilder processClearDBBuilder = new ProcessBuilder();
processClearDBBuilder.command(UNIX_SHELL, UNIX_COMMAND_PARAM, clearDBCommand);
Process clearDBProcess = null;
try {
clearDBProcess = processClearDBBuilder.start();
} catch (IOException e) {
e.printStackTrace();
}
while (clearDBProcess.isAlive()) {
try {
LOGGER.debug("Clear DB in process...");
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
LOGGER.debug("Clear DB finished with exit code: " + clearDBProcess.exitValue());
String loadCommand = "";
loadCommand = TSBSCommandBuilder.generateLoadCommand(TSBS_BINARY, workload.getDbms(), workload.getTsbsLoadExecution());
loadCommand = TSBSCommandBuilder.generateLoadCommand(TSBS_BINARY, workload.getDbms(), workload.getTsbsLoadExecution(),workload.getDbEndpoints());
loadCommand += " > " + TSBS_RESULT_FOLDER + taskId.trim() + "_load.txt";
LOGGER.debug(loadCommand);
......@@ -301,12 +324,12 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
e.printStackTrace();
}
}
LOGGER.debug("Phase 3: load phase finished!");
LOGGER.debug("Phase 3: load phase finished with exit code: " + processLoad.exitValue());
//Phase 4: executing query phase
//Execute Queries
String executeQueriesCommand = TSBSCommandBuilder.executeQueriesCommand(TSBS_BINARY, TSBS_DATA_FOLDER, workload.getDbms(), workload.getTsbsQueryExecution() );
String executeQueriesCommand = TSBSCommandBuilder.executeQueriesCommand(TSBS_BINARY, TSBS_DATA_FOLDER, workload.getDbms(), workload.getTsbsQueryExecution(), workload.getDbEndpoints() );
executeQueriesCommand += " > " + TSBS_RESULT_FOLDER + taskId.trim() + ".txt";
LOGGER.debug(loadCommand);
......
......@@ -2,6 +2,7 @@ package de.uulm.omi.workload.tsbs;
import static com.google.common.base.Preconditions.checkNotNull;
import de.uulm.omi.cloudiator.dbms.evaluator.model.DBEndpoints;
import de.uulm.omi.cloudiator.dbms.evaluator.model.TSBSDataGeneration;
import de.uulm.omi.cloudiator.dbms.evaluator.model.TSBSLoadExecution;
import de.uulm.omi.cloudiator.dbms.evaluator.model.TSBSQueryExecution;
......@@ -41,7 +42,7 @@ public class TSBSCommandBuilder {
if (tsbsDataGeneration.getScale() != null) {
generateDataCommand += "--scale=" + tsbsDataGeneration.getScale().toString().toLowerCase() + " ";
generateDataCommand += "--scale=" + tsbsDataGeneration.getScale() + " ";
}
else throw new IllegalArgumentException("Missing or incorrect --scale parameter!");
......@@ -64,7 +65,7 @@ public class TSBSCommandBuilder {
if (dbms.toString() != null) {
generateDataCommand += "-format=\"" + dbms.toString()+ "\"";
generateDataCommand += "--format=\"" + dbms.toString()+ "\"";
} else throw new IllegalArgumentException("Missing or incorrect --log-interval parameter!");
......@@ -89,13 +90,13 @@ public class TSBSCommandBuilder {
else throw new IllegalArgumentException("Missing or incorrect --use-case parameter!");
if (tsbsDataGeneration.getSeed() != null) {
generateQueryCommand += "--seed=" + tsbsDataGeneration.getSeed().toString().toLowerCase() + " ";
generateQueryCommand += "--seed=" + tsbsDataGeneration.getSeed() + " ";
}
else throw new IllegalArgumentException("Missing or incorrect --seed parameter!");
if (tsbsDataGeneration.getScale() != null) {
generateQueryCommand += "--scale=" + tsbsDataGeneration.getScale().toString().toLowerCase() + " ";
generateQueryCommand += "--scale=" + tsbsDataGeneration.getScale() + " ";
}
else throw new IllegalArgumentException("Missing or incorrect --scale parameter!");
......@@ -127,7 +128,7 @@ public class TSBSCommandBuilder {
if (dbms.toString() != null) {
generateQueryCommand += "-format=\"" + dbms.toString() + "\"";
generateQueryCommand += "--format=\"" + dbms.toString() + "\"";
} else throw new IllegalArgumentException("Missing or incorrect --log-interval parameter!");
......@@ -138,14 +139,16 @@ public class TSBSCommandBuilder {
public static String generateLoadCommand(String binaryPath, DbmsEnum dbms, TSBSLoadExecution tsbsLoadExecution) {
public static String generateLoadCommand(String binaryPath, DbmsEnum dbms,
TSBSLoadExecution tsbsLoadExecution,
DBEndpoints dbEndpoints) {
checkNotNull(dbms);
checkNotNull(tsbsLoadExecution);
String generateLoadCommand = binaryPath + "tsbs_load_" + dbms.toString();
String generateLoadCommand = binaryPath + "tsbs_load_" + dbms.toString() + " ";
//common parameters
if (tsbsLoadExecution.getDbName() != null){
......@@ -154,7 +157,7 @@ public class TSBSCommandBuilder {
else throw new IllegalArgumentException("Missing or incorrect --db-name parameter!");
if (tsbsLoadExecution.getWorkers() != null){
generateLoadCommand += "--workers=\"" + tsbsLoadExecution.getWorkers()+ "\" ";
generateLoadCommand += "--workers=" + tsbsLoadExecution.getWorkers() + " ";
}
else throw new IllegalArgumentException("Missing or incorrect --workers parameter!");
......@@ -164,13 +167,13 @@ public class TSBSCommandBuilder {
else throw new IllegalArgumentException("Missing or incorrect --reporting-period parameter!");
if (tsbsLoadExecution.getBatchSize() != null){
generateLoadCommand += "--batch-size=\"" + tsbsLoadExecution.getBatchSize()+ "\" ";
generateLoadCommand += "--batch-size=" + tsbsLoadExecution.getBatchSize()+ " ";
}
else throw new IllegalArgumentException("Missing or incorrect --batch-size parameter!");
//DBMS specific parameters
if(dbms.equals(DbmsEnum.INFLUX)){
generateLoadCommand += influxCommand(tsbsLoadExecution.getDbmsPorperties());
generateLoadCommand += influxCommand(tsbsLoadExecution.getDbmsPorperties(), dbEndpoints);
}else {
throw new IllegalArgumentException("Currently only influx is supported!");
}
......@@ -182,7 +185,7 @@ public class TSBSCommandBuilder {
public static String executeQueriesCommand(String binaryPath, String queryFolder, DbmsEnum dbms, TSBSQueryExecution tsbsQueryExecution) {
public static String executeQueriesCommand(String binaryPath, String queryFolder, DbmsEnum dbms, TSBSQueryExecution tsbsQueryExecution, DBEndpoints dbEndpoints) {
String queriesCommand = "cat " + queryFolder + dbms.toString() + "-queries.gz " + " | gunzip | " + binaryPath + "tsbs_run_queries_" + dbms.toString() + " ";
......@@ -209,7 +212,7 @@ public class TSBSCommandBuilder {
//DBMS specific parameters
if(dbms.equals(DbmsEnum.INFLUX)){
queriesCommand += influxCommand(tsbsQueryExecution.getDbmsPorperties());
queriesCommand += influxCommand(tsbsQueryExecution.getDbmsPorperties(), dbEndpoints);
}else {
throw new IllegalArgumentException("Currently only influx is supported!");
}
......@@ -222,27 +225,21 @@ public class TSBSCommandBuilder {
private static String influxCommand(
List<TSDBMSDBMSProperties> dbmsPorperties){
List<TSDBMSDBMSProperties> dbmsProperties,
DBEndpoints dbEndpoints){
String influxCommand = " ";
//urls
boolean urlsCheck = dbmsPorperties.stream().anyMatch(o -> o.getName().equals("urls"));
if(urlsCheck){
Optional<TSDBMSDBMSProperties> item = dbmsPorperties.stream()
.filter(c -> c.getName().equals("urls")).findAny();
//TODO: add support for multiple Influx endpoints
LOGGER.warn("Multiple Influx endpoints are currently not supported!");
String influxEndpoints = "http://" + dbEndpoints.get(0).getIpAddress() + ":8086 ";
influxCommand += "--urls " + influxEndpoints;
influxCommand += "--urls " + item.get().getValue();
}else{
influxCommand += "--urls " + DEFAULT_INFLUX_URLS;
}
//backoff
boolean backoffCheck = dbmsPorperties.stream().anyMatch(o -> o.getName().equals("backoff"));
boolean backoffCheck = dbmsProperties.stream().anyMatch(o -> o.getName().equals("backoff"));
if(backoffCheck){
Optional<TSDBMSDBMSProperties> item = dbmsPorperties.stream()
Optional<TSDBMSDBMSProperties> item = dbmsProperties.stream()
.filter(c -> c.getName().equals("backoff")).findAny();
influxCommand += "--backoff " + item.get().getValue();
......@@ -253,9 +250,9 @@ public class TSBSCommandBuilder {
}
//consistency
boolean consistencyCheck = dbmsPorperties.stream().anyMatch(o -> o.getName().equals("consistency"));
boolean consistencyCheck = dbmsProperties.stream().anyMatch(o -> o.getName().equals("consistency"));
if(consistencyCheck){
Optional<TSDBMSDBMSProperties> item = dbmsPorperties.stream()
Optional<TSDBMSDBMSProperties> item = dbmsProperties.stream()
.filter(c -> c.getName().equals("consistency")).findAny();
influxCommand += "--consistency " + item.get().getValue();
......@@ -266,9 +263,9 @@ public class TSBSCommandBuilder {
}
//replication
boolean replicationCheck = dbmsPorperties.stream().anyMatch(o -> o.getName().equals("replication-factor"));
boolean replicationCheck = dbmsProperties.stream().anyMatch(o -> o.getName().equals("replication-factor"));
if(replicationCheck){
Optional<TSDBMSDBMSProperties> item = dbmsPorperties.stream()
Optional<TSDBMSDBMSProperties> item = dbmsProperties.stream()
.filter(c -> c.getName().equals("replication-factor")).findAny();
influxCommand += "--replication-factor " + item.get().getValue();
......@@ -281,4 +278,17 @@ public class TSBSCommandBuilder {
return influxCommand;
}
public static String clearDB(DbmsEnum dbms, String databaseName, DBEndpoints dbEndpoints){
String clearCommand = "";
if(dbms.equals(DbmsEnum.INFLUX)){
clearCommand = "curl -X POST http://" + dbEndpoints.get(0) + ":8086/query?q=drop%20database%20" + databaseName;
return clearCommand;
}
return clearCommand;
}
}
\ No newline at end of file
......@@ -650,10 +650,10 @@ definitions:
properties:
name:
type: string
example: '-urls'
example: 'consistency'
value:
type: string
example: 'http://localhost:8086'
example: 'all'
#################### API entities ##########################
......
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