From 54e2c5608639989cdb4c2a159b791aa9a91599bf Mon Sep 17 00:00:00 2001 From: Marco Vogt Date: Fri, 3 Jul 2020 11:52:54 +0200 Subject: [PATCH] Make use of Icarus training setting --- .../simpleclient/main/ChronosAgent.java | 29 +++++++++++++++++++ .../simpleclient/scenario/gavel/Gavel.java | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/polypheny/simpleclient/main/ChronosAgent.java b/src/main/java/org/polypheny/simpleclient/main/ChronosAgent.java index 40960d2d..6bfeabd9 100644 --- a/src/main/java/org/polypheny/simpleclient/main/ChronosAgent.java +++ b/src/main/java/org/polypheny/simpleclient/main/ChronosAgent.java @@ -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" ) ) { @@ -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; } @@ -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 ); } diff --git a/src/main/java/org/polypheny/simpleclient/scenario/gavel/Gavel.java b/src/main/java/org/polypheny/simpleclient/scenario/gavel/Gavel.java index 48e84a98..0ca2ae05 100644 --- a/src/main/java/org/polypheny/simpleclient/scenario/gavel/Gavel.java +++ b/src/main/java/org/polypheny/simpleclient/scenario/gavel/Gavel.java @@ -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 ) {