From d535279055ea156c461b8bfec5758b44011100ba Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Tue, 5 May 2020 01:53:29 -0500 Subject: [PATCH] make includes globally active --- .../activitytype/stdout/StdoutActivityType.java | 3 ++- .../src/main/java/io/nosqlbench/engine/cli/NBCLI.java | 2 ++ .../src/main/java/io/nosqlbench/nb/api/content/NBIO.java | 8 +++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/activitytype-stdout/src/main/java/io/nosqlbench/activitytype/stdout/StdoutActivityType.java b/activitytype-stdout/src/main/java/io/nosqlbench/activitytype/stdout/StdoutActivityType.java index 0a1ffeecb..6de74b7cd 100644 --- a/activitytype-stdout/src/main/java/io/nosqlbench/activitytype/stdout/StdoutActivityType.java +++ b/activitytype-stdout/src/main/java/io/nosqlbench/activitytype/stdout/StdoutActivityType.java @@ -23,7 +23,8 @@ public class StdoutActivityType implements ActivityType { // sanity check that we have a yaml parameter, which contains our statements and bindings if (!yaml.isPresent()) { - throw new RuntimeException("Currently, the stdout activity type requires yaml activity parameter."); + throw new RuntimeException("Currently, the stdout activity type requires yaml/workload activity parameter" + + "."); } // allow shortcut: yaml parameter provide the default alias name diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLI.java b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLI.java index 776860dd2..53868428f 100644 --- a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLI.java +++ b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLI.java @@ -77,6 +77,8 @@ public class NBCLI { } NBCLIOptions options = new NBCLIOptions(args); + NBIO.addGlobalIncludes(options.wantsIncludes()); + ConsoleLogging.enableConsoleLogging(options.wantsConsoleLogLevel(), options.getConsoleLoggingPattern()); if (options.wantsBasicHelp()) { diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/content/NBIO.java b/nb-api/src/main/java/io/nosqlbench/nb/api/content/NBIO.java index 68d0da29a..235be2e9c 100644 --- a/nb-api/src/main/java/io/nosqlbench/nb/api/content/NBIO.java +++ b/nb-api/src/main/java/io/nosqlbench/nb/api/content/NBIO.java @@ -26,11 +26,17 @@ import java.util.stream.Collectors; */ public class NBIO implements NBPathsAPI.Facets { + private static String[] globalIncludes = new String[0]; + + public synchronized static void addGlobalIncludes(String[] globalIncludes) { + NBIO.globalIncludes = globalIncludes; + } + private URIResolver resolver; private List names = new ArrayList<>(); private List extensions = new ArrayList<>(); - private List prefixes = new ArrayList<>(); + private List prefixes = Arrays.asList(globalIncludes); private NBIO() { }