Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ public int run() throws SQLException {
};

try {
if ( args.get( 0 ).equalsIgnoreCase( "data" ) ) {
if ( args.getFirst().equalsIgnoreCase( "data" ) ) {
data( executorFactory, multiplier );
} else if ( args.get( 0 ).equalsIgnoreCase( "workload" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "workload" ) ) {
workload( executorFactory, multiplier );
} else if ( args.get( 0 ).equalsIgnoreCase( "schema" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "schema" ) ) {
schema( executorFactory );
} else {
System.err.println( "Unknown task: " + args.get( 0 ) );
System.err.println( "Unknown task: " + args.getFirst() );
}
} catch ( Throwable t ) {
log.error( "Exception while executing OltpBench!", t );
Expand Down
31 changes: 10 additions & 21 deletions src/main/java/org/polypheny/simpleclient/cli/ComsCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public int run() throws SQLException {
ExecutorFactory executorFactory;

try {
switch ( args.get( 0 ).toLowerCase() ) {
switch ( args.getFirst().toLowerCase() ) {
case "schema":
executorFactory = getExecutorFactory( true );
ComsScenario.schema( executorFactory, config );
Expand All @@ -113,7 +113,7 @@ public int run() throws SQLException {
ComsScenario.workload( executorFactory, config, multiplier, writeCsv );
break;
default:
System.err.println( "Unknown task: " + args.get( 0 ) );
System.err.println( "Unknown task: " + args.getFirst() );
}

} catch ( Throwable t ) {
Expand All @@ -132,25 +132,14 @@ public int run() throws SQLException {


private ExecutorFactory getExecutorFactory( boolean createDocker ) {
ExecutorFactory executorFactory;
switch ( config.mode ) {

case POLYPHENY:
executorFactory = new PolyphenyDbMultiExecutorFactory( polyphenyDbHost );
break;
case NATIVE:
executorFactory = new MultiExecutorFactory(
new PostgresExecutor.PostgresExecutorFactory( postgres, false ),
new NeoExecutorFactory( neo4j ),
new MongoQlExecutorFactory( mongoDB ) );
break;
case SURREALDB:
executorFactory = new SurrealDBExecutorFactory( surrealHost, "8989", createDocker );
break;
default:
throw new IllegalArgumentException();
}
return executorFactory;
return switch ( config.mode ) {
case POLYPHENY -> new PolyphenyDbMultiExecutorFactory( polyphenyDbHost );
case NATIVE -> new MultiExecutorFactory(
new PostgresExecutor.PostgresExecutorFactory( postgres, false ),
new NeoExecutorFactory( neo4j ),
new MongoQlExecutorFactory( mongoDB ) );
case SURREALDB -> new SurrealDBExecutorFactory( surrealHost, "8989", createDocker );
};
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ public int run() throws SQLException {
ExecutorFactory executorFactory = new PolyphenyDbMongoQlExecutorFactory( polyphenyDbHost );

try {
if ( args.get( 0 ).equalsIgnoreCase( "data" ) ) {
if ( args.getFirst().equalsIgnoreCase( "data" ) ) {
DocBenchScenario.data( executorFactory, multiplier, true );
} else if ( args.get( 0 ).equalsIgnoreCase( "workload" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "workload" ) ) {
DocBenchScenario.workload( executorFactory, multiplier, true, writeCsv, dumpQueryList );
} else if ( args.get( 0 ).equalsIgnoreCase( "schema" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "schema" ) ) {
DocBenchScenario.schema( executorFactory, true );
} else if ( args.get( 0 ).equalsIgnoreCase( "warmup" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "warmup" ) ) {
DocBenchScenario.warmup( executorFactory, multiplier, true, dumpQueryList );
} else {
System.err.println( "Unknown task: " + args.get( 0 ) );
System.err.println( "Unknown task: " + args.getFirst() );
}
} catch ( Throwable t ) {
log.error( "Exception while executing DocBench!", t );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public int run() {
System.err.println( "Missing entity name" );
System.exit( 1 );
}
String table = args.get( 0 );
String table = args.getFirst();

Connection conn = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ public int run() {
}

try {
if ( args.get( 0 ).equalsIgnoreCase( "data" ) ) {
if ( args.getFirst().equalsIgnoreCase( "data" ) ) {
GavelScenario.data( executorFactory, multiplier, true, queryMode );
} else if ( args.get( 0 ).equalsIgnoreCase( "workload" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "workload" ) ) {
GavelScenario.workload( executorFactory, multiplier, true, writeCsv, dumpQueryList, queryMode );
} else if ( args.get( 0 ).equalsIgnoreCase( "schema" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "schema" ) ) {
GavelScenario.schema( executorFactory, true, queryMode );
} else if ( args.get( 0 ).equalsIgnoreCase( "warmup" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "warmup" ) ) {
GavelScenario.warmup( executorFactory, multiplier, true, dumpQueryList, queryMode );
} else {
System.err.println( "Unknown task: " + args.get( 0 ) );
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/polypheny/simpleclient/cli/GraphCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ public int run() throws SQLException {
ExecutorFactory executorFactory = new PolyphenyDbCypherExecutorFactory( polyphenyDbHost );

try {
if ( args.get( 0 ).equalsIgnoreCase( "data" ) ) {
if ( args.getFirst().equalsIgnoreCase( "data" ) ) {
GraphBenchScenario.data( executorFactory, multiplier, true );
} else if ( args.get( 0 ).equalsIgnoreCase( "workload" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "workload" ) ) {
GraphBenchScenario.workload( executorFactory, multiplier, true, writeCsv, dumpQueryList );
} else if ( args.get( 0 ).equalsIgnoreCase( "schema" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "schema" ) ) {
GraphBenchScenario.schema( executorFactory, true );
} else if ( args.get( 0 ).equalsIgnoreCase( "warmup" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "warmup" ) ) {
GraphBenchScenario.warmup( executorFactory, multiplier, true, dumpQueryList );
} else {
System.err.println( "Unknown task: " + args.get( 0 ) );
System.err.println( "Unknown task: " + args.getFirst() );
}
} catch ( Throwable t ) {
log.error( "Exception while executing GraphBench!", t );
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/polypheny/simpleclient/cli/KnnCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ public int run() throws SQLException {
executorFactory = new PolyphenyDbJdbcExecutorFactory( polyphenyDbHost, false );

try {
if ( args.get( 0 ).equalsIgnoreCase( "data" ) ) {
if ( args.getFirst().equalsIgnoreCase( "data" ) ) {
KnnBenchScenario.data( executorFactory, multiplier, true );
} else if ( args.get( 0 ).equalsIgnoreCase( "workload" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "workload" ) ) {
KnnBenchScenario.workload( executorFactory, multiplier, true, writeCsv, dumpQueryList );
} else if ( args.get( 0 ).equalsIgnoreCase( "schema" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "schema" ) ) {
KnnBenchScenario.schema( executorFactory, true );
} else if ( args.get( 0 ).equalsIgnoreCase( "warmup" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "warmup" ) ) {
KnnBenchScenario.warmup( executorFactory, multiplier, true, dumpQueryList );
} else {
System.err.println( "Unknown task: " + args.get( 0 ) );
System.err.println( "Unknown task: " + args.getFirst() );
}
} catch ( Throwable t ) {
log.error( "Exception while executing KnnBench!", t );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class MultiBenchCommand implements CliRunnable {

@Override
public int run() throws SQLException {
if ( args == null || args.size() < 1 ) {
if ( args == null || args.isEmpty() ) {
System.err.println( "Missing task" );
System.exit( 1 );
}
Expand All @@ -79,16 +79,16 @@ public int run() throws SQLException {
ExecutorFactory executorFactory = new PolyphenyDbMultiExecutorFactory( polyphenyDbHost );

try {
if ( args.get( 0 ).equalsIgnoreCase( "data" ) ) {
if ( args.getFirst().equalsIgnoreCase( "data" ) ) {
MultiBenchScenario.data( executorFactory, multiplier, true );
} else if ( args.get( 0 ).equalsIgnoreCase( "workload" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "workload" ) ) {
MultiBenchScenario.workload( executorFactory, multiplier, true, writeCsv, dumpQueryList );
} else if ( args.get( 0 ).equalsIgnoreCase( "schema" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "schema" ) ) {
MultiBenchScenario.schema( executorFactory, true );
} else if ( args.get( 0 ).equalsIgnoreCase( "warmup" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "warmup" ) ) {
MultiBenchScenario.warmup( executorFactory, multiplier, true, dumpQueryList );
} else {
System.err.println( "Unknown task: " + args.get( 0 ) );
System.err.println( "Unknown task: " + args.getFirst() );
}
} catch ( Throwable t ) {
log.error( "Exception while executing MultiBench!", t );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class MultimediaCommand implements CliRunnable {

@Override
public int run() {
if ( args == null || args.size() < 1 ) {
if ( args == null || args.isEmpty() ) {
System.err.println( "Missing task" );
System.exit( 1 );
}
Expand All @@ -84,16 +84,16 @@ public int run() {
}

try {
if ( args.get( 0 ).equalsIgnoreCase( "data" ) ) {
if ( args.getFirst().equalsIgnoreCase( "data" ) ) {
MultimediaScenario.data( executorFactory, multiplier, true );
} else if ( args.get( 0 ).equalsIgnoreCase( "workload" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "workload" ) ) {
MultimediaScenario.workload( executorFactory, multiplier, true, writeCsv, dumpQueryList );
} else if ( args.get( 0 ).equalsIgnoreCase( "schema" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "schema" ) ) {
MultimediaScenario.schema( executorFactory, true );
} else if ( args.get( 0 ).equalsIgnoreCase( "warmup" ) ) {
} else if ( args.getFirst().equalsIgnoreCase( "warmup" ) ) {
MultimediaScenario.warmup( executorFactory, multiplier, true, dumpQueryList );
} else {
System.err.println( "Unknown task: " + args.get( 0 ) );
System.err.println( "Unknown task: " + args.getFirst() );
}
} catch ( Throwable t ) {
log.error( "Exception while executing MultimediaBench!", t );
Expand Down
Loading