Commit c74543d3 authored by Daniel Seybold's avatar Daniel Seybold

updated jave version for pom, fixed databaseConfigProperties setting for cockroachdb

parent 8a7dd45c
Pipeline #51663 passed with stage
in 15 minutes and 41 seconds
...@@ -91,6 +91,14 @@ ...@@ -91,6 +91,14 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
......
...@@ -70,42 +70,10 @@ public class YCSBCommandBuilder { ...@@ -70,42 +70,10 @@ public class YCSBCommandBuilder {
//TODO: refactor in separate method //TODO: refactor in separate method
//Building JDBC connection strings
//jdbc:postgresql://192.168.100.23,192.168.100.24:26257/ycsb?sslmode=disable
if(databaseConfig.getDatabaseBinding().equals(DatabaseBindingEnum.COCKROACHDB)){ if(databaseConfig.getDatabaseBinding().equals(DatabaseBindingEnum.COCKROACHDB)){
//deafult YCSB version
//databaseCommand += " -p " + databaseConfig.getEndpointParameterName() + "=";
//StringJoiner jdbcEndpoints = new StringJoiner(",");
//for(String endpoint : dbEndpoints){
//jdbcEndpoints.add("jdbc:postgresql://" + endpoint+":26257/"+databaseConfig.getTableName()+"?sslmode=disable");
//}
//databaseCommand += jdbcEndpoints.toString();
StringJoiner cockroachDBConnection = new StringJoiner(";");
//create n host permutations to load balance load equally, postgres jdbc driver only issues load against the first host and uses the remaining as fail over
for(int i = 0; i < dbEndpoints.size(); i++){
dbEndpoints.add(dbEndpoints.get(0));
dbEndpoints.remove(0);
//patched YCSB 0.12.0 JDBC binding via PostgresSQL driver
StringJoiner cockroachEndpoint = new StringJoiner(",");
for(DBEndpoint endpoint : dbEndpoints){
cockroachEndpoint.add(endpoint.getIpAddress()+":26257");
}
cockroachDBConnection.add( "jdbc:postgresql://" + cockroachEndpoint.toString()+"/"+databaseConfig.getTableName()+"?sslmode=disable&loadBalanceHosts=true");
}
databaseCommand += " -p " + databaseConfig.getEndpointParameterName() + "=\"" + cockroachDBConnection.toString() + "\"";
LOGGER.debug("database command for CockroachDB: " + databaseCommand);
databaseCommand += buildCockroachDBCommand(databaseConfig,dbEndpoints);
}else if (databaseConfig.getDatabaseBinding().equals(DatabaseBindingEnum.MONGODB)){ }else if (databaseConfig.getDatabaseBinding().equals(DatabaseBindingEnum.MONGODB)){
...@@ -163,6 +131,44 @@ public class YCSBCommandBuilder { ...@@ -163,6 +131,44 @@ public class YCSBCommandBuilder {
return databaseCommand; return databaseCommand;
} }
private static String buildCockroachDBCommand(DatabaseConfig databaseConfig,
DBEndpoints dbEndpoints){
String databaseCommand = "";
StringJoiner cockroachDBConnection = new StringJoiner(";");
//create n host permutations to load balance load equally, postgres jdbc driver only issues load against the first host and uses the remaining as fail over
for(int i = 0; i < dbEndpoints.size(); i++){
dbEndpoints.add(dbEndpoints.get(0));
dbEndpoints.remove(0);
//patched YCSB 0.12.0 JDBC binding via PostgresSQL driver
StringJoiner cockroachEndpoint = new StringJoiner(",");
for(DBEndpoint endpoint : dbEndpoints){
cockroachEndpoint.add(endpoint.getIpAddress()+":26257");
}
cockroachDBConnection.add( "jdbc:postgresql://" + cockroachEndpoint.toString()+"/"+databaseConfig.getTableName()+"?sslmode=disable&loadBalanceHosts=true");
}
databaseCommand += " -p " + databaseConfig.getEndpointParameterName() + "=\"" + cockroachDBConnection.toString() + "\"";
//add additional parameters
for(DatabaseConfigProperty databaseConfigProperty : databaseConfig.getConfigPorperties()){
databaseCommand += " -p " + databaseConfigProperty.getName() + "=" + databaseConfigProperty.getValue();
}
LOGGER.debug("database command for CockroachDB: " + databaseCommand);
return databaseCommand;
}
private static String buildMongoDBCommand(DatabaseConfig databaseConfig, private static String buildMongoDBCommand(DatabaseConfig databaseConfig,
DBEndpoints dbEndpoints){ DBEndpoints dbEndpoints){
......
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