Skip to content

Commit

Permalink
Make use of Icarus training setting
Browse files Browse the repository at this point in the history
  • Loading branch information
vogti committed Jul 3, 2020
1 parent 0370282 commit 54e2c56
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions src/main/java/org/polypheny/simpleclient/main/ChronosAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ protected Object prepare( ChronosJob chronosJob, final File inputDirectory, fina
}
}

// disable icarus training
setIcarusRouting( false );

// Create schema
scenario.createSchema( true );
} else if ( config.system.equals( "postgres" ) ) {
Expand All @@ -282,9 +285,17 @@ protected Object warmUp( ChronosJob chronosJob, final File inputDirectory, final
Config config = parseConfig( chronosJob );
Scenario scenario = (Scenario) o;

if ( config.system.equals( "polypheny" ) ) {
setIcarusRouting( true );
}

ProgressReporter progressReporter = new ChronosProgressReporter( chronosJob, this, config.numberOfThreads, config.progressReportBase );
scenario.warmUp( progressReporter );

if ( config.system.equals( "polypheny" ) ) {
setIcarusRouting( false );
}

return scenario;
}

Expand Down Expand Up @@ -348,6 +359,24 @@ protected void removeChronosLogHandler( ChronosLogHandler chronosLogHandler ) {
}


void setIcarusRouting( boolean b ) {
PolyphenyDbExecutor executor = (PolyphenyDbExecutor) new PolyphenyDbJdbcExecutorFactory( ChronosCommand.hostname ).createInstance();
try {
// disable icarus training
executor.setConfig( "icarusRouting/training", b ? "true" : "false" );
executor.executeCommit();
} catch ( ExecutorException e ) {
throw new RuntimeException( "Exception while updating polypheny config", e );
} finally {
try {
executor.closeConnection();
} catch ( ExecutorException e ) {
log.error( "Exception while closing connection", e );
}
}
}


void updateProgress( ChronosJob job, int progress ) {
setProgress( job, (byte) progress );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void warmUp( ProgressReporter progressReporter ) {

log.info( "Warm-up..." );
Executor executor = null;
for ( int i = 0; i < 2; i++ ) {
for ( int i = 0; i < 4; i++ ) {
try {
executor = executorFactory.createInstance();
if ( config.numberOfAddUserQueries > 0 ) {
Expand Down

0 comments on commit 54e2c56

Please sign in to comment.