@@ -77,6 +77,11 @@ public class ConsoleAndFileDriverConfiguration implements DriverConfiguration
77
77
public static final String HELP_DEFAULT_STRING = Boolean .toString ( HELP_DEFAULT );
78
78
private static final String HELP_DESCRIPTION = "print usage instruction" ;
79
79
80
+ public static final String FLUSH_LOG_ARG = "flush_log" ;
81
+ public static final boolean FLUSH_LOG_DEFAULT = false ;
82
+ public static final String FLUSH_LOG_DEFAULT_STRING = Boolean .toString (FLUSH_LOG_DEFAULT );
83
+ private static final String FLUSH_LOG_DESCRIPTION = "flush log to disk after each operation" ;
84
+
80
85
public static final String NAME_ARG = "nm" ;
81
86
private static final String NAME_ARG_LONG = "name" ;
82
87
public static final String NAME_DEFAULT = "LDBC" ;
@@ -185,6 +190,7 @@ public static Map<String,String> defaultsAsMap() throws DriverConfigurationExcep
185
190
Map <String ,String > defaultParamsMap = new HashMap <>();
186
191
defaultParamsMap .put ( IGNORE_SCHEDULED_START_TIMES_ARG , IGNORE_SCHEDULED_START_TIMES_DEFAULT_STRING );
187
192
defaultParamsMap .put ( HELP_ARG , HELP_DEFAULT_STRING );
193
+ defaultParamsMap .put ( FLUSH_LOG_ARG , FLUSH_LOG_DEFAULT_STRING );
188
194
defaultParamsMap .put ( OPERATION_COUNT_ARG , OPERATION_COUNT_DEFAULT_STRING );
189
195
defaultParamsMap .put ( WORKLOAD_ARG , WORKLOAD_DEFAULT_STRING );
190
196
defaultParamsMap .put ( NAME_ARG , NAME_DEFAULT_STRING );
@@ -280,6 +286,7 @@ public static ConsoleAndFileDriverConfiguration fromParamsMap( Map<String,String
280
286
boolean printHelp = Boolean .parseBoolean ( paramsMap .get ( HELP_ARG ) );
281
287
boolean ignoreScheduledStartTimes =
282
288
Boolean .parseBoolean ( paramsMap .get ( IGNORE_SCHEDULED_START_TIMES_ARG ) );
289
+ boolean flushLog = Boolean .parseBoolean ( paramsMap .get ( FLUSH_LOG_ARG ) );
283
290
return new ConsoleAndFileDriverConfiguration (
284
291
paramsMap ,
285
292
name ,
@@ -298,7 +305,8 @@ public static ConsoleAndFileDriverConfiguration fromParamsMap( Map<String,String
298
305
printHelp ,
299
306
ignoreScheduledStartTimes ,
300
307
warmupCount ,
301
- skipCount
308
+ skipCount ,
309
+ flushLog
302
310
);
303
311
}
304
312
catch ( DriverConfigurationException e )
@@ -605,6 +613,10 @@ private static Options buildOptions()
605
613
Option printHelpOption = OptionBuilder .withDescription ( HELP_DESCRIPTION ).create ( HELP_ARG );
606
614
options .addOption ( printHelpOption );
607
615
616
+
617
+ Option flushOption = OptionBuilder .withDescription (FLUSH_LOG_DESCRIPTION ).create (FLUSH_LOG_ARG );
618
+ options .addOption ( flushOption );
619
+
608
620
Option ignoreScheduledStartTimesOption =
609
621
OptionBuilder .withDescription ( IGNORE_SCHEDULED_START_TIMES_DESCRIPTION )
610
622
.create ( IGNORE_SCHEDULED_START_TIMES_ARG );
@@ -684,6 +696,7 @@ public static String commandlineHelpString()
684
696
private final boolean ignoreScheduledStartTimes ;
685
697
private final long warmupCount ;
686
698
private final long skipCount ;
699
+ private final boolean flushLog ;
687
700
688
701
public ConsoleAndFileDriverConfiguration ( Map <String ,String > paramsMap ,
689
702
String name ,
@@ -702,7 +715,8 @@ public ConsoleAndFileDriverConfiguration( Map<String,String> paramsMap,
702
715
boolean printHelp ,
703
716
boolean ignoreScheduledStartTimes ,
704
717
long warmupCount ,
705
- long skipCount )
718
+ long skipCount ,
719
+ boolean flushLog )
706
720
{
707
721
if ( null == paramsMap )
708
722
{
@@ -726,6 +740,7 @@ public ConsoleAndFileDriverConfiguration( Map<String,String> paramsMap,
726
740
this .ignoreScheduledStartTimes = ignoreScheduledStartTimes ;
727
741
this .warmupCount = warmupCount ;
728
742
this .skipCount = skipCount ;
743
+ this .flushLog = flushLog ;
729
744
730
745
if ( null != name )
731
746
{
@@ -762,6 +777,7 @@ public ConsoleAndFileDriverConfiguration( Map<String,String> paramsMap,
762
777
paramsMap .put ( IGNORE_SCHEDULED_START_TIMES_ARG , Boolean .toString ( ignoreScheduledStartTimes ) );
763
778
paramsMap .put ( WARMUP_COUNT_ARG , Long .toString ( warmupCount ) );
764
779
paramsMap .put ( SKIP_COUNT_ARG , Long .toString ( skipCount ) );
780
+ paramsMap .put ( FLUSH_LOG_ARG , Boolean .toString ( flushLog ) );
765
781
}
766
782
767
783
@ Override
@@ -879,6 +895,9 @@ public long skipCount()
879
895
return skipCount ;
880
896
}
881
897
898
+ @ Override
899
+ public boolean flushLog () { return flushLog ; }
900
+
882
901
@ Override
883
902
public Map <String ,String > asMap ()
884
903
{
@@ -995,6 +1014,9 @@ public DriverConfiguration applyArgs( Map<String,String> newParamsMap ) throws D
995
1014
long newSkipCount = (newParamsMapWithShortKeys .containsKey ( SKIP_COUNT_ARG )) ?
996
1015
Long .parseLong ( newParamsMapWithShortKeys .get ( SKIP_COUNT_ARG ) ) :
997
1016
skipCount ;
1017
+ boolean newFlushLog = (newParamsMapWithShortKeys .containsKey ( FLUSH_LOG_ARG )) ?
1018
+ Boolean .parseBoolean ( newParamsMapWithShortKeys .get ( FLUSH_LOG_ARG ) ) :
1019
+ flushLog ;
998
1020
999
1021
return new ConsoleAndFileDriverConfiguration (
1000
1022
newOtherParams ,
@@ -1014,7 +1036,8 @@ public DriverConfiguration applyArgs( Map<String,String> newParamsMap ) throws D
1014
1036
newPrintHelp ,
1015
1037
newIgnoreScheduledStartTimes ,
1016
1038
newWarmupCount ,
1017
- newSkipCount
1039
+ newSkipCount ,
1040
+ newFlushLog
1018
1041
);
1019
1042
}
1020
1043
0 commit comments