+ *
+ * ArgsFile is a command-line modifier which can take linked list of
+ * command args and modify it, and/or modify argsfile refrenced in this way.
+ *
+ *
ArgsFile Selection
+ *
+ * During processing, any occurence of '-argsfile' selects the active argsfile and loads
+ * it into the command line in place of the '-argsfile' argument. By default the args file
+ * will be loaded if it exists, and a warning will be given if it does not.
+ *
+ * The '-argsfile-required <somepath>' version will throw an error if the args file
+ * is not present, but it will not report any warnings or details otherwise.
+ *
+ * The `-argsfile-optional <somepath> version will not throw an error if the args
+ * file is not present, and it will not report any warnings or details otherwise.
+ *
+ * A prefix command line can be given to ArgsFile to pre-load any settings. In this way
+ * it is possible to easily provide a default args file which will be loaded. For example,
+ * A prefix command of '-argsfile-optional <somepath>' will load options if they are
+ * available in the specified file, but will otherwise provide no feedback to the user.
+ *
+ *
ArgsFile Injection
+ *
+ * When an argsfile is loaded, it reads a command from each line into the current position
+ * of the command line. No parsing is done. Blank lines are ignored. Newlines are used as the
+ * argument delimiter, and lines that end with a backslash before the newline are automatically
+ * joined together.
+ *
+ *
ArgsFile Diagnostics
+ *
+ * All modifications to the command line should be reported to the logging facility at
+ * INFO level. This assumes that the calling layer wants to inform users of command line injections,
+ * and that the user can select to be notified of warnings only if desired.
+ *
+ *
Environment Variables
+ *
+ * Simple environment variable substitution is attempted for any pattern which appears as '$' followed
+ * by all uppercase letters and underscores. Any references of this type which are not resolvable
+ * will cause an error to be thrown.
+ */
public class ArgsFile {
- private final Path argsPath;
+ private final static Logger logger = LoggerFactory.getLogger(ArgsFile.class);
- public ArgsFile(String path) {
- this.argsPath = Path.of(path);
+ private Path argsPath;
+ private LinkedList preload;
+
+ public ArgsFile() {
}
- public LinkedList doArgsFile(String argsfileSpec, LinkedList arglist) {
- return null;
+ public ArgsFile preload(String... preload) {
+ this.preload = new LinkedList(Arrays.asList(preload));
+ return this;
}
- private LinkedList spliceArgs(String argsfileSpec, LinkedList arglist) {
- Pattern envpattern = Pattern.compile("(?\\$[A-Za-z_]+)");
- Matcher matcher = envpattern.matcher(argsfileSpec);
+ private enum Selection {
+ // Ignore if not present, show injections at info
+ IgnoreIfMissing,
+ // Warn if not present, but show injections at info
+ WarnIfMissing,
+ // throw error if not present, show injections at info
+ ErrorIfMissing
+ }
+
+ public LinkedList process(String... args) {
+ return process(new LinkedList(Arrays.asList(args)));
+ }
+
+ public LinkedList process(LinkedList commandline) {
+ if (preload != null) {
+ LinkedList modified = new LinkedList();
+ modified.addAll(preload);
+ modified.addAll(commandline);
+ preload = null;
+ commandline = modified;
+ }
+ LinkedList composed = new LinkedList<>();
+ while (commandline.peekFirst() != null) {
+ String arg = commandline.peekFirst();
+ switch (arg) {
+ case "-argsfile":
+ commandline.removeFirst();
+ String argspath = readWordOrThrow(commandline, "path to an args file");
+ setArgsFile(argspath, Selection.WarnIfMissing);
+ commandline = loadArgs(this.argsPath, Selection.WarnIfMissing, commandline);
+ break;
+ case "-argsfile-required":
+ commandline.removeFirst();
+ String argspathRequired = readWordOrThrow(commandline, "path to an args file");
+ setArgsFile(argspathRequired, Selection.ErrorIfMissing);
+ commandline = loadArgs(this.argsPath, Selection.ErrorIfMissing, commandline);
+ break;
+ case "-argsfile-optional":
+ commandline.removeFirst();
+ String argspathOptional = readWordOrThrow(commandline, "path to an args file");
+ setArgsFile(argspathOptional, Selection.IgnoreIfMissing);
+ commandline = loadArgs(this.argsPath, Selection.IgnoreIfMissing, commandline);
+ break;
+ case "-pin":
+ commandline.removeFirst();
+ commandline = pinArg(commandline);
+ break;
+ case "-unpin":
+ commandline.removeFirst();
+ commandline = unpinArg(commandline);
+ break;
+ default:
+ composed.addLast(commandline.removeFirst());
+ }
+
+ }
+ return composed;
+ }
+
+ private LinkedList loadArgs(Path argspath, Selection mode, LinkedList commandline) {
+ if (!assertArgsFileExists(argspath, mode)) {
+ return commandline;
+ }
+ List lines = null;
+ try {
+ lines = Files.readAllLines(argspath);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ List content = lines.stream()
+ .filter(s -> !s.startsWith("#"))
+ .filter(s -> !s.startsWith("/"))
+ .filter(s -> !s.isBlank())
+ .filter(s -> !s.isEmpty())
+ .collect(Collectors.toList());
+ StringBuilder splitword = new StringBuilder();
+ LinkedList loaded = new LinkedList<>();
+ for (String s : content) {
+ splitword.append(s);
+ if (!s.endsWith("\\")) {
+ loaded.addLast(splitword.toString());
+ splitword.setLength(0);
+ } else {
+ splitword.setLength(splitword.length() - 1);
+ }
+ }
+ if (splitword.length() > 0) {
+ throw new RuntimeException("unqualified line continuation for '" + splitword.toString() + "'");
+ }
+
+ Iterator injections = loaded.descendingIterator();
+ while (injections.hasNext()) {
+ String injection = injections.next();
+ injection = injectEnv(injection);
+ commandline.addFirst(injection);
+ }
+
+ return commandline;
+ }
+
+ private boolean assertArgsFileExists(Path argspath, Selection mode) {
+ if (!Files.exists(argsPath)) {
+ switch (mode) {
+ case ErrorIfMissing:
+ throw new RuntimeException("A required argsfile was specified, but it does not exist: '" + argspath + "'");
+ case WarnIfMissing:
+ logger.warn("An argsfile was specified, but it does not exist: '" + argspath + "'");
+ case IgnoreIfMissing:
+ }
+ return false;
+ }
+ return true;
+ }
+
+ private void setArgsFile(String argspath, Selection mode) {
+ this.argsPath = Path.of(argspath);
+// assertIfMissing(this.argsPath,mode);
+ }
+
+ private String readWordOrThrow(LinkedList commandline, String description) {
+ String found = commandline.peekFirst();
+ if (found == null) {
+ throw new RuntimeException("Unable to read argument top option for " + description);
+ }
+ return commandline.removeFirst();
+ }
+
+ private LinkedList pinArg(LinkedList commandline) {
+ if (this.argsPath == null) {
+ throw new RuntimeException("No argsfile has been selected before using the pin option.");
+ }
+ return commandline;
+ }
+
+ private LinkedList unpinArg(LinkedList commandline) {
+ if (this.argsPath == null) {
+ throw new RuntimeException("No argsfile has been selected before using the unpin option.");
+ }
+ return commandline;
+ }
+
+ private String injectEnv(String word) {
+ Pattern envpattern = Pattern.compile("(?\\$[A-Z_]+)");
+ Matcher matcher = envpattern.matcher(word);
StringBuilder sb = new StringBuilder();
-
while (matcher.find()) {
String envvar = matcher.group("envvar");
String value = System.getenv(envvar);
@@ -33,19 +221,9 @@ public class ArgsFile {
matcher.appendReplacement(sb, value);
}
matcher.appendTail(sb);
- Path argfilePath = Path.of(sb.toString());
- List lines = null;
- try {
- lines = Files.readAllLines(argfilePath);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- // TODO: finish update logic here
- return arglist;
-
+ return sb.toString();
}
-
public LinkedList pin(LinkedList arglist) {
return arglist;
}
diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
index 8c4457431..f0bd65e82 100644
--- a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
+++ b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
@@ -163,7 +163,8 @@ public class NBCLIOptions {
}
private LinkedList parseGlobalOptions(String[] args) {
- ArgsFile argsfile = new ArgsFile(ARGS_FILE_DEFAULT);
+ ArgsFile argsfile = new ArgsFile();
+ argsfile.preload("-argsfile-optional", ARGS_FILE_DEFAULT);
LinkedList arglist = new LinkedList<>() {{
addAll(Arrays.asList(args));
@@ -188,18 +189,9 @@ public class NBCLIOptions {
switch (word) {
case ARGS_FILE:
- arglist.removeFirst();
- String argsfileSpec = readWordOrThrow(arglist, "argsfile");
- argsfile = new ArgsFile(argsfileSpec);
- arglist = argsfile.doArgsFile(argsfileSpec, arglist);
- break;
case ARGS_PIN:
- arglist.removeFirst();
- arglist = argsfile.pin(arglist);
- break;
case ARGS_UNPIN:
- arglist.removeFirst();
- arglist = argsfile.unpin(arglist);
+ arglist = argsfile.process(arglist);
break;
case ANNOTATE_EVENTS:
arglist.removeFirst();
diff --git a/engine-cli/src/test/java/io/nosqlbench/engine/cli/ArgsFileTest.java b/engine-cli/src/test/java/io/nosqlbench/engine/cli/ArgsFileTest.java
new file mode 100644
index 000000000..be6b11c59
--- /dev/null
+++ b/engine-cli/src/test/java/io/nosqlbench/engine/cli/ArgsFileTest.java
@@ -0,0 +1,39 @@
+package io.nosqlbench.engine.cli;
+
+import org.junit.Test;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class ArgsFileTest {
+
+ @Test
+ public void testLoadingArgs() {
+ LinkedList result;
+ ArgsFile argsFile = new ArgsFile();
+ result = argsFile.process("-argsfile", "src/test/resources/argsfiles/nonextant.cli");
+ assertThat(result).containsExactly();
+ result = argsFile.process("-argsfile", "src/test/resources/argsfiles/alphagamma.cli");
+ assertThat(result).containsExactly("alpha", "gamma");
+ }
+
+ @Test(expected = RuntimeException.class)
+ public void testLoadingMissingRequiredFails() {
+ LinkedList result;
+ ArgsFile argsFile = new ArgsFile();
+ result = argsFile.process("-argsfile-required", "src/test/resources/argsfiles/nonextant.cli");
+ }
+
+ @Test
+ public void testLoadingInPlace() {
+ LinkedList result;
+ LinkedList commands = new LinkedList<>(List.of("--abc", "--def", "-argsfile", "src/test/resources/argsfiles/alphagamma.cli"));
+ ArgsFile argsFile = new ArgsFile().preload("-argsfile-optional", "src/test/resources/argsfiles/alphagamma.cli");
+ result = argsFile.process(commands);
+ assertThat(result).containsExactly("alpha", "gamma", "--abc", "--def", "alpha", "gamma");
+
+ }
+
+}
\ No newline at end of file
diff --git a/engine-cli/src/test/resources/argsfiles/alphagamma.cli b/engine-cli/src/test/resources/argsfiles/alphagamma.cli
new file mode 100644
index 000000000..febb53a79
--- /dev/null
+++ b/engine-cli/src/test/resources/argsfiles/alphagamma.cli
@@ -0,0 +1,2 @@
+alpha
+gamma
\ No newline at end of file
From b9607d07e601f9b4b9ff470a80a31a982bc0f44d Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 26 Oct 2020 12:08:05 -0500
Subject: [PATCH 002/164] make argsfiles use double dash
---
devdocs/sketches/argfiles.md | 31 ++++++++++---------
.../io/nosqlbench/engine/cli/ArgsFile.java | 20 ++++++------
.../nosqlbench/engine/cli/NBCLIOptions.java | 8 ++---
.../nosqlbench/engine/cli/ArgsFileTest.java | 13 ++++----
4 files changed, 37 insertions(+), 35 deletions(-)
diff --git a/devdocs/sketches/argfiles.md b/devdocs/sketches/argfiles.md
index 159df6cef..b29b34db5 100644
--- a/devdocs/sketches/argfiles.md
+++ b/devdocs/sketches/argfiles.md
@@ -5,7 +5,7 @@ An argsfile (Command Line Arguments File) is a simple text file which
file to contain a set of global defaults that you want to use by
default and automatically.
-A command, `-argsfile ` is used to specify an args file. You can
+A command, `--argsfile ` is used to specify an args file. You can
use it like an instant import statement in the middle of a command
line. Notice that this option uses only a single dash. This
distinguishes the argsfile options from the others in general. These are meta
@@ -17,8 +17,8 @@ A command, `-argsfile ` is used to specify an args file. You can
The default args file location is `$HOME/.nosqlbench/argsfile`. If this
file is present, it is loaded by nosqlbench when it starts even if you
don't ask it to. That is, nosqlbench behaves as if your first set of
- command line arguments is `-argsfile "$HOME/.nosqlbench/argsfile
- `. However, unlike when you specify `-argsfile ...` explicitly on
+ command line arguments is `--argsfile "$HOME/.nosqlbench/argsfile
+ `. However, unlike when you specify `--argsfile ...` explicitly on
your command line, this form will not throw an error if the file is
missing. This means that when you explicitly ask for an args file
to be loaded, and it does not exist, an error is thrown. If you
@@ -36,51 +36,52 @@ An args file simply contains an argument on each line, like this:
## Pinning options
It is possible to pin an option to the default args file by use of the
- `-pin` meta-option. This option will take the following command line
+ `--pin` meta-option. This option will take the following command line
argument and add it to the currently active args file. That means, if
- you use `-pin --docker-metrics`, then `--docker-metrics` is added to
+ you use `--pin --docker-metrics`, then `--docker-metrics` is added to
the args file. If there is an exact duplicate of the same option
and value, then it is skipped, but if the option name is the same
with a different value, then it is added at the end. This allows
for options which may be called multiple times normally.
-If the `-pin` option occurs after an explicit use of `-argsfile
+If the `--pin` option occurs after an explicit use of `--argsfile
`, then the filename used in this argument is the one that
is modified.
-After the `-pin` option, the following argument is taken as any global
+After the `--pin` option, the following argument is taken as any global
option (--with-double-dashes) and any non-option values after it which
are not commands (reserved words)
-When the `-pin` option is used, it does not cause the pinned option
+When the `--pin` option is used, it does not cause the pinned option
to be excluded from the current command line call. The effects of the
pinned option will take place in the current nosqlbench invocation
- just as they would without the `-pin`. However, when pinning global
+ just as they would without the `--pin`. However, when pinning global
options when there are no commands on the command line, nosqlbench
will not run a scenario, so this form is suitable for setting
arguments.
-As a special case, if the `-pin` is the last option of
+As a special case, if the `--pin` is the last option of
## Unpinning options.
To reverse the effect of pinning an option, you simply use
- `-unpin ...`.
+ `--unpin ...`.
-The behavior of -unpin is slightly different than -pin. Specifically,
+The behavior of --unpin is slightly different than --pin. Specifically,
an option which is unpinned will be removed from the arg list, and will
not be used in the current invocation of nosqlbench after removal.
-Further, you can specify `-unpin --grafana-baseurl` to unpin an option which
+Further, you can specify `--unpin --grafana-baseurl` to unpin an option
+ which
normally has an argument, and all instances of that argument will be
removed. If you want to unpin a specific instance of a multi-valued
option, or one that can be specified more than once with different
parameter values, then you must provide the value as well, as in
- `-unpin --log-histograms 'histodata.log:.*:1m'`
+ `--unpin --log-histograms 'histodata.log:.*:1m'`
# Setting defaults, the simple way
To simply set global defaults, you can run nosqlbench with a command
line like this:
- ./nb -pin --docker-metrics-at metricsnode -pin --annotate all
+ ./nb --pin --docker-metrics-at metricsnode --pin --annotate all
diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/ArgsFile.java b/engine-cli/src/main/java/io/nosqlbench/engine/cli/ArgsFile.java
index d63480cd6..94dcd4258 100644
--- a/engine-cli/src/main/java/io/nosqlbench/engine/cli/ArgsFile.java
+++ b/engine-cli/src/main/java/io/nosqlbench/engine/cli/ArgsFile.java
@@ -19,19 +19,19 @@ import java.util.stream.Collectors;
*
*
ArgsFile Selection
*
- * During processing, any occurence of '-argsfile' selects the active argsfile and loads
- * it into the command line in place of the '-argsfile' argument. By default the args file
+ * During processing, any occurence of '--argsfile' selects the active argsfile and loads
+ * it into the command line in place of the '--argsfile' argument. By default the args file
* will be loaded if it exists, and a warning will be given if it does not.
*
- * The '-argsfile-required <somepath>' version will throw an error if the args file
+ * The '--argsfile-required <somepath>' version will throw an error if the args file
* is not present, but it will not report any warnings or details otherwise.
*
- * The `-argsfile-optional <somepath> version will not throw an error if the args
+ * The `--argsfile-optional <somepath> version will not throw an error if the args
* file is not present, and it will not report any warnings or details otherwise.
*
* A prefix command line can be given to ArgsFile to pre-load any settings. In this way
* it is possible to easily provide a default args file which will be loaded. For example,
- * A prefix command of '-argsfile-optional <somepath>' will load options if they are
+ * A prefix command of '--argsfile-optional <somepath>' will load options if they are
* available in the specified file, but will otherwise provide no feedback to the user.
*
*
ArgsFile Injection
@@ -92,29 +92,29 @@ public class ArgsFile {
while (commandline.peekFirst() != null) {
String arg = commandline.peekFirst();
switch (arg) {
- case "-argsfile":
+ case "--argsfile":
commandline.removeFirst();
String argspath = readWordOrThrow(commandline, "path to an args file");
setArgsFile(argspath, Selection.WarnIfMissing);
commandline = loadArgs(this.argsPath, Selection.WarnIfMissing, commandline);
break;
- case "-argsfile-required":
+ case "--argsfile-required":
commandline.removeFirst();
String argspathRequired = readWordOrThrow(commandline, "path to an args file");
setArgsFile(argspathRequired, Selection.ErrorIfMissing);
commandline = loadArgs(this.argsPath, Selection.ErrorIfMissing, commandline);
break;
- case "-argsfile-optional":
+ case "--argsfile-optional":
commandline.removeFirst();
String argspathOptional = readWordOrThrow(commandline, "path to an args file");
setArgsFile(argspathOptional, Selection.IgnoreIfMissing);
commandline = loadArgs(this.argsPath, Selection.IgnoreIfMissing, commandline);
break;
- case "-pin":
+ case "--pin":
commandline.removeFirst();
commandline = pinArg(commandline);
break;
- case "-unpin":
+ case "--unpin":
commandline.removeFirst();
commandline = unpinArg(commandline);
break;
diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
index f0bd65e82..c92aa52f3 100644
--- a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
+++ b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
@@ -26,10 +26,10 @@ public class NBCLIOptions {
// Options which may contextualize other CLI options or commands.
// These must be parsed first
- private static final String ARGS_FILE = "-argsfile";
+ private static final String ARGS_FILE = "--argsfile";
private static final String ARGS_FILE_DEFAULT = "$HOME/.nosqlbench/argsfile";
- private static final String ARGS_PIN = "-pin";
- private static final String ARGS_UNPIN = "-unpin";
+ private static final String ARGS_PIN = "--pin";
+ private static final String ARGS_UNPIN = "--unpin";
private static final String INCLUDE = "--include";
private static final String METRICS_PREFIX = "--metrics-prefix";
@@ -164,7 +164,7 @@ public class NBCLIOptions {
private LinkedList parseGlobalOptions(String[] args) {
ArgsFile argsfile = new ArgsFile();
- argsfile.preload("-argsfile-optional", ARGS_FILE_DEFAULT);
+ argsfile.preload("--argsfile-optional", ARGS_FILE_DEFAULT);
LinkedList arglist = new LinkedList<>() {{
addAll(Arrays.asList(args));
diff --git a/engine-cli/src/test/java/io/nosqlbench/engine/cli/ArgsFileTest.java b/engine-cli/src/test/java/io/nosqlbench/engine/cli/ArgsFileTest.java
index be6b11c59..91bb05ecc 100644
--- a/engine-cli/src/test/java/io/nosqlbench/engine/cli/ArgsFileTest.java
+++ b/engine-cli/src/test/java/io/nosqlbench/engine/cli/ArgsFileTest.java
@@ -13,9 +13,9 @@ public class ArgsFileTest {
public void testLoadingArgs() {
LinkedList result;
ArgsFile argsFile = new ArgsFile();
- result = argsFile.process("-argsfile", "src/test/resources/argsfiles/nonextant.cli");
+ result = argsFile.process("--argsfile", "src/test/resources/argsfiles/nonextant.cli");
assertThat(result).containsExactly();
- result = argsFile.process("-argsfile", "src/test/resources/argsfiles/alphagamma.cli");
+ result = argsFile.process("--argsfile", "src/test/resources/argsfiles/alphagamma.cli");
assertThat(result).containsExactly("alpha", "gamma");
}
@@ -23,17 +23,18 @@ public class ArgsFileTest {
public void testLoadingMissingRequiredFails() {
LinkedList result;
ArgsFile argsFile = new ArgsFile();
- result = argsFile.process("-argsfile-required", "src/test/resources/argsfiles/nonextant.cli");
+ result = argsFile.process("--argsfile-required", "src/test/resources/argsfiles/nonextant.cli");
}
@Test
public void testLoadingInPlace() {
LinkedList result;
- LinkedList commands = new LinkedList<>(List.of("--abc", "--def", "-argsfile", "src/test/resources/argsfiles/alphagamma.cli"));
- ArgsFile argsFile = new ArgsFile().preload("-argsfile-optional", "src/test/resources/argsfiles/alphagamma.cli");
+ LinkedList commands = new LinkedList<>(List.of("--abc", "--def", "--argsfile", "src/test/resources" +
+ "/argsfiles/alphagamma.cli"));
+ ArgsFile argsFile = new ArgsFile().preload("--argsfile-optional", "src/test/resources/argsfiles/alphagamma" +
+ ".cli");
result = argsFile.process(commands);
assertThat(result).containsExactly("alpha", "gamma", "--abc", "--def", "alpha", "gamma");
-
}
}
\ No newline at end of file
From 2830d070a6f0174ed50d6be1fe7bcbc2de6368f8 Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Thu, 29 Oct 2020 10:55:19 -0500
Subject: [PATCH 003/164] simple workload improvements
---
nb/src/main/resources/examples/sequences.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/nb/src/main/resources/examples/sequences.yaml b/nb/src/main/resources/examples/sequences.yaml
index 9f086b582..e82a099a8 100644
--- a/nb/src/main/resources/examples/sequences.yaml
+++ b/nb/src/main/resources/examples/sequences.yaml
@@ -5,6 +5,9 @@
# eb run driver=stdout workload=examples/sequences cycles=20 seq=bucket
# yields A B C D B C D C D D A B C D B C D C D D
+description: |
+ Demonstration of the different op sequencing strategies
+
scenarios:
concat: run driver===stdout seq===concat cycles=20
bucket: run driver===stdout seq===bucket cycles=20
From 6a8dfef1096821153fb7881a03fb83972096fdbc Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Thu, 29 Oct 2020 10:55:24 -0500
Subject: [PATCH 004/164] qualify grafana docker with tag
---
.../engine/docker/DockerHelper.java | 21 ++++++++++++-------
.../engine/docker/DockerMetricsManager.java | 2 +-
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/engine-docker/src/main/java/io/nosqlbench/engine/docker/DockerHelper.java b/engine-docker/src/main/java/io/nosqlbench/engine/docker/DockerHelper.java
index fcaf1aa07..812b737b4 100644
--- a/engine-docker/src/main/java/io/nosqlbench/engine/docker/DockerHelper.java
+++ b/engine-docker/src/main/java/io/nosqlbench/engine/docker/DockerHelper.java
@@ -28,9 +28,9 @@ public class DockerHelper {
private static final String DOCKER_HOST_ADDR = "unix:///var/run/docker.sock";
// private Client rsClient = ClientBuilder.newClient();
- private DockerClientConfig config;
- private DockerClient dockerClient;
- private Logger logger = LoggerFactory.getLogger(DockerHelper.class);
+ private final DockerClientConfig config;
+ private final DockerClient dockerClient;
+ private final Logger logger = LoggerFactory.getLogger(DockerHelper.class);
public DockerHelper() {
System.getProperties().setProperty(DOCKER_HOST, DOCKER_HOST_ADDR);
@@ -56,7 +56,7 @@ public class DockerHelper {
};
*/
- Container containerId = searchContainer(name, reload);
+ Container containerId = searchContainer(name, reload, tag);
if (containerId != null) {
logger.debug("container is already up with the id: " + containerId.getId());
return null;
@@ -65,15 +65,20 @@ public class DockerHelper {
Info info = dockerClient.infoCmd().exec();
dockerClient.buildImageCmd();
- String term = IMG.split("/")[1];
+// String term = IMG+":"+tag;
+
+// String term = IMG.split("/")[1];
//List dockerSearch = dockerClient.searchImagesCmd(term).exec();
- List dockerList = dockerClient.listImagesCmd().withImageNameFilter(IMG).exec();
+ List dockerList = dockerClient
+ .listImagesCmd()
+ .withImageNameFilter(IMG + ":" + tag)
+ .exec();
if (dockerList.size() == 0) {
dockerClient.pullImageCmd(IMG)
.withTag(tag)
.exec(new PullImageResultCallback()).awaitSuccess();
- dockerList = dockerClient.listImagesCmd().withImageNameFilter(IMG).exec();
+ dockerList = dockerClient.listImagesCmd().withImageNameFilter(IMG + ":" + tag).exec();
if (dockerList.size() == 0) {
logger.error(String.format("Image %s not found, unable to automatically pull image." +
" Check `docker images`",
@@ -178,7 +183,7 @@ public class DockerHelper {
return false;
}
- public Container searchContainer(String name, String reload) {
+ public Container searchContainer(String name, String reload, String tag) {
ListContainersCmd listContainersCmd = dockerClient.listContainersCmd().withStatusFilter(List.of("running"));
listContainersCmd.getFilters().put("name", Arrays.asList(name));
diff --git a/engine-docker/src/main/java/io/nosqlbench/engine/docker/DockerMetricsManager.java b/engine-docker/src/main/java/io/nosqlbench/engine/docker/DockerMetricsManager.java
index c31957153..eac7a6edd 100644
--- a/engine-docker/src/main/java/io/nosqlbench/engine/docker/DockerMetricsManager.java
+++ b/engine-docker/src/main/java/io/nosqlbench/engine/docker/DockerMetricsManager.java
@@ -157,7 +157,7 @@ public class DockerMetricsManager {
logger.info("searching for graphite exporter container ip");
- ContainerNetworkSettings settings = dh.searchContainer(name, null).getNetworkSettings();
+ ContainerNetworkSettings settings = dh.searchContainer(name, null, tag).getNetworkSettings();
Map networks = settings.getNetworks();
String ip = null;
for (String key : networks.keySet()) {
From fd74ccba69dd4c3feedd7d6425905b6face4aa4f Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Thu, 29 Oct 2020 10:55:29 -0500
Subject: [PATCH 005/164] move common topics to resources base
---
devdocs/sketches/argfiles.md | 87 ---------------
engine-cli/src/main/resources/argsfile.md | 101 ++++++++++++++++++
.../src/main/resources/docker-metrics.md | 93 ++++++++++++++++
.../src/main/resources}/threads.md | 0
engine-cli/src/main/resources/topics.md | 3 +
.../docs-for-ebhistoric/nb-cli-docs/docker.md | 60 -----------
6 files changed, 197 insertions(+), 147 deletions(-)
delete mode 100644 devdocs/sketches/argfiles.md
create mode 100644 engine-cli/src/main/resources/argsfile.md
create mode 100644 engine-cli/src/main/resources/docker-metrics.md
rename {engine-docs/src/main/resources/docs-for-ebhistoric/nb-cli-docs => engine-cli/src/main/resources}/threads.md (100%)
delete mode 100644 engine-docs/src/main/resources/docs-for-ebhistoric/nb-cli-docs/docker.md
diff --git a/devdocs/sketches/argfiles.md b/devdocs/sketches/argfiles.md
deleted file mode 100644
index b29b34db5..000000000
--- a/devdocs/sketches/argfiles.md
+++ /dev/null
@@ -1,87 +0,0 @@
-# Args Files
-
-An argsfile (Command Line Arguments File) is a simple text file which
- contains defaults for command-line arguments. You can use an args
- file to contain a set of global defaults that you want to use by
- default and automatically.
-
-A command, `--argsfile ` is used to specify an args file. You can
- use it like an instant import statement in the middle of a command
- line. Notice that this option uses only a single dash. This
- distinguishes the argsfile options from the others in general. These are meta
- options which can modify how options are loaded, so it is important
- that the look distinctive from everything else.
-
-## Default argsfile
-
-The default args file location is `$HOME/.nosqlbench/argsfile`. If this
-file is present, it is loaded by nosqlbench when it starts even if you
- don't ask it to. That is, nosqlbench behaves as if your first set of
- command line arguments is `--argsfile "$HOME/.nosqlbench/argsfile
- `. However, unlike when you specify `--argsfile ...` explicitly on
- your command line, this form will not throw an error if the file is
- missing. This means that when you explicitly ask for an args file
- to be loaded, and it does not exist, an error is thrown. If you
- don't ask for it, but the default one does exist, it is loaded
- automatically before other options are processed.
-
-## Args file format
-
-An args file simply contains an argument on each line, like this:
-
- --docker-metrics
- --annotate all
- --grafana-baseurl http://localhost:3000/
-
-## Pinning options
-
-It is possible to pin an option to the default args file by use of the
- `--pin` meta-option. This option will take the following command line
- argument and add it to the currently active args file. That means, if
- you use `--pin --docker-metrics`, then `--docker-metrics` is added to
- the args file. If there is an exact duplicate of the same option
- and value, then it is skipped, but if the option name is the same
- with a different value, then it is added at the end. This allows
- for options which may be called multiple times normally.
-
-If the `--pin` option occurs after an explicit use of `--argsfile
- `, then the filename used in this argument is the one that
- is modified.
-
-After the `--pin` option, the following argument is taken as any global
- option (--with-double-dashes) and any non-option values after it which
- are not commands (reserved words)
-
-When the `--pin` option is used, it does not cause the pinned option
- to be excluded from the current command line call. The effects of the
- pinned option will take place in the current nosqlbench invocation
- just as they would without the `--pin`. However, when pinning global
- options when there are no commands on the command line, nosqlbench
- will not run a scenario, so this form is suitable for setting
- arguments.
-
-As a special case, if the `--pin` is the last option of
-
-## Unpinning options.
-
-To reverse the effect of pinning an option, you simply use
- `--unpin ...`.
-
-The behavior of --unpin is slightly different than --pin. Specifically,
-an option which is unpinned will be removed from the arg list, and will
- not be used in the current invocation of nosqlbench after removal.
-
-Further, you can specify `--unpin --grafana-baseurl` to unpin an option
- which
- normally has an argument, and all instances of that argument will be
- removed. If you want to unpin a specific instance of a multi-valued
- option, or one that can be specified more than once with different
- parameter values, then you must provide the value as well, as in
- `--unpin --log-histograms 'histodata.log:.*:1m'`
-
-# Setting defaults, the simple way
-
-To simply set global defaults, you can run nosqlbench with a command
- line like this:
-
- ./nb --pin --docker-metrics-at metricsnode --pin --annotate all
diff --git a/engine-cli/src/main/resources/argsfile.md b/engine-cli/src/main/resources/argsfile.md
new file mode 100644
index 000000000..6dba1011c
--- /dev/null
+++ b/engine-cli/src/main/resources/argsfile.md
@@ -0,0 +1,101 @@
+# Args Files
+
+An argsfile (Command Line Arguments File) is a simple text file which
+contains defaults for command-line arguments. You can use an args
+file to contain a set of global defaults that you want to use by
+default and automatically.
+
+A command, `--argsfile ` is used to specify an args file. You can
+use it like an instant import statement in the middle of a command
+line. There are three variants of this option. The `--argsfile `
+variant will warn you if the file doesn't exist. If you want to load
+an argsfile if it exist, but avoid warnings if it doesn't, then use
+the `--argsfile-optional ` form. If you want to throw an error if
+the argsfile doesn't exist, then use the `--argsfile-required `
+form.
+
+## Default argsfile
+
+The default args file location is `$NBSTATEDIR/argsfile`.
+
+After the NBSTATEDIR environment variable or default is resolved,
+the default argsfile will be searched for in that directory.
+
+`$NBSTATEDIR` is a mechanism for setting and finding the local state
+directory for NoSQLBench. It is a search path, delimited by
+colons, and allowing Java system properties and shell environment
+variables. When the NBSTATEDIR location is first needed,
+the paths are checked in order, and the first one found is used.
+If one is not found on the filesystem, the first expanded value
+is used to create the state directory.
+
+
+If the default argsfile is is present, it is loaded by nosqlbench when
+it starts even if you don't ask it to. That is, nosqlbench behaves as
+ if your first set of command line arguments is
+
+ --argsfile-optional "$NBSTATEDIR/argsfile
+
+Just as with the NBSTATEDIR location, the argsfile can also be used
+like a search path. That is, if the value provided is a colon-delimited
+set of possible paths, the first one found (after variable expansion)
+will be used. If needed, the first expanded path will be used to create
+an argsfile when pinning options are used.
+
+## Args file format
+
+An args file simply contains an argument on each line, like this:
+
+ --docker-metrics
+ --annotate all
+ --grafana-baseurl http://localhost:3000/
+
+## Pinning options
+
+It is possible to pin an option to the default args file by use of the
+`--pin` meta-option. This option will take the following command line
+argument and add it to the currently active args file. That means, if
+you use `--pin --docker-metrics`, then `--docker-metrics` is added to
+the args file. If there is an exact duplicate of the same option
+and value, then it is skipped, but if the option name is the same
+with a different value, then it is added at the end. This allows
+for options which may be called multiple times normally.
+
+If the `--pin` option occurs after an explicit use of `--argsfile
+`, then the filename used in this argument is the one that
+is modified.
+
+After the `--pin` option, the following argument is taken as any global
+option (--with-double-dashes) and any non-option values after it which
+are not commands (reserved words)
+
+When the `--pin` option is used, it does not cause the pinned option
+to be excluded from the current command line call. The effects of the
+pinned option will take place in the current nosqlbench invocation
+just as they would without the `--pin`. However, when pinning global
+options when there are no commands on the command line, nosqlbench
+will not run a scenario, so this form is suitable for setting
+arguments.
+
+## Unpinning options.
+
+To reverse the effect of pinning an option, you simply use
+ `--unpin ...`.
+
+The behavior of --unpin is slightly different than --pin. Specifically,
+an option which is unpinned will be removed from the arg list, and will
+not be used in the current invocation of nosqlbench after removal.
+
+Further, you can specify `--unpin --grafana-baseurl` to unpin an option
+which normally has an argument, and all instances of that argument will be
+removed. If you want to unpin a specific instance of a multi-valued
+option, or one that can be specified more than once with different
+parameter values, then you must provide the value as well, as in
+`--unpin --log-histograms 'histodata.log:.*:1m'`
+
+# Setting defaults, the simple way
+
+To simply set global defaults, you can run nosqlbench with a command
+line like this:
+
+ ./nb --pin --docker-metrics-at metricsnode --pin --annotate all
diff --git a/engine-cli/src/main/resources/docker-metrics.md b/engine-cli/src/main/resources/docker-metrics.md
new file mode 100644
index 000000000..b4039b678
--- /dev/null
+++ b/engine-cli/src/main/resources/docker-metrics.md
@@ -0,0 +1,93 @@
+# docker-metrics
+
+Enlist nosqlbench to stand up your metrics infrastructure using a local
+docker runtime:
+
+ --docker-metrics
+
+When this option is set, nosqlbench will start graphite, prometheus,
+and grafana dockers (if-needed) automatically on your local system
+, configure them to work together, and point nosqlbench to send metrics
+and annotations to the system automatically.
+
+The inclued NoSQLBench dashboard uses the default grafana credentials of
+ admin:admin. You can find this dashboard by browsing to the "manage
+ dashboards" section of grafana.
+
+# remote docker-metrics
+
+It is possible to use `--docker-metrics` to set up a metrics collector
+stack on one system and use it from multiple other systems. In order
+to point client system at the collector, use an option like this:
+
+ --docker-metrics-at 192.168.192.168
+
+This will configure graphite and grafana annotations to point to
+the docker stack at the configured address.
+
+Further, if you want to do one-time configuration on the collector node
+and other nodes, you can use this pattern:
+
+ # on the collector node
+ ... --pin --docker-metrics
+
+ # on other nodes
+ ... --pin --docker-metrics-at
+
+This causes these options to be configured by default in an argsfile
+at `$HOME/.nosqlbench/argsfile`. The options above are pinned to
+be included by default in every command run from that point forward.
+
+## Docker Details
+
+If you want to know exactly what nosqlbench is doing, it's the equivalent
+of running the following by hand:
+
+ # pull and run the graphite-exporter container
+ docker run -d -p 9108:9108 -p 9109:9109 -p 9109:9109/udp prom/graphite-exporter
+
+Configuration files which are used by the docker containers are stored in:
+
+ $HOME/.nosqlbench
+
+## Resetting docker state
+
+If you need to clear the state for a local docker metrics stack, you
+ can remove these directories.
+
+ # DASHBOARDS AND METRICS WILL BE LOST IF YOU DO THIS
+ rm ~/.nosqlbench/{grafana,prometheus,prometheus-conf,graphite-exporter}
+
+## Manually installing dockers
+
+ # pull and run the prometheus container
+ docker run -d -p 9090:9090 -v '/.prometheus:/etc/prometheus' prom/prometheus --config.file=/etc/prometheus/prometheus.yml" --storage.tsdb.path=/prometheus" --storage.tsdb.retention=183d --web.enable-lifecycle
+
+ # pull and run the grafana container
+ docker run -d -p 3000:3000 -v grafana/grafana
+
+## Experimental environment variables
+
+These may allow you to send snapshot data to a specially configured
+remote grafana instance.
+
+ GF_SECURITY_ADMIN_PASSWORD=admin
+ GF_AUTH_ANONYMOUS_ENABLED="true"
+ GF_SNAPSHOTS_EXTERNAL_SNAPSHOT_URL=http://54.165.144.56:3001
+ GF_SNAPSHOTS_EXTERNAL_SNAPSHOT_NAME="Send to Wei"
+
+## Configuration Endpoints (Experimental)
+
+You can use the grafana api to set up the datasource and dashboard
+if you have other tools which integrate with grafana:
+
+ # These are not commands, they are only provides API parameters
+
+ POST http://localhost:3000/api/dashboards/db
+ analysis.json
+ # (found in resources/docker/dashboards/analysis.json)
+
+ POST http://localhost:3000/api/datasources
+ prometheus-datasource.yaml
+ # (found in resources/docker/datasources/prometheus-datasource.yaml)
+
diff --git a/engine-docs/src/main/resources/docs-for-ebhistoric/nb-cli-docs/threads.md b/engine-cli/src/main/resources/threads.md
similarity index 100%
rename from engine-docs/src/main/resources/docs-for-ebhistoric/nb-cli-docs/threads.md
rename to engine-cli/src/main/resources/threads.md
diff --git a/engine-cli/src/main/resources/topics.md b/engine-cli/src/main/resources/topics.md
index 14cf57c7b..6541bdd77 100644
--- a/engine-cli/src/main/resources/topics.md
+++ b/engine-cli/src/main/resources/topics.md
@@ -1,3 +1,6 @@
# global help topics
- commandline
- cli-scripting
+- argsfile
+- threads
+- docker-metrics
diff --git a/engine-docs/src/main/resources/docs-for-ebhistoric/nb-cli-docs/docker.md b/engine-docs/src/main/resources/docs-for-ebhistoric/nb-cli-docs/docker.md
deleted file mode 100644
index 8f9900bf0..000000000
--- a/engine-docs/src/main/resources/docs-for-ebhistoric/nb-cli-docs/docker.md
+++ /dev/null
@@ -1,60 +0,0 @@
-## docker metrics
-
-### summary
-
-Enlist nosqlbench to stand up your metrics infrastructure using a local docker runtime:
-
- --docker-metrics
-
-When this option is set, nosqlbench will start graphite, prometheus, and grafana automatically
-on your local docker, configure them to work together, and point nosqlbench to send metrics
-the system automatically. It also imports a base dashboard for nosqlbench and configures grafana
-snapshot export to share with a central DataStax grafana instance (grafana can be found on localhost:3000
-with the default credentials admin/admin).
-
-### details
-
-If you want to know exactly what nosqlbench is doing, it's the equivalent of running the following by hand:
-
-#### pull and run the graphite-exporter container
-
- docker run -d -p 9108:9108 -p 9109:9109 -p 9109:9109/udp prom/graphite-exporter
-
-#### prometheus config
-
-place prometheus config in .prometheus:
-
-prometheus.yml (found in resources/docker/prometheus/prometheus.yml)
-
-
-#### pull and run the prometheus container
-
- docker run -d -p 9090:9090 -v '/.prometheus:/etc/prometheus' prom/prometheus --config.file=/etc/prometheus/prometheus.yml" --storage.tsdb.path=/prometheus" --storage.tsdb.retention=183d --web.enable-lifecycle
-
-#### pull and run the grafana container
-
- docker run -d -p 3000:3000 -v grafana/grafana
-
-with the following environment variables:
-
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_AUTH_ANONYMOUS_ENABLED="true"
- GF_SNAPSHOTS_EXTERNAL_SNAPSHOT_URL=http://54.165.144.56:3001
- GF_SNAPSHOTS_EXTERNAL_SNAPSHOT_NAME="Send to Wei"
-
-#### configure grafana
-
-use the grafana api to set up the datasource and dashboard
-
-POST
-http://localhost:3000/api/dashboards/db
-
-Payload:
-analysis.json (found in resources/docker/dashboards/analysis.json)
-
-POST
-http://localhost:3000/api/datasources
-
-Payload:
-prometheus-datasource.yaml (found in resources/docker/datasources/prometheus-datasource.yaml)
-
From b5901679123c08de7a6f1726d52b3178f1fad9a1 Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Thu, 29 Oct 2020 10:55:33 -0500
Subject: [PATCH 006/164] environment and sys prop support
---
.../io/nosqlbench/engine/cli/Environment.java | 197 ++++++++++++++++++
.../engine/cli/EnvironmentTest.java | 18 ++
.../src/test/resources/argsfiles/home_env.cli | 1 +
3 files changed, 216 insertions(+)
create mode 100644 engine-cli/src/main/java/io/nosqlbench/engine/cli/Environment.java
create mode 100644 engine-cli/src/test/java/io/nosqlbench/engine/cli/EnvironmentTest.java
create mode 100644 engine-cli/src/test/resources/argsfiles/home_env.cli
diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/Environment.java b/engine-cli/src/main/java/io/nosqlbench/engine/cli/Environment.java
new file mode 100644
index 000000000..adf3da550
--- /dev/null
+++ b/engine-cli/src/main/java/io/nosqlbench/engine/cli/Environment.java
@@ -0,0 +1,197 @@
+package io.nosqlbench.engine.cli;
+
+import io.nosqlbench.nb.api.errors.BasicError;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Safer, Easier lookup of property and environment variables, so
+ * that commonly used env vars as seen on *n*x systems map to stable
+ * system properties where known, but attempt to fall through to
+ * the env variables if not.
+ *
+ * As long as all accesses and mutations for System properties and/or
+ * environment variables are marshaled through a singleton instance
+ * of this class, then users will not easily make a modify-after-reference
+ * bug without a warning or error.
+ *
+ * Referencing a variable here means that a value was asked for under a
+ * name, and a value was returned, even if this was the default value.
+ *
+ * Properties which contains a dot are presumed to be System properties,
+ * and so in that case System properties take precedence for those.
+ *
+ * Environment variables which are known to map to a stable system property
+ * are redirected to the system property.
+ *
+ * Otherwise, the environment variable is checked.
+ *
+ * Finally, System properties are checked for names not containing a dot.
+ *
+ * The first location to return a non-null value is used. Null values are considered
+ * invalid in this API, except when provided as a default value.
+ */
+public class Environment {
+ private final static Logger logger = LoggerFactory.getLogger(Environment.class);
+
+ // package private for testing
+ Environment() {
+ }
+
+ public final static Environment INSTANCE = new Environment();
+
+ private final LinkedHashMap references = new LinkedHashMap<>();
+
+ private final static Map envToProp = Map.of(
+ "PWD", "user.dir",
+ "HOME", "user.home",
+ "USERNAME", "user.name", // Win*
+ "USER", "user.name", // *n*x
+ "LOGNAME", "user.name" // *n*x
+ );
+
+ public Environment resetRefs() {
+ this.references.clear();
+ return this;
+ }
+
+ public void put(String propname, String value) {
+ if (envToProp.containsKey(propname)) {
+ throw new RuntimeException("The property you are changing should be considered immutable in this " +
+ "process: '" + propname + "'");
+ }
+ if (references.containsKey(propname)) {
+ if (references.get(propname).equals(value)) {
+ logger.warn("changing already referenced property '" + propname + "' to same value");
+ } else {
+ throw new BasicError("Changing already referenced property '" + propname + "' from \n" +
+ "'" + references.get(propname) + "' to '" + value + "' is not supported.\n" +
+ " (maybe you can change the order of your options to set higher-level parameters first.)");
+ }
+
+ }
+ System.setProperty(propname, value);
+ }
+
+ private String reference(String name, String value) {
+ this.references.put(name, value);
+ return value;
+ }
+
+ /**
+ * Return the value in the first place it is found to be non-null,
+ * or the default value otherwise.
+ *
+ * @param name The system property or environment variable name
+ * @param defaultValue The value to return if the name is not found
+ * @return the system property or environment variable's value, or the default value
+ */
+ public String getOr(String name, String defaultValue) {
+ String value = peek(name);
+ if (value == null) {
+ value = defaultValue;
+ }
+ return reference(name, value);
+ }
+
+ private String peek(String name) {
+ String value = null;
+ if (name.contains(".")) {
+ value = System.getProperty(name.toLowerCase());
+ if (value != null) {
+ return value;
+ }
+ }
+ if (envToProp.containsKey(name.toUpperCase())) {
+ String propName = envToProp.get(name.toUpperCase());
+ logger.debug("redirecting env var '" + name + "' to property '" + propName + "'");
+ value = System.getProperty(propName);
+ if (value != null) {
+ return value;
+ }
+ }
+ value = System.getProperty(name);
+ if (value != null) {
+ return value;
+ }
+
+ value = System.getenv(name);
+ if (value != null) {
+ return value;
+ }
+
+ return null;
+ }
+
+ /**
+ * Attempt to read the variable in System properties or the shell environment. If it
+ * is not found, throw an exception.
+ *
+ * @param name The System property or environment variable
+ * @return the variable
+ * @throws BasicError if no value was found which was non-null
+ */
+ public String get(String name) {
+ String value = getOr(name, null);
+ if (value == null) {
+ throw new BasicError("No variable was found for '" + name + "' in system properties nor in the shell " +
+ "environment.");
+ }
+ return value;
+ }
+
+ public boolean containsKey(String name) {
+ String value = peek(name);
+ return (value != null);
+ }
+
+ /**
+ * For the given word, if it contains a pattern with '$' followed by alpha, followed
+ * by alphanumeric and underscores, replace this pattern with the system property or
+ * environment variable of the same name. Do this for all occurrences of this pattern.
+ *
+ * For patterns which start with '${' and end with '}', replace the contents with the same
+ * rules as above, but allow any character in between.
+ *
+ * Nesting is not supported.
+ *
+ * @param word The word to interpolate the environment values into
+ * @return The interpolated value, after substitutions, or null if any lookup failed
+ */
+ public Optional interpolate(String word) {
+ Pattern envpattern = Pattern.compile("(\\$(?[a-zA-Z_][A-Za-z0-9_.]+)|\\$\\{(?[^}]+)\\})");
+ Matcher matcher = envpattern.matcher(word);
+ StringBuilder sb = new StringBuilder();
+ while (matcher.find()) {
+ String envvar = matcher.group("env1");
+ if (envvar == null) {
+ envvar = matcher.group("env2");
+ }
+ String value = peek(envvar);
+ if (value == null) {
+ logger.debug("no value found for '" + envvar + "', returning Optional.empty() for '" + word + "'");
+ return Optional.empty();
+ } else {
+ value = reference(envvar, value);
+ }
+ matcher.appendReplacement(sb, value);
+ }
+ matcher.appendTail(sb);
+ return Optional.of(sb.toString());
+ }
+
+ public List interpolate(CharSequence delim, String combined) {
+ String[] split = combined.split(delim.toString());
+ List mapped = new ArrayList<>();
+ for (String pattern : split) {
+ Optional interpolated = interpolate(pattern);
+ interpolated.ifPresent(mapped::add);
+ }
+ return mapped;
+ }
+
+}
diff --git a/engine-cli/src/test/java/io/nosqlbench/engine/cli/EnvironmentTest.java b/engine-cli/src/test/java/io/nosqlbench/engine/cli/EnvironmentTest.java
new file mode 100644
index 000000000..c65b069f1
--- /dev/null
+++ b/engine-cli/src/test/java/io/nosqlbench/engine/cli/EnvironmentTest.java
@@ -0,0 +1,18 @@
+package io.nosqlbench.engine.cli;
+
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class EnvironmentTest {
+
+ @Test
+ public void testInterpolation() {
+ Environment env = new Environment();
+ String home1 = env.interpolate("home is '$HOME'").orElse(null);
+ assertThat(home1).matches(".+");
+ String home2 = env.interpolate("home is '${home}'").orElse(null);
+ assertThat(home1).matches(".+");
+ }
+
+}
\ No newline at end of file
diff --git a/engine-cli/src/test/resources/argsfiles/home_env.cli b/engine-cli/src/test/resources/argsfiles/home_env.cli
new file mode 100644
index 000000000..ad8641311
--- /dev/null
+++ b/engine-cli/src/test/resources/argsfiles/home_env.cli
@@ -0,0 +1 @@
+--homedir $HOME
\ No newline at end of file
From 1382d33d12a4c396d87b7bd7d9eb993b3060a472 Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Thu, 29 Oct 2020 10:55:38 -0500
Subject: [PATCH 007/164] argsfiles and statedirs
---
.../io/nosqlbench/engine/cli/ArgsFile.java | 234 --------
.../java/io/nosqlbench/engine/cli/NBCLI.java | 64 +--
.../nosqlbench/engine/cli/NBCLIArgsFile.java | 500 ++++++++++++++++++
.../nosqlbench/engine/cli/NBCLIOptions.java | 152 ++++--
.../nosqlbench/engine/cli/ArgsFileTest.java | 40 --
.../engine/cli/NBCLIArgsFileTest.java | 117 ++++
6 files changed, 768 insertions(+), 339 deletions(-)
delete mode 100644 engine-cli/src/main/java/io/nosqlbench/engine/cli/ArgsFile.java
create mode 100644 engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIArgsFile.java
delete mode 100644 engine-cli/src/test/java/io/nosqlbench/engine/cli/ArgsFileTest.java
create mode 100644 engine-cli/src/test/java/io/nosqlbench/engine/cli/NBCLIArgsFileTest.java
diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/ArgsFile.java b/engine-cli/src/main/java/io/nosqlbench/engine/cli/ArgsFile.java
deleted file mode 100644
index 94dcd4258..000000000
--- a/engine-cli/src/main/java/io/nosqlbench/engine/cli/ArgsFile.java
+++ /dev/null
@@ -1,234 +0,0 @@
-package io.nosqlbench.engine.cli;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-
-/**
- *
Synopsis
- *
- * ArgsFile is a command-line modifier which can take linked list of
- * command args and modify it, and/or modify argsfile refrenced in this way.
- *
- *
ArgsFile Selection
- *
- * During processing, any occurence of '--argsfile' selects the active argsfile and loads
- * it into the command line in place of the '--argsfile' argument. By default the args file
- * will be loaded if it exists, and a warning will be given if it does not.
- *
- * The '--argsfile-required <somepath>' version will throw an error if the args file
- * is not present, but it will not report any warnings or details otherwise.
- *
- * The `--argsfile-optional <somepath> version will not throw an error if the args
- * file is not present, and it will not report any warnings or details otherwise.
- *
- * A prefix command line can be given to ArgsFile to pre-load any settings. In this way
- * it is possible to easily provide a default args file which will be loaded. For example,
- * A prefix command of '--argsfile-optional <somepath>' will load options if they are
- * available in the specified file, but will otherwise provide no feedback to the user.
- *
- *
ArgsFile Injection
- *
- * When an argsfile is loaded, it reads a command from each line into the current position
- * of the command line. No parsing is done. Blank lines are ignored. Newlines are used as the
- * argument delimiter, and lines that end with a backslash before the newline are automatically
- * joined together.
- *
- *
ArgsFile Diagnostics
- *
- * All modifications to the command line should be reported to the logging facility at
- * INFO level. This assumes that the calling layer wants to inform users of command line injections,
- * and that the user can select to be notified of warnings only if desired.
- *
- *
Environment Variables
- *
- * Simple environment variable substitution is attempted for any pattern which appears as '$' followed
- * by all uppercase letters and underscores. Any references of this type which are not resolvable
- * will cause an error to be thrown.
- */
-public class ArgsFile {
- private final static Logger logger = LoggerFactory.getLogger(ArgsFile.class);
-
- private Path argsPath;
- private LinkedList preload;
-
- public ArgsFile() {
- }
-
- public ArgsFile preload(String... preload) {
- this.preload = new LinkedList(Arrays.asList(preload));
- return this;
- }
-
- private enum Selection {
- // Ignore if not present, show injections at info
- IgnoreIfMissing,
- // Warn if not present, but show injections at info
- WarnIfMissing,
- // throw error if not present, show injections at info
- ErrorIfMissing
- }
-
- public LinkedList process(String... args) {
- return process(new LinkedList(Arrays.asList(args)));
- }
-
- public LinkedList process(LinkedList commandline) {
- if (preload != null) {
- LinkedList modified = new LinkedList();
- modified.addAll(preload);
- modified.addAll(commandline);
- preload = null;
- commandline = modified;
- }
- LinkedList composed = new LinkedList<>();
- while (commandline.peekFirst() != null) {
- String arg = commandline.peekFirst();
- switch (arg) {
- case "--argsfile":
- commandline.removeFirst();
- String argspath = readWordOrThrow(commandline, "path to an args file");
- setArgsFile(argspath, Selection.WarnIfMissing);
- commandline = loadArgs(this.argsPath, Selection.WarnIfMissing, commandline);
- break;
- case "--argsfile-required":
- commandline.removeFirst();
- String argspathRequired = readWordOrThrow(commandline, "path to an args file");
- setArgsFile(argspathRequired, Selection.ErrorIfMissing);
- commandline = loadArgs(this.argsPath, Selection.ErrorIfMissing, commandline);
- break;
- case "--argsfile-optional":
- commandline.removeFirst();
- String argspathOptional = readWordOrThrow(commandline, "path to an args file");
- setArgsFile(argspathOptional, Selection.IgnoreIfMissing);
- commandline = loadArgs(this.argsPath, Selection.IgnoreIfMissing, commandline);
- break;
- case "--pin":
- commandline.removeFirst();
- commandline = pinArg(commandline);
- break;
- case "--unpin":
- commandline.removeFirst();
- commandline = unpinArg(commandline);
- break;
- default:
- composed.addLast(commandline.removeFirst());
- }
-
- }
- return composed;
- }
-
- private LinkedList loadArgs(Path argspath, Selection mode, LinkedList commandline) {
- if (!assertArgsFileExists(argspath, mode)) {
- return commandline;
- }
- List lines = null;
- try {
- lines = Files.readAllLines(argspath);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- List content = lines.stream()
- .filter(s -> !s.startsWith("#"))
- .filter(s -> !s.startsWith("/"))
- .filter(s -> !s.isBlank())
- .filter(s -> !s.isEmpty())
- .collect(Collectors.toList());
- StringBuilder splitword = new StringBuilder();
- LinkedList loaded = new LinkedList<>();
- for (String s : content) {
- splitword.append(s);
- if (!s.endsWith("\\")) {
- loaded.addLast(splitword.toString());
- splitword.setLength(0);
- } else {
- splitword.setLength(splitword.length() - 1);
- }
- }
- if (splitword.length() > 0) {
- throw new RuntimeException("unqualified line continuation for '" + splitword.toString() + "'");
- }
-
- Iterator injections = loaded.descendingIterator();
- while (injections.hasNext()) {
- String injection = injections.next();
- injection = injectEnv(injection);
- commandline.addFirst(injection);
- }
-
- return commandline;
- }
-
- private boolean assertArgsFileExists(Path argspath, Selection mode) {
- if (!Files.exists(argsPath)) {
- switch (mode) {
- case ErrorIfMissing:
- throw new RuntimeException("A required argsfile was specified, but it does not exist: '" + argspath + "'");
- case WarnIfMissing:
- logger.warn("An argsfile was specified, but it does not exist: '" + argspath + "'");
- case IgnoreIfMissing:
- }
- return false;
- }
- return true;
- }
-
- private void setArgsFile(String argspath, Selection mode) {
- this.argsPath = Path.of(argspath);
-// assertIfMissing(this.argsPath,mode);
- }
-
- private String readWordOrThrow(LinkedList commandline, String description) {
- String found = commandline.peekFirst();
- if (found == null) {
- throw new RuntimeException("Unable to read argument top option for " + description);
- }
- return commandline.removeFirst();
- }
-
- private LinkedList pinArg(LinkedList commandline) {
- if (this.argsPath == null) {
- throw new RuntimeException("No argsfile has been selected before using the pin option.");
- }
- return commandline;
- }
-
- private LinkedList unpinArg(LinkedList commandline) {
- if (this.argsPath == null) {
- throw new RuntimeException("No argsfile has been selected before using the unpin option.");
- }
- return commandline;
- }
-
- private String injectEnv(String word) {
- Pattern envpattern = Pattern.compile("(?\\$[A-Z_]+)");
- Matcher matcher = envpattern.matcher(word);
- StringBuilder sb = new StringBuilder();
- while (matcher.find()) {
- String envvar = matcher.group("envvar");
- String value = System.getenv(envvar);
- if (value == null) {
- throw new RuntimeException("Env var '" + envvar + "' was not found in the environment.");
- }
- matcher.appendReplacement(sb, value);
- }
- matcher.appendTail(sb);
- return sb.toString();
- }
-
- public LinkedList pin(LinkedList arglist) {
- return arglist;
- }
-
- public LinkedList unpin(LinkedList arglist) {
- return arglist;
- }
-}
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 57caa129d..db6f08530 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
@@ -39,10 +39,10 @@ import java.util.stream.Collectors;
public class NBCLI {
- private static final Logger logger = LoggerFactory.getLogger(NBCLI.class);
+ private static final Logger logger = LoggerFactory.getLogger("NBCLI");
private static final Logger EVENTS = LoggerFactory.getLogger("EVENTS");
- private static final String CHART_HDR_LOG_NAME = "hdrdata-for-chart.log";
+ private static final String CHART_HDR_LOG_NAME = "hdrdata-for-chart.log";
private final String commandName;
@@ -70,36 +70,43 @@ public class NBCLI {
NBCLIOptions globalOptions = new NBCLIOptions(args, NBCLIOptions.Mode.ParseGlobalsOnly);
// Global only processing
+ if (args.length == 0) {
+ System.out.println(loadHelpFile("commandline.md"));
+ System.exit(0);
+ }
+ boolean dockerMetrics = globalOptions.wantsDockerMetrics();
+ String dockerMetricsAt = globalOptions.wantsDockerMetricsAt();
String reportGraphiteTo = globalOptions.wantsReportGraphiteTo();
+ int mOpts = (dockerMetrics ? 1 : 0) + (dockerMetricsAt != null ? 1 : 0) + (reportGraphiteTo != null ? 1 : 0);
+ if (mOpts > 1) {
+ throw new BasicError("You have multiple conflicting options which attempt to set\n" +
+ " the destination for metrics and annotations. Please select only one of\n" +
+ " --docker-metrics, --docker-metrics-at , or --report-graphite-to \n" +
+ " For more details, see run 'nb help docker-metrics'");
+ }
- if (globalOptions.wantsDockerMetrics()) {
+ String metricsAddr = null;
+
+ if (dockerMetrics) {
+ // Setup docker stack for local docker metrics
logger.info("Docker metrics is enabled. Docker must be installed for this to work");
DockerMetricsManager dmh = new DockerMetricsManager();
Map dashboardOptions = Map.of(
- DockerMetricsManager.GRAFANA_TAG, globalOptions.getDockerGrafanaTag()
+ DockerMetricsManager.GRAFANA_TAG, globalOptions.getDockerGrafanaTag()
);
dmh.startMetrics(dashboardOptions);
-
String warn = "Docker Containers are started, for grafana and prometheus, hit" +
- " these urls in your browser: http://:3000 and http://:9090";
+ " these urls in your browser: http://:3000 and http://:9090";
logger.warn(warn);
- if (reportGraphiteTo != null) {
- logger.warn(String.format("Docker metrics are enabled (--docker-metrics)" +
- " but graphite reporting (--report-graphite-to) is set to %s \n" +
- "usually only one of the two is configured.",
- reportGraphiteTo));
- } else {
- logger.info("Setting graphite reporting to localhost");
- reportGraphiteTo = "localhost:9109";
- }
+ metricsAddr = "localhost";
+ } else if (dockerMetricsAt != null) {
+ metricsAddr = dockerMetricsAt;
+ }
- if (globalOptions.getAnnotatorsConfig() != null) {
- logger.warn("Docker metrics and separate annotations" +
- "are configured (both --docker-metrics and --annotations).");
- } else {
- Annotators.init("grafana{http://localhost:3000/}");
- }
+ if (metricsAddr != null) {
+ reportGraphiteTo = metricsAddr + ":9109";
+ Annotators.init("{type:'grafana',url:'http://" + metricsAddr + ":3000/'}");
}
if (args.length > 0 && args[0].toLowerCase().equals("virtdata")) {
@@ -275,13 +282,6 @@ public class NBCLI {
// intentionally not shown for warn-only
logger.info("console logging level is " + options.wantsConsoleLogLevel());
- if (options.getCommands().
-
- size() == 0) {
- System.out.println(loadHelpFile("commandline.md"));
- System.exit(0);
- }
-
ScenariosExecutor executor = new ScenariosExecutor("executor-" + sessionName, 1);
Scenario scenario = new Scenario(
@@ -311,8 +311,6 @@ public class NBCLI {
}
- // Execute Scenario!
-
Level consoleLogLevel = options.wantsConsoleLogLevel();
Level scenarioLogLevel = Level.toLevel(options.getLogsLevel());
if (scenarioLogLevel.toInt() > consoleLogLevel.toInt()) {
@@ -321,6 +319,12 @@ public class NBCLI {
Level maxLevel = Level.toLevel(Math.min(consoleLogLevel.toInt(), scenarioLogLevel.toInt()));
+ // Execute Scenario!
+ if (options.getCommands().size() == 0) {
+ logger.info("No commands provided. Exiting before scenario.");
+ System.exit(0);
+ }
+
scenario.addScriptText(scriptData);
ScriptParams scriptParams = new ScriptParams();
scriptParams.putAll(buffer.getCombinedParams());
diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIArgsFile.java b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIArgsFile.java
new file mode 100644
index 000000000..ec047e94f
--- /dev/null
+++ b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIArgsFile.java
@@ -0,0 +1,500 @@
+package io.nosqlbench.engine.cli;
+
+import io.nosqlbench.nb.api.errors.BasicError;
+import joptsimple.internal.Strings;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.attribute.PosixFilePermissions;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ *
Synopsis
+ *
+ * ArgsFile is a command-line modifier which can take linked list of
+ * command args and modify it, and/or modify argsfile refrenced in this way.
+ *
+ *
ArgsFile Selection
+ *
+ * During processing, any occurence of '--argsfile' selects the active argsfile and loads
+ * it into the command line in place of the '--argsfile' argument. By default the args file
+ * will be loaded if it exists, and a warning will be given if it does not.
+ *
+ * The '--argsfile-required <somepath>' version will throw an error if the args file
+ * is not present, but it will not report any warnings or details otherwise.
+ *
+ * The `--argsfile-optional <somepath> version will not throw an error if the args
+ * file is not present, and it will not report any warnings or details otherwise.
+ *
+ * A prefix command line can be given to ArgsFile to pre-load any settings. In this way
+ * it is possible to easily provide a default args file which will be loaded. For example,
+ * A prefix command of '--argsfile-optional <somepath>' will load options if they are
+ * available in the specified file, but will otherwise provide no feedback to the user.
+ *
+ *
ArgsFile Injection
+ *
+ * When an argsfile is loaded, it reads a command from each line into the current position
+ * of the command line. No parsing is done. Blank lines are ignored. Newlines are used as the
+ * argument delimiter, and lines that end with a backslash before the newline are automatically
+ * joined together.
+ *
+ *
ArgsFile Diagnostics
+ *
+ * All modifications to the command line should be reported to the logging facility at
+ * INFO level. This assumes that the calling layer wants to inform users of command line injections,
+ * and that the user can select to be notified of warnings only if desired.
+ *
+ *
Environment Variables
+ *
+ * Simple environment variable substitution is attempted for any pattern which appears as '$' followed
+ * by all uppercase letters and underscores. Any references of this type which are not resolvable
+ * will cause an error to be thrown.
+ */
+public class NBCLIArgsFile {
+ private final static Logger logger = LoggerFactory.getLogger("ARGSFILE");
+
+ // Options which may contextualize other CLI options or commands.
+ // These must be parsed first
+ public static final String ARGS_FILE = "--argsfile";
+ public static final String ARGS_FILE_OPTIONAL = "--argsfile-optional";
+ public static final String ARGS_FILE_REQUIRED = "--argsfile-required";
+ public static final String ARGS_PIN = "--pin";
+ public static final String ARGS_UNPIN = "--unpin";
+
+ private Path argsPath;
+ private LinkedList preload;
+ private final Set stopWords = new HashSet<>();
+ private final LinkedHashSet args = new LinkedHashSet<>();
+ LinkedHashSet argsToPin = new LinkedHashSet<>();
+ LinkedHashSet argsToUnpin = new LinkedHashSet<>();
+ private final Set readPaths = new HashSet<>();
+
+ public NBCLIArgsFile() {
+ }
+
+ public NBCLIArgsFile preload(String... preload) {
+ this.preload = new LinkedList(Arrays.asList(preload));
+ return this;
+ }
+
+ /**
+ * Indicate which words are invalid for the purposes of matching
+ * trailing parts of arguments. The provided words will not
+ * be considered as valid values to arguments in any case.
+ *
+ * @param reservedWords Words to ignore in option values
+ * @return this ArgsFile, for method chaining
+ */
+ public NBCLIArgsFile reserved(Collection reservedWords) {
+ this.stopWords.addAll(reservedWords);
+ return this;
+ }
+
+ /**
+ * Indicate which words are invalid for the purposes of matching
+ * trailing parts of arguments. The provided words will not
+ * be considered as valid values to arguments in any case.
+ *
+ * @param reservedWords Words to ignore in option values
+ * @return this ArgsFile, for method chaining
+ */
+ public NBCLIArgsFile reserved(String... reservedWords) {
+ this.stopWords.addAll(Arrays.asList(reservedWords));
+ return this;
+ }
+
+ private enum Selection {
+ // Ignore if not present, show injections at info
+ IgnoreIfMissing,
+ // Warn if not present, but show injections at info
+ WarnIfMissing,
+ // throw error if not present, show injections at info
+ ErrorIfMissing
+ }
+
+ public LinkedList process(String... args) {
+ return process(new LinkedList(Arrays.asList(args)));
+ }
+
+ public LinkedList process(LinkedList commandline) {
+ if (preload != null) {
+ LinkedList modified = new LinkedList();
+ modified.addAll(preload);
+ modified.addAll(commandline);
+ preload = null;
+ commandline = modified;
+ }
+ LinkedList composed = new LinkedList<>();
+
+ while (commandline.peekFirst() != null) {
+ String arg = commandline.peekFirst();
+ switch (arg) {
+ case ARGS_FILE:
+ pinAndUnpin();
+ commandline.removeFirst();
+ String argspath = readWordOrThrow(commandline, "path to an args file");
+ setArgsFile(argspath, Selection.WarnIfMissing);
+ commandline = mergeArgs(this.argsPath, Selection.WarnIfMissing, commandline);
+ break;
+ case ARGS_FILE_REQUIRED:
+ commandline.removeFirst();
+ String argspathRequired = readWordOrThrow(commandline, "path to an args file");
+ setArgsFile(argspathRequired, Selection.ErrorIfMissing);
+ commandline = mergeArgs(this.argsPath, Selection.ErrorIfMissing, commandline);
+ break;
+ case ARGS_FILE_OPTIONAL:
+ commandline.removeFirst();
+ String argspathOptional = readWordOrThrow(commandline, "path to an args file");
+ setArgsFile(argspathOptional, Selection.IgnoreIfMissing);
+ commandline = mergeArgs(this.argsPath, Selection.IgnoreIfMissing, commandline);
+ break;
+ case ARGS_PIN:
+ commandline.removeFirst();
+ argsToPin.addAll(argsToLines(readOptionAndArg(commandline, false)));
+ break;
+ case ARGS_UNPIN:
+ commandline.removeFirst();
+ argsToUnpin.addAll(argsToLines(readOptionAndArg(commandline, true)));
+ break;
+ default:
+ composed.addLast(commandline.removeFirst());
+ }
+ }
+ pinAndUnpin();
+ return composed;
+ }
+
+ private void pinAndUnpin() {
+ if (this.argsToUnpin.size() == 0 && this.argsToPin.size() == 0) {
+ return;
+ }
+ LinkedHashSet extant = readArgsFile(this.argsPath, Selection.IgnoreIfMissing);
+ LinkedHashSet mergedPins = mergePins(this.argsToPin, this.argsToUnpin, extant);
+ if (extant.equals(mergedPins)) {
+ logger.info("Pinning resulted in no changes to argsfile '" + this.argsPath.toString() + "'");
+ } else {
+ logger.info("Writing updated argsfile '" + this.argsPath.toString() + "' with " +
+ (this.argsToPin.size() + this.argsToUnpin.size()) + " changes");
+ writeArgsFile(mergedPins);
+ }
+
+ this.argsToPin.clear();
+ this.argsToUnpin.clear();
+
+ }
+
+
+ private LinkedHashSet mergePins(
+ LinkedHashSet toPin,
+ LinkedHashSet toUnpin,
+ LinkedHashSet extant) {
+
+ LinkedHashSet merged = new LinkedHashSet<>();
+ merged.addAll(extant);
+
+ for (String arg : toPin) {
+ if (argsToUnpin.contains(arg)) {
+ throw new RuntimeException("You have both --pin and --unpin for '" + arg + ", I don't know which " +
+ "one you want.");
+ }
+ }
+ for (String arg : toUnpin) {
+ if (argsToPin.contains(arg)) {
+ throw new RuntimeException("You have both --pin and --unpin for '" + arg + ", I don't know which " +
+ "one you want.");
+ }
+ }
+
+ for (String toAdd : toPin) {
+ if (merged.contains(toAdd)) {
+ logger.warn("Requested to pin argument again: '" + toAdd + "', ignoring");
+ } else {
+ logger.info("Pinning option '" + toAdd + "' to '" + this.argsPath.toString() + "'");
+ merged.add(toAdd);
+ }
+ }
+
+ for (String toDel : toUnpin) {
+ if (merged.contains(toDel)) {
+ logger.info("Unpinning '" + toDel + "' from '" + this.argsPath.toString() + "'");
+ merged.remove(toDel);
+ } else {
+ logger.warn("Requested to unpin argument '" + toDel + "' which was not found in " + argsPath.toString());
+ }
+ }
+
+ return merged;
+ }
+
+ LinkedList mergeArgs(Path argspath, Selection mode, LinkedList commandline) {
+ this.args.clear();
+ if (this.readPaths.contains(argsPath.toString())) {
+ throw new BasicError("Recursive reading of argsfile is detected for '" + argspath.toString() + "'.\n" +
+ "Please ensure that you do not have cyclic references in your arguments for argsfiles.");
+ }
+ LinkedHashSet loaded = readArgsFile(argspath, mode);
+ this.readPaths.add(argsPath.toString());
+
+ List interpolated = loaded.stream()
+ .map(p -> {
+ String q = Environment.INSTANCE.interpolate(p).orElse(p);
+ if (!q.equals(p)) {
+ logger.info("argsfile: '" + argsPath.toString() + "': loaded option '" + p + "' as '" + q + "'");
+ }
+ return q;
+ })
+ .collect(Collectors.toList());
+
+ LinkedList inArgvForm = linesToArgs(interpolated);
+ this.args.addAll(inArgvForm);
+ return concat(inArgvForm, commandline);
+ }
+
+ private LinkedList concat(Collection... entries) {
+ LinkedList composed = new LinkedList<>();
+ for (Collection list : entries) {
+ composed.addAll(list);
+ }
+ return composed;
+ }
+
+ /**
+ *
Load the args file into an args array. The returned format follows
+ * the standard pattern of args as you would see for a main method, although
+ * the internal format is structured to support easy editing and clarity.
+ *
+ *
+ * The args file is stored in a simple option-per-line format which
+ * follows these rules:
+ *
+ *
Lines ending with a backslash (\) only are concatenated to the next
+ * line with the backslash removed.
+ *
Line content consists of one option and one optional argument.
+ *
Options must start with at least one dash (-).
+ *
If an argument is provided for an option, it follows the option and a space.
+ *
Empty lines and lines which start with '//' or '#' are ignored.
+ *
Lines which are identical after applying the above rules are elided
+ * down to the last occurence.
+ *
+ *
+ *
+ *
+ * This allows for multi-valued options, or options which can be specified multiple
+ * times with different arguments to be supported, so long as each occurrence has a
+ * unique option value.
+ *
+ *
+ * @param argspath The path of the argsfile to load
+ * @param mode The level of feedback to provide in the case of a missing file
+ * @return The argsfile content, structured like an args array
+ */
+ private LinkedHashSet readArgsFile(Path argspath, Selection mode) {
+ LinkedHashSet args = new LinkedHashSet<>();
+
+ if (!assertArgsFileExists(argspath, mode)) {
+ return args;
+ }
+
+ List lines = null;
+ try {
+ lines = Files.readAllLines(argspath);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ List content = lines.stream()
+ .filter(s -> !s.startsWith("#"))
+ .filter(s -> !s.startsWith("/"))
+ .filter(s -> !s.isBlank())
+ .filter(s -> !s.isEmpty())
+ .collect(Collectors.toList());
+ StringBuilder splitword = new StringBuilder();
+ LinkedHashSet loaded = new LinkedHashSet<>();
+ for (String s : content) {
+ splitword.append(s);
+ if (!s.endsWith("\\")) {
+ loaded.add(splitword.toString());
+ splitword.setLength(0);
+ } else {
+ splitword.setLength(splitword.length() - 1);
+ }
+ }
+ if (splitword.length() > 0) {
+ throw new RuntimeException("unqualified line continuation for '" + splitword.toString() + "'");
+ }
+
+ return loaded;
+ }
+
+ /**
+ * Write the argsfile in the format specified by {@link #readArgsFile(Path, Selection)}
+ *
+ * This method requires that an argsFile has been set by a previous
+ * --argsfile or --argsfile-required or --argsfile-optional option.
+ *
+ * @param args The args to write in one-arg-per-line form
+ */
+ private void writeArgsFile(LinkedHashSet args) {
+ if (this.argsPath == null) {
+ throw new RuntimeException("No argsfile has been selected before using the pin option.");
+ }
+
+ try {
+ Files.createDirectories(
+ this.argsPath.getParent(),
+ PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwxrwx---"))
+ );
+ Files.write(this.argsPath, args);
+ } catch (IOException e) {
+ throw new BasicError("unable to write '" + this.argsPath + "': " + e.getMessage());
+ }
+ }
+
+ private boolean assertArgsFileExists(Path argspath, Selection mode) {
+ if (!Files.exists(argsPath)) {
+ switch (mode) {
+ case ErrorIfMissing:
+ throw new RuntimeException("A required argsfile was specified, but it does not exist: '" + argspath + "'");
+ case WarnIfMissing:
+ logger.warn("An argsfile was specified, but it does not exist: '" + argspath + "'");
+ case IgnoreIfMissing:
+ }
+ return false;
+ }
+ return true;
+ }
+
+ private void setArgsFile(String argspath, Selection mode) {
+ Path selected = null;
+ String[] possibles = argspath.split(":");
+ for (String possible : possibles) {
+ Optional expanded = Environment.INSTANCE.interpolate(possible);
+ if (expanded.isPresent()) {
+ Path possiblePath = Path.of(expanded.get());
+ if (Files.exists(possiblePath)) {
+ selected = possiblePath;
+ break;
+ }
+ }
+ }
+
+ if (selected == null) {
+ String defaultFirst = possibles[0];
+ defaultFirst = Environment.INSTANCE.interpolate(defaultFirst)
+ .orElseThrow(() -> new RuntimeException("Invalid default argsfile: '" + possibles[0] + "'"));
+ selected = Path.of(defaultFirst);
+ }
+
+ this.argsPath = selected;
+ logger.debug("argsfile path is now '" + this.argsPath.toString() + "'");
+ }
+
+ /**
+ * Convert argv arguments to consolidated form which is used in the args file.
+ * This means that options and their (optional) arguments are on the
+ * same line, concatenated with a space after the option.
+ *
+ * @return The arg-per-line form
+ */
+ LinkedHashSet argsToLines(List args) {
+ LinkedHashSet lines = new LinkedHashSet<>();
+ Iterator iter = args.iterator();
+ List element = new ArrayList<>();
+ while (iter.hasNext()) {
+ String word = iter.next();
+ if (word.startsWith("-")) {
+ if (element.size() > 0) {
+ lines.add(Strings.join(element, " "));
+ element.clear();
+ }
+ }
+ element.add(word);
+ }
+ lines.add(Strings.join(element, " "));
+ return lines;
+ }
+
+ /**
+ * Convert arg lines as used in an args file to the argv which
+ * is used on the command line.
+ *
+ * @return The argv list as you would see with {@code main(String[] argv)}
+ */
+ LinkedList linesToArgs(Collection lines) {
+ LinkedList args = new LinkedList<>();
+ for (String line : lines) {
+ if (line.startsWith("-")) {
+ String[] words = line.split(" ", 2);
+ args.addAll(Arrays.asList(words));
+ } else {
+ args.add(line);
+ }
+ }
+ return args;
+ }
+
+ private LinkedList unpin(LinkedList arglist) {
+ if (this.argsPath == null) {
+ throw new RuntimeException("No argsfile has been selected before using the pin option.");
+ }
+ return arglist;
+ }
+
+ /**
+ * Read the current command line option from the argument list,
+ * so long as it is a dash or double-dash option, and is not a
+ * reserved word, and any argument that goes with it, if any.
+ *
+ * @param arglist The command line containing the option
+ * @return A list containing the current command line option
+ */
+ private LinkedList readOptionAndArg(LinkedList arglist, boolean consume) {
+ LinkedList option = new LinkedList<>();
+ ListIterator iter = arglist.listIterator();
+
+ if (!iter.hasNext()) {
+ throw new RuntimeException("Arguments must follow the --pin option");
+ }
+ String opt = iter.next();
+
+ if (!opt.startsWith("-") || stopWords.contains(opt)) {
+ throw new RuntimeException("Arguments following the --pin option must not" +
+ " be commands like '" + opt + "'");
+ }
+ option.add(opt);
+ if (consume) {
+ iter.remove();
+ }
+
+ if (iter.hasNext()) {
+ opt = iter.next();
+ if (!stopWords.contains(opt) && !opt.startsWith("-")) {
+ option.add(opt);
+ if (consume) {
+ iter.remove();
+ }
+ }
+ }
+ return option;
+ }
+
+
+ /**
+ * Consume the next word from the beginning of the linked list. If there is
+ * no word to consume, then throw an error with the description.
+ *
+ * @param commandline A list of words
+ * @param description A description of what the next word value is meant to represent
+ * @return The next word from the list
+ */
+ private String readWordOrThrow(LinkedList commandline, String description) {
+ String found = commandline.peekFirst();
+ if (found == null) {
+ throw new RuntimeException("Unable to read argument top option for " + description);
+ }
+ return commandline.removeFirst();
+ }
+}
diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
index c92aa52f3..fe0398152 100644
--- a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
+++ b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
@@ -4,11 +4,15 @@ import ch.qos.logback.classic.Level;
import io.nosqlbench.engine.api.metrics.IndicatorMode;
import io.nosqlbench.engine.api.util.Unit;
import io.nosqlbench.engine.core.script.Scenario;
+import io.nosqlbench.nb.api.errors.BasicError;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
import java.nio.file.Path;
+import java.nio.file.attribute.PosixFilePermissions;
import java.security.InvalidParameterException;
import java.util.*;
import java.util.stream.Collectors;
@@ -19,19 +23,16 @@ import java.util.stream.Collectors;
*/
public class NBCLIOptions {
- private final static String userHome = System.getProperty("user.home");
- private final static Path defaultOptFile = Path.of(userHome, ".nosqlbench/options");
-
- private final static Logger logger = LoggerFactory.getLogger(NBCLIOptions.class);
-
- // Options which may contextualize other CLI options or commands.
- // These must be parsed first
- private static final String ARGS_FILE = "--argsfile";
- private static final String ARGS_FILE_DEFAULT = "$HOME/.nosqlbench/argsfile";
- private static final String ARGS_PIN = "--pin";
- private static final String ARGS_UNPIN = "--unpin";
+ private final static Logger logger = LoggerFactory.getLogger("OPTIONS");
+ private final static String NB_STATE_DIR = "--statedir";
+ private final static String NB_STATEDIR_PATHS = "$NBSTATEDIR:$PWD/.nosqlbench:$HOME/.nosqlbench";
+ public static final String ARGS_FILE_DEFAULT = "$NBSTATEDIR/argsfile";
private static final String INCLUDE = "--include";
+
+ private final static String userHome = System.getProperty("user.home");
+
+
private static final String METRICS_PREFIX = "--metrics-prefix";
// private static final String ANNOTATE_TO_GRAFANA = "--grafana-baseurl";
@@ -39,7 +40,6 @@ public class NBCLIOptions {
private static final String ANNOTATORS_CONFIG = "--annotators";
private static final String DEFAULT_ANNOTATORS = "all";
-
// Discovery
private static final String HELP = "--help";
private static final String LIST_METRICS = "--list-metrics";
@@ -91,6 +91,7 @@ public class NBCLIOptions {
private static final String DOCKER_GRAFANA_TAG = "--docker-grafana-tag";
private static final String DEFAULT_CONSOLE_LOGGING_PATTERN = "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n";
+ public static final String NBSTATEDIR = "NBSTATEDIR";
private final LinkedList cmdList = new LinkedList<>();
private int logsMax = 0;
@@ -130,13 +131,16 @@ public class NBCLIOptions {
private Scenario.Engine engine = Scenario.Engine.Graalvm;
private boolean graaljs_compat = false;
private int hdr_digits = 4;
- private String docker_grafana_tag = "7.0.1";
+ private String docker_grafana_tag = "7.2.2";
private boolean showStackTraces = false;
private boolean compileScript = false;
private String scriptFile = null;
private String[] annotateEvents = new String[]{"ALL"};
private String dockerMetricsHost;
private String annotatorsConfig = "";
+ private String statedirs = NB_STATEDIR_PATHS;
+ private Path statepath;
+ private List statePathAccesses = new ArrayList<>();
public String getAnnotatorsConfig() {
return annotatorsConfig;
@@ -163,8 +167,6 @@ public class NBCLIOptions {
}
private LinkedList parseGlobalOptions(String[] args) {
- ArgsFile argsfile = new ArgsFile();
- argsfile.preload("--argsfile-optional", ARGS_FILE_DEFAULT);
LinkedList arglist = new LinkedList<>() {{
addAll(Arrays.asList(args));
@@ -175,7 +177,8 @@ public class NBCLIOptions {
return arglist;
}
- // Preprocess --include regardless of position
+ // Process --include and --statedir, separately first
+ // regardless of position
LinkedList nonincludes = new LinkedList<>();
while (arglist.peekFirst() != null) {
String word = arglist.peekFirst();
@@ -188,9 +191,53 @@ public class NBCLIOptions {
}
switch (word) {
- case ARGS_FILE:
- case ARGS_PIN:
- case ARGS_UNPIN:
+ case NB_STATE_DIR:
+ arglist.removeFirst();
+ this.statedirs = readWordOrThrow(arglist, "nosqlbench global state directory");
+ break;
+ case INCLUDE:
+ arglist.removeFirst();
+ String include = readWordOrThrow(arglist, "path to include");
+ wantsToIncludePaths.add(include);
+ break;
+ default:
+ nonincludes.addLast(arglist.removeFirst());
+ }
+ }
+ this.statedirs = (this.statedirs != null ? this.statedirs : NB_STATEDIR_PATHS);
+ this.setStatePath();
+
+ arglist = nonincludes;
+ nonincludes = new LinkedList<>();
+
+ // Now that statdirs is settled, auto load argsfile if it is present
+ NBCLIArgsFile argsfile = new NBCLIArgsFile();
+ argsfile.reserved(NBCLICommandParser.RESERVED_WORDS);
+ argsfile.preload("--argsfile-optional", ARGS_FILE_DEFAULT);
+ arglist = argsfile.process(arglist);
+
+ // Parse all --argsfile... and other high level options
+
+ while (arglist.peekFirst() != null) {
+ String word = arglist.peekFirst();
+ if (word.startsWith("--") && word.contains("=")) {
+ String wordToSplit = arglist.removeFirst();
+ String[] split = wordToSplit.split("=", 2);
+ arglist.offerFirst(split[1]);
+ arglist.offerFirst(split[0]);
+ continue;
+ }
+
+ switch (word) {
+ // These options modify other options. They should be processed early.
+ case NBCLIArgsFile.ARGS_FILE:
+ case NBCLIArgsFile.ARGS_FILE_OPTIONAL:
+ case NBCLIArgsFile.ARGS_FILE_REQUIRED:
+ case NBCLIArgsFile.ARGS_PIN:
+ case NBCLIArgsFile.ARGS_UNPIN:
+ if (this.statepath == null) {
+ setStatePath();
+ }
arglist = argsfile.process(arglist);
break;
case ANNOTATE_EVENTS:
@@ -198,19 +245,10 @@ public class NBCLIOptions {
String toAnnotate = readWordOrThrow(arglist, "annotated events");
annotateEvents = toAnnotate.split("\\\\s*,\\\\s*");
break;
-// case ANNOTATE_TO_GRAFANA:
-// arglist.removeFirst();
-// grafanaEndpoint = readWordOrThrow(arglist,"grafana API endpoint");
-// break;
case ANNOTATORS_CONFIG:
arglist.removeFirst();
this.annotatorsConfig = readWordOrThrow(arglist, "annotators config");
break;
- case INCLUDE:
- arglist.removeFirst();
- String include = readWordOrThrow(arglist, "path to include");
- wantsToIncludePaths.add(include);
- break;
case REPORT_GRAPHITE_TO:
arglist.removeFirst();
reportGraphiteTo = arglist.removeFirst();
@@ -245,13 +283,57 @@ public class NBCLIOptions {
break;
default:
nonincludes.addLast(arglist.removeFirst());
-
}
-
}
+
return nonincludes;
}
+ private Path setStatePath() {
+ if (statePathAccesses.size() > 0) {
+ throw new BasicError("The statedir must be set before it is used by other\n" +
+ " options. If you want to change the statedir, be sure you do it before\n" +
+ " dependent options. These parameters were called before this --statedir:\n" +
+ statePathAccesses.stream().map(s -> "> " + s).collect(Collectors.joining("\n")));
+ }
+ if (this.statepath != null) {
+ return this.statepath;
+ }
+
+ List paths = Environment.INSTANCE.interpolate(":", statedirs);
+ Path selected = null;
+
+ for (String pathName : paths) {
+ Path path = Path.of(pathName);
+ if (Files.exists(path)) {
+ if (Files.isDirectory(path)) {
+ selected = path;
+ break;
+ } else {
+ logger.warn("possible state dir path is not a directory: '" + path.toString() + "'");
+ }
+ }
+ }
+ if (selected == null) {
+ selected = Path.of(paths.get(0));
+ }
+
+ if (!Files.exists(selected)) {
+ try {
+ Files.createDirectories(
+ selected,
+ PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwxrwx---"))
+ );
+ } catch (IOException e) {
+ throw new BasicError("Could not create state directory at '" + selected.toString() + "': " + e.getMessage());
+ }
+ }
+
+ Environment.INSTANCE.put(NBSTATEDIR, selected.toString());
+
+ return selected;
+ }
+
private void parseAllOptions(String[] args) {
LinkedList arglist = parseGlobalOptions(args);
@@ -565,7 +647,7 @@ public class NBCLIOptions {
spec.indicatorMode = IndicatorMode.logonly;
} else if (this.getCommands().stream().anyMatch(cmd -> cmd.getCmdType().equals(Cmd.CmdType.script))) {
logger.info("Command line includes script calls, so progress data on console is " +
- "suppressed.");
+ "suppressed.");
spec.indicatorMode = IndicatorMode.logonly;
}
}
@@ -577,7 +659,7 @@ public class NBCLIOptions {
configs.stream().map(LoggerConfig::getFilename).forEach(s -> {
if (files.contains(s)) {
logger.warn(s + " is included in " + configName + " more than once. It will only be included " +
- "in the first matching config. Reorder your options if you need to control this.");
+ "in the first matching config. Reorder your options if you need to control this.");
}
files.add(s);
});
@@ -688,8 +770,8 @@ public class NBCLIOptions {
break;
default:
throw new RuntimeException(
- LOG_HISTOGRAMS +
- " options must be in either 'regex:filename:interval' or 'regex:filename' or 'filename' format"
+ LOG_HISTOGRAMS +
+ " options must be in either 'regex:filename:interval' or 'regex:filename' or 'filename' format"
);
}
}
@@ -714,7 +796,7 @@ public class NBCLIOptions {
switch (parts.length) {
case 2:
Unit.msFor(parts[1]).orElseThrow(
- () -> new RuntimeException("Unable to parse progress indicator indicatorSpec '" + parts[1] + "'")
+ () -> new RuntimeException("Unable to parse progress indicator indicatorSpec '" + parts[1] + "'")
);
progressSpec.intervalSpec = parts[1];
case 1:
diff --git a/engine-cli/src/test/java/io/nosqlbench/engine/cli/ArgsFileTest.java b/engine-cli/src/test/java/io/nosqlbench/engine/cli/ArgsFileTest.java
deleted file mode 100644
index 91bb05ecc..000000000
--- a/engine-cli/src/test/java/io/nosqlbench/engine/cli/ArgsFileTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package io.nosqlbench.engine.cli;
-
-import org.junit.Test;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ArgsFileTest {
-
- @Test
- public void testLoadingArgs() {
- LinkedList result;
- ArgsFile argsFile = new ArgsFile();
- result = argsFile.process("--argsfile", "src/test/resources/argsfiles/nonextant.cli");
- assertThat(result).containsExactly();
- result = argsFile.process("--argsfile", "src/test/resources/argsfiles/alphagamma.cli");
- assertThat(result).containsExactly("alpha", "gamma");
- }
-
- @Test(expected = RuntimeException.class)
- public void testLoadingMissingRequiredFails() {
- LinkedList result;
- ArgsFile argsFile = new ArgsFile();
- result = argsFile.process("--argsfile-required", "src/test/resources/argsfiles/nonextant.cli");
- }
-
- @Test
- public void testLoadingInPlace() {
- LinkedList result;
- LinkedList commands = new LinkedList<>(List.of("--abc", "--def", "--argsfile", "src/test/resources" +
- "/argsfiles/alphagamma.cli"));
- ArgsFile argsFile = new ArgsFile().preload("--argsfile-optional", "src/test/resources/argsfiles/alphagamma" +
- ".cli");
- result = argsFile.process(commands);
- assertThat(result).containsExactly("alpha", "gamma", "--abc", "--def", "alpha", "gamma");
- }
-
-}
\ No newline at end of file
diff --git a/engine-cli/src/test/java/io/nosqlbench/engine/cli/NBCLIArgsFileTest.java b/engine-cli/src/test/java/io/nosqlbench/engine/cli/NBCLIArgsFileTest.java
new file mode 100644
index 000000000..9b2b8f55b
--- /dev/null
+++ b/engine-cli/src/test/java/io/nosqlbench/engine/cli/NBCLIArgsFileTest.java
@@ -0,0 +1,117 @@
+package io.nosqlbench.engine.cli;
+
+import org.junit.Test;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.attribute.PosixFilePermissions;
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class NBCLIArgsFileTest {
+
+ @Test
+ public void testLoadingArgs() {
+ LinkedList result;
+ NBCLIArgsFile argsFile = new NBCLIArgsFile();
+ result = argsFile.process("--argsfile", "src/test/resources/argsfiles/nonextant.cli");
+ assertThat(result).containsExactly();
+ result = argsFile.process("--argsfile", "src/test/resources/argsfiles/alphagamma.cli");
+ assertThat(result).containsExactly("alpha", "gamma");
+ }
+
+ @Test
+ public void loadParamsWithEnv() {
+ NBCLIArgsFile argsfile = new NBCLIArgsFile();
+ LinkedList result = argsfile.process("--argsfile-required", "src/test/resources/argsfiles/home_env.cli");
+ System.out.println(result);
+ }
+
+ @Test(expected = RuntimeException.class)
+ public void testLoadingMissingRequiredFails() {
+ LinkedList result;
+ NBCLIArgsFile argsFile = new NBCLIArgsFile();
+ result = argsFile.process("--argsfile-required", "src/test/resources/argsfiles/nonextant.cli");
+ }
+
+ @Test
+ public void testLoadingInPlace() {
+ LinkedList result;
+ LinkedList commands = new LinkedList<>(List.of("--abc", "--def"));
+
+ NBCLIArgsFile argsFile = new NBCLIArgsFile().preload("--argsfile-optional", "src/test/resources/argsfiles/alphagamma" +
+ ".cli");
+ result = argsFile.process(commands);
+ assertThat(result).containsExactly("alpha", "gamma", "--abc", "--def");
+ }
+
+ @Test
+ public void testLinesToArgs() {
+ NBCLIArgsFile argsfile = new NBCLIArgsFile().reserved("reservedword");
+ LinkedList args = argsfile.linesToArgs(
+ List.of("--optionname argument", "--optionname2", "--opt3 reservedword")
+ );
+ assertThat(args).containsExactly("--optionname", "argument", "--optionname2", "--opt3", "reservedword");
+ }
+
+ @Test
+ public void testOptionPinning() {
+ Path tempFile = null;
+ try {
+ tempFile = Files.createTempFile(
+ "tmpfile",
+ "cli",
+ PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rw-rw-r--"))
+ );
+
+ // preloading is a way to have global defaults based on
+ // the presence of a default file
+ NBCLIArgsFile argsfile = new NBCLIArgsFile().preload(
+ "--argsfile-optional", tempFile.toAbsolutePath().toString()
+ );
+
+ LinkedList commandline;
+
+ commandline = argsfile.process(
+ "--pin", "--option1",
+ "--pin", "--option1",
+ "--pin", "--option2", "arg2"
+ );
+
+ String filecontents;
+ filecontents = Files.readString(tempFile);
+
+ // logging should indicate no changes
+ commandline = argsfile.process(
+ "--pin", "--option1",
+ "--pin", "--option1",
+ "--pin", "--option2", "arg2"
+ );
+
+ // unpinned options should be discarded
+ commandline = argsfile.process(
+ "--unpin", "--option1",
+ "--option4", "--option5"
+ );
+
+ assertThat(commandline).containsExactly(
+ "--option4", "--option5"
+ );
+
+ assertThat(filecontents).isEqualTo("--option1\n--option2 arg2\n");
+
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ } finally {
+ try {
+ Files.deleteIfExists(tempFile);
+ } catch (Exception ignored) {
+ }
+ }
+ }
+
+
+}
\ No newline at end of file
From 1e958a7e7911e65bbef555c65ae738bb75d7f1d6 Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Thu, 29 Oct 2020 10:55:43 -0500
Subject: [PATCH 008/164] simplify logger naming for core systems
---
.../engine/api/activityimpl/SimpleActivity.java | 2 +-
.../nosqlbench/engine/core/metrics/MetricReporters.java | 8 ++++----
.../java/io/nosqlbench/engine/core/script/Scenario.java | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/engine-api/src/main/java/io/nosqlbench/engine/api/activityimpl/SimpleActivity.java b/engine-api/src/main/java/io/nosqlbench/engine/api/activityimpl/SimpleActivity.java
index de0d82610..9eed87e0e 100644
--- a/engine-api/src/main/java/io/nosqlbench/engine/api/activityimpl/SimpleActivity.java
+++ b/engine-api/src/main/java/io/nosqlbench/engine/api/activityimpl/SimpleActivity.java
@@ -35,7 +35,7 @@ import java.util.function.Supplier;
* A default implementation of an Activity, suitable for building upon.
*/
public class SimpleActivity implements Activity, ProgressCapable {
- private final static Logger logger = LoggerFactory.getLogger(SimpleActivity.class);
+ private final static Logger logger = LoggerFactory.getLogger("ACTIVITY");
protected ActivityDef activityDef;
private final List closeables = new ArrayList<>();
diff --git a/engine-core/src/main/java/io/nosqlbench/engine/core/metrics/MetricReporters.java b/engine-core/src/main/java/io/nosqlbench/engine/core/metrics/MetricReporters.java
index 27346ef9b..8574f6edb 100644
--- a/engine-core/src/main/java/io/nosqlbench/engine/core/metrics/MetricReporters.java
+++ b/engine-core/src/main/java/io/nosqlbench/engine/core/metrics/MetricReporters.java
@@ -35,10 +35,10 @@ import java.util.concurrent.TimeUnit;
public class MetricReporters implements Shutdownable {
private final static Logger logger = LoggerFactory.getLogger(MetricReporters.class);
- private static MetricReporters instance = new MetricReporters();
+ private static final MetricReporters instance = new MetricReporters();
- private List metricRegistries = new ArrayList<>();
- private List scheduledReporters = new ArrayList<>();
+ private final List metricRegistries = new ArrayList<>();
+ private final List scheduledReporters = new ArrayList<>();
private MetricReporters() {
ShutdownManager.register(this);
@@ -136,7 +136,7 @@ public class MetricReporters implements Shutdownable {
public MetricReporters start(int consoleIntervalSeconds, int remoteIntervalSeconds) {
for (ScheduledReporter scheduledReporter : scheduledReporters) {
- logger.info("starting reporter: " + scheduledReporter);
+ logger.info("starting reporter: " + scheduledReporter.getClass().getSimpleName());
if (scheduledReporter instanceof ConsoleReporter) {
scheduledReporter.start(consoleIntervalSeconds, TimeUnit.SECONDS);
} else {
diff --git a/engine-core/src/main/java/io/nosqlbench/engine/core/script/Scenario.java b/engine-core/src/main/java/io/nosqlbench/engine/core/script/Scenario.java
index 3b0360f16..3c8a49e1e 100644
--- a/engine-core/src/main/java/io/nosqlbench/engine/core/script/Scenario.java
+++ b/engine-core/src/main/java/io/nosqlbench/engine/core/script/Scenario.java
@@ -46,7 +46,7 @@ import java.util.stream.Collectors;
public class Scenario implements Callable {
- private static final Logger logger = (Logger) LoggerFactory.getLogger(Scenario.class);
+ private static final Logger logger = (Logger) LoggerFactory.getLogger("SCENARIO");
private State state = State.Scheduled;
From d5a98f140a262037ecaf13252741082c63e3146e Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Thu, 29 Oct 2020 11:34:38 -0500
Subject: [PATCH 009/164] update release notes
---
RELEASENOTES.md | 27 ++++++++-------------------
1 file changed, 8 insertions(+), 19 deletions(-)
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 15867f798..38beaf0a4 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -1,19 +1,8 @@
-- f702736f (HEAD -> main) flatten maps in OpTemplates to allow map consumers
-- 4a9fa81b pull Named service up
-- 574a89e7 pull ConfigAware api up
-- 71195d0a http release fixes
-- 3fa89ebc partial work for --args
-- 262df571 improved error messages
-- 453b1b2c extract ratio from optemplate before construction
-- dcf458c4 annotation progress
-- 7017b6cd add SplitLongs function
-- 0758670f add nb clients module
-- 1dbf36c4 add grafana annotation client
-- 120d9761 remove warning for speculative defaults
-- c78f1e92 typos and minor fixes
-- f3f1b8f4 add annotations design sketch
-- 394580d6 more idea sketches
-- 9e5972f5 comment cleanup
-- 06edfcc9 fix NPE when binding has undefined value
-- 510746b7 improve mismatched scenario name feedback
-- 735b32e1 add illustrative test for EpochMillisToJavaLocalDate
+- 1e958a7e (HEAD -> main) simplify logger naming for core systems
+- 1382d33d argsfiles and statedirs
+- b5901679 environment and sys prop support
+- fd74ccba move common topics to resources base
+- 6a8dfef1 qualify grafana docker with tag
+- 2830d070 simple workload improvements
+- b9607d07 make argsfiles use double dash
+- a9b0dc9d argsfile support
From 4611f679536a06407b4af548a4187b89f7f74357 Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Thu, 29 Oct 2020 11:34:56 -0500
Subject: [PATCH 010/164] cqld4 fixes
---
driver-cqld4/pom.xml | 6 ++++++
.../activitytype/cqld4/statements/rowoperators/Save.java | 1 -
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/driver-cqld4/pom.xml b/driver-cqld4/pom.xml
index b869f96a4..d8216bd72 100644
--- a/driver-cqld4/pom.xml
+++ b/driver-cqld4/pom.xml
@@ -76,6 +76,12 @@
org.xerial.snappysnappy-java
+
+ io.nosqlbench
+ virtdata-lib-basics
+ 3.12.155-SNAPSHOT
+ compile
+
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rowoperators/Save.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rowoperators/Save.java
index df35df3f0..fc01f6934 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rowoperators/Save.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rowoperators/Save.java
@@ -1,7 +1,6 @@
package io.nosqlbench.activitytype.cqld4.statements.rowoperators;
import com.datastax.oss.driver.api.core.cql.ColumnDefinition;
-import com.datastax.oss.driver.api.core.cql.ColumnDefinitions;
import com.datastax.oss.driver.api.core.cql.Row;
import io.nosqlbench.activitytype.cqld4.api.RowCycleOperator;
import io.nosqlbench.virtdata.library.basics.core.threadstate.SharedState;
From 2d9d141cfffef3e69a9c943607c2b7d0f8ba5433 Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Thu, 12 Nov 2020 15:24:27 -0600
Subject: [PATCH 011/164] include dsegraph
---
RELEASENOTES.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 15867f798..787cc5822 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -17,3 +17,5 @@
- 06edfcc9 fix NPE when binding has undefined value
- 510746b7 improve mismatched scenario name feedback
- 735b32e1 add illustrative test for EpochMillisToJavaLocalDate
+- 2390f253 Initial Migration of DSE Graph
+- 2275573c Update Readme
From 7ead8fba2f59521049f54d841b3db6d9a1602c93 Mon Sep 17 00:00:00 2001
From: nb-droid
Date: Thu, 12 Nov 2020 21:35:46 +0000
Subject: [PATCH 012/164] [maven-release-plugin] prepare release
nosqlbench-3.12.155
---
docsys/pom.xml | 6 +++---
driver-cql-shaded/pom.xml | 6 +++---
driver-cqlverify/pom.xml | 6 +++---
driver-diag/pom.xml | 6 +++---
driver-dsegraph-shaded/pom.xml | 6 +++---
driver-http/pom.xml | 6 +++---
driver-jmx/pom.xml | 6 +++---
driver-kafka/pom.xml | 6 +++---
driver-mongodb/pom.xml | 6 +++---
driver-stdout/pom.xml | 6 +++---
driver-tcp/pom.xml | 8 ++++----
driver-web/pom.xml | 6 +++---
drivers-api/pom.xml | 6 +++---
engine-api/pom.xml | 10 +++++-----
engine-cli/pom.xml | 6 +++---
engine-clients/pom.xml | 4 ++--
engine-core/pom.xml | 8 ++++----
engine-docker/pom.xml | 4 ++--
engine-docs/pom.xml | 4 ++--
engine-extensions/pom.xml | 4 ++--
engine-rest/pom.xml | 4 ++--
mvn-defaults/pom.xml | 4 ++--
nb-annotations/pom.xml | 2 +-
nb-api/pom.xml | 4 ++--
nb/pom.xml | 36 +++++++++++++++++-----------------
pom.xml | 4 ++--
virtdata-api/pom.xml | 6 +++---
virtdata-lang/pom.xml | 2 +-
virtdata-lib-basics/pom.xml | 4 ++--
virtdata-lib-curves4/pom.xml | 6 +++---
virtdata-lib-random/pom.xml | 6 +++---
virtdata-lib-realer/pom.xml | 4 ++--
virtdata-realdata/pom.xml | 4 ++--
virtdata-userlibs/pom.xml | 16 +++++++--------
34 files changed, 111 insertions(+), 111 deletions(-)
diff --git a/docsys/pom.xml b/docsys/pom.xml
index 8ebb39825..1f89ad0f5 100644
--- a/docsys/pom.xml
+++ b/docsys/pom.xml
@@ -9,7 +9,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -18,7 +18,7 @@
io.nosqlbenchnb-api
- 3.12.155-SNAPSHOT
+ 3.12.155
@@ -98,7 +98,7 @@
io.nosqlbenchvirtdata-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/driver-cql-shaded/pom.xml b/driver-cql-shaded/pom.xml
index a7918c88a..2b9d1eea8 100644
--- a/driver-cql-shaded/pom.xml
+++ b/driver-cql-shaded/pom.xml
@@ -4,7 +4,7 @@
io.nosqlbenchmvn-defaults
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -23,13 +23,13 @@
io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdrivers-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/driver-cqlverify/pom.xml b/driver-cqlverify/pom.xml
index b80d13267..fca7ac100 100644
--- a/driver-cqlverify/pom.xml
+++ b/driver-cqlverify/pom.xml
@@ -4,7 +4,7 @@
io.nosqlbenchmvn-defaults
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -24,13 +24,13 @@
io.nosqlbenchdriver-cql-shaded
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdrivers-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/driver-diag/pom.xml b/driver-diag/pom.xml
index 876af26e0..834a4e8d9 100644
--- a/driver-diag/pom.xml
+++ b/driver-diag/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -20,13 +20,13 @@
io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdrivers-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/driver-dsegraph-shaded/pom.xml b/driver-dsegraph-shaded/pom.xml
index 77bdc0b0e..8eec49a26 100644
--- a/driver-dsegraph-shaded/pom.xml
+++ b/driver-dsegraph-shaded/pom.xml
@@ -4,7 +4,7 @@
io.nosqlbenchmvn-defaults
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -23,13 +23,13 @@
io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdrivers-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/driver-http/pom.xml b/driver-http/pom.xml
index abbfdd73a..0a7543952 100644
--- a/driver-http/pom.xml
+++ b/driver-http/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -22,13 +22,13 @@
io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdrivers-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/driver-jmx/pom.xml b/driver-jmx/pom.xml
index 0fb2df6d2..e728686c3 100644
--- a/driver-jmx/pom.xml
+++ b/driver-jmx/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -22,13 +22,13 @@
io.nosqlbenchdrivers-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/driver-kafka/pom.xml b/driver-kafka/pom.xml
index 63fe03ed0..4549b8f5a 100644
--- a/driver-kafka/pom.xml
+++ b/driver-kafka/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -44,13 +44,13 @@
io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdriver-stdout
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/driver-mongodb/pom.xml b/driver-mongodb/pom.xml
index 81f78dc92..b3816f48f 100644
--- a/driver-mongodb/pom.xml
+++ b/driver-mongodb/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -21,13 +21,13 @@
io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdrivers-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/driver-stdout/pom.xml b/driver-stdout/pom.xml
index 7bb6e8b3f..4dfe527ea 100644
--- a/driver-stdout/pom.xml
+++ b/driver-stdout/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -22,13 +22,13 @@
io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdrivers-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/driver-tcp/pom.xml b/driver-tcp/pom.xml
index 7c1e7e1c7..6f2e409ad 100644
--- a/driver-tcp/pom.xml
+++ b/driver-tcp/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -24,19 +24,19 @@
io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdrivers-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdriver-stdout
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/driver-web/pom.xml b/driver-web/pom.xml
index 0792af8ce..fb93b7881 100644
--- a/driver-web/pom.xml
+++ b/driver-web/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -22,13 +22,13 @@
io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdrivers-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/drivers-api/pom.xml b/drivers-api/pom.xml
index c8ecb8267..3f4e8817a 100644
--- a/drivers-api/pom.xml
+++ b/drivers-api/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -23,13 +23,13 @@
io.nosqlbenchnb-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchvirtdata-userlibs
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/engine-api/pom.xml b/engine-api/pom.xml
index cc264b70b..23fe9bfbf 100644
--- a/engine-api/pom.xml
+++ b/engine-api/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -23,25 +23,25 @@
io.nosqlbenchnb-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdrivers-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchnb-annotations
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchvirtdata-userlibs
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/engine-cli/pom.xml b/engine-cli/pom.xml
index a5e010a26..1a0fc0fa6 100644
--- a/engine-cli/pom.xml
+++ b/engine-cli/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -23,13 +23,13 @@
io.nosqlbenchengine-core
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchengine-docker
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/engine-clients/pom.xml b/engine-clients/pom.xml
index 9b23a67e2..32aad946d 100644
--- a/engine-clients/pom.xml
+++ b/engine-clients/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -21,7 +21,7 @@
io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/engine-core/pom.xml b/engine-core/pom.xml
index 12a95183f..365e9d745 100644
--- a/engine-core/pom.xml
+++ b/engine-core/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -28,13 +28,13 @@
io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdrivers-api
- 3.12.155-SNAPSHOT
+ 3.12.155
@@ -90,7 +90,7 @@
io.nosqlbenchengine-clients
- 3.12.155-SNAPSHOT
+ 3.12.155compile
diff --git a/engine-docker/pom.xml b/engine-docker/pom.xml
index e2985ccff..969dc47ef 100644
--- a/engine-docker/pom.xml
+++ b/engine-docker/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -65,7 +65,7 @@
io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/engine-docs/pom.xml b/engine-docs/pom.xml
index 51542e43f..e1eb3e31b 100644
--- a/engine-docs/pom.xml
+++ b/engine-docs/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -28,7 +28,7 @@
io.nosqlbenchdocsys
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/engine-extensions/pom.xml b/engine-extensions/pom.xml
index 136d66e56..714ffca56 100644
--- a/engine-extensions/pom.xml
+++ b/engine-extensions/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -22,7 +22,7 @@
io.nosqlbenchengine-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/engine-rest/pom.xml b/engine-rest/pom.xml
index cccec2954..d8495afda 100644
--- a/engine-rest/pom.xml
+++ b/engine-rest/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -47,7 +47,7 @@
io.nosqlbenchengine-cli
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/mvn-defaults/pom.xml b/mvn-defaults/pom.xml
index 97cb7bfb4..0aa94449e 100644
--- a/mvn-defaults/pom.xml
+++ b/mvn-defaults/pom.xml
@@ -3,7 +3,7 @@
io.nosqlbenchmvn-defaults
- 3.12.155-SNAPSHOT
+ 3.12.155pom
@@ -95,7 +95,7 @@
scm:git:https://github.com/nosqlbench/nosqlbench.git
- HEAD
+ nosqlbench-3.12.155
diff --git a/nb-annotations/pom.xml b/nb-annotations/pom.xml
index 9ea4bb229..ee56907aa 100644
--- a/nb-annotations/pom.xml
+++ b/nb-annotations/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
diff --git a/nb-api/pom.xml b/nb-api/pom.xml
index 5a41f6031..82f628576 100644
--- a/nb-api/pom.xml
+++ b/nb-api/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -31,7 +31,7 @@
io.nosqlbenchnb-annotations
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/nb/pom.xml b/nb/pom.xml
index 6f6f045cb..f905b3ec1 100644
--- a/nb/pom.xml
+++ b/nb/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -24,31 +24,31 @@
io.nosqlbenchengine-rest
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchengine-cli
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchengine-docs
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchengine-core
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchengine-extensions
- 3.12.155-SNAPSHOT
+ 3.12.155
@@ -60,67 +60,67 @@
io.nosqlbenchdriver-web
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdriver-kafka
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdriver-stdout
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdriver-diag
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdriver-tcp
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdriver-http
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdriver-jmx
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdriver-dsegraph-shaded
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdriver-cql-shaded
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdriver-cqlverify
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchdriver-mongodb
- 3.12.155-SNAPSHOT
+ 3.12.155
@@ -259,7 +259,7 @@
io.nosqlbenchdriver-mongodb
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/pom.xml b/pom.xml
index abc203dcf..5db1a1559 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155mvn-defaults
@@ -145,7 +145,7 @@
scm:git:https://github.com/nosqlbench/nosqlbench.git
scm:git:git@github.com:nosqlbench/nosqlbench.git
- HEAD
+ nosqlbench-3.12.155
diff --git a/virtdata-api/pom.xml b/virtdata-api/pom.xml
index 99425bb5f..b1e41362f 100644
--- a/virtdata-api/pom.xml
+++ b/virtdata-api/pom.xml
@@ -7,7 +7,7 @@
io.nosqlbenchmvn-defaults
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -23,14 +23,14 @@
io.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155nb-apiio.nosqlbenchvirtdata-lang
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/virtdata-lang/pom.xml b/virtdata-lang/pom.xml
index c4b07dddd..10131c033 100644
--- a/virtdata-lang/pom.xml
+++ b/virtdata-lang/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
diff --git a/virtdata-lib-basics/pom.xml b/virtdata-lib-basics/pom.xml
index aeafd6554..c461c77d7 100644
--- a/virtdata-lib-basics/pom.xml
+++ b/virtdata-lib-basics/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -20,7 +20,7 @@
io.nosqlbenchvirtdata-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/virtdata-lib-curves4/pom.xml b/virtdata-lib-curves4/pom.xml
index 0194ec6d7..a7082c086 100644
--- a/virtdata-lib-curves4/pom.xml
+++ b/virtdata-lib-curves4/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -22,13 +22,13 @@
io.nosqlbenchvirtdata-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchvirtdata-lib-basics
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/virtdata-lib-random/pom.xml b/virtdata-lib-random/pom.xml
index 7c42852d5..5933d678f 100644
--- a/virtdata-lib-random/pom.xml
+++ b/virtdata-lib-random/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -20,13 +20,13 @@
io.nosqlbenchvirtdata-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchvirtdata-lib-basics
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/virtdata-lib-realer/pom.xml b/virtdata-lib-realer/pom.xml
index 279090f3f..4e9444f6f 100644
--- a/virtdata-lib-realer/pom.xml
+++ b/virtdata-lib-realer/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -20,7 +20,7 @@
io.nosqlbenchvirtdata-lib-basics
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/virtdata-realdata/pom.xml b/virtdata-realdata/pom.xml
index dda04f214..2ac839bd4 100644
--- a/virtdata-realdata/pom.xml
+++ b/virtdata-realdata/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -18,7 +18,7 @@
io.nosqlbenchvirtdata-api
- 3.12.155-SNAPSHOT
+ 3.12.155
diff --git a/virtdata-userlibs/pom.xml b/virtdata-userlibs/pom.xml
index fd434bd34..1ee5422e4 100644
--- a/virtdata-userlibs/pom.xml
+++ b/virtdata-userlibs/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155../mvn-defaults
@@ -18,36 +18,36 @@
io.nosqlbenchvirtdata-realdata
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchvirtdata-lib-realer
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchvirtdata-api
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbenchvirtdata-lib-random
- 3.12.155-SNAPSHOT
+ 3.12.155io.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155virtdata-lib-basicsio.nosqlbench
- 3.12.155-SNAPSHOT
+ 3.12.155virtdata-lib-curves4
@@ -55,7 +55,7 @@
io.nosqlbenchdocsys
- 3.12.155-SNAPSHOT
+ 3.12.155
From ad5bc4e4477bf1bbd09a3b5a977038dfc36dac91 Mon Sep 17 00:00:00 2001
From: nb-droid
Date: Thu, 12 Nov 2020 21:35:52 +0000
Subject: [PATCH 013/164] [maven-release-plugin] prepare for next development
iteration
---
docsys/pom.xml | 6 +++---
driver-cql-shaded/pom.xml | 6 +++---
driver-cqlverify/pom.xml | 6 +++---
driver-diag/pom.xml | 6 +++---
driver-dsegraph-shaded/pom.xml | 6 +++---
driver-http/pom.xml | 6 +++---
driver-jmx/pom.xml | 6 +++---
driver-kafka/pom.xml | 6 +++---
driver-mongodb/pom.xml | 6 +++---
driver-stdout/pom.xml | 6 +++---
driver-tcp/pom.xml | 8 ++++----
driver-web/pom.xml | 6 +++---
drivers-api/pom.xml | 6 +++---
engine-api/pom.xml | 10 +++++-----
engine-cli/pom.xml | 6 +++---
engine-clients/pom.xml | 4 ++--
engine-core/pom.xml | 8 ++++----
engine-docker/pom.xml | 4 ++--
engine-docs/pom.xml | 4 ++--
engine-extensions/pom.xml | 4 ++--
engine-rest/pom.xml | 4 ++--
mvn-defaults/pom.xml | 4 ++--
nb-annotations/pom.xml | 2 +-
nb-api/pom.xml | 4 ++--
nb/pom.xml | 36 +++++++++++++++++-----------------
pom.xml | 4 ++--
virtdata-api/pom.xml | 6 +++---
virtdata-lang/pom.xml | 2 +-
virtdata-lib-basics/pom.xml | 4 ++--
virtdata-lib-curves4/pom.xml | 6 +++---
virtdata-lib-random/pom.xml | 6 +++---
virtdata-lib-realer/pom.xml | 4 ++--
virtdata-realdata/pom.xml | 4 ++--
virtdata-userlibs/pom.xml | 16 +++++++--------
34 files changed, 111 insertions(+), 111 deletions(-)
diff --git a/docsys/pom.xml b/docsys/pom.xml
index 1f89ad0f5..38ef76178 100644
--- a/docsys/pom.xml
+++ b/docsys/pom.xml
@@ -9,7 +9,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -18,7 +18,7 @@
io.nosqlbenchnb-api
- 3.12.155
+ 3.12.156-SNAPSHOT
@@ -98,7 +98,7 @@
io.nosqlbenchvirtdata-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/driver-cql-shaded/pom.xml b/driver-cql-shaded/pom.xml
index 2b9d1eea8..02bc2c009 100644
--- a/driver-cql-shaded/pom.xml
+++ b/driver-cql-shaded/pom.xml
@@ -4,7 +4,7 @@
io.nosqlbenchmvn-defaults
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -23,13 +23,13 @@
io.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdrivers-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/driver-cqlverify/pom.xml b/driver-cqlverify/pom.xml
index fca7ac100..bdce34dd8 100644
--- a/driver-cqlverify/pom.xml
+++ b/driver-cqlverify/pom.xml
@@ -4,7 +4,7 @@
io.nosqlbenchmvn-defaults
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -24,13 +24,13 @@
io.nosqlbenchdriver-cql-shaded
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdrivers-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/driver-diag/pom.xml b/driver-diag/pom.xml
index 834a4e8d9..bdc2687c6 100644
--- a/driver-diag/pom.xml
+++ b/driver-diag/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -20,13 +20,13 @@
io.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdrivers-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/driver-dsegraph-shaded/pom.xml b/driver-dsegraph-shaded/pom.xml
index 8eec49a26..50a0078e2 100644
--- a/driver-dsegraph-shaded/pom.xml
+++ b/driver-dsegraph-shaded/pom.xml
@@ -4,7 +4,7 @@
io.nosqlbenchmvn-defaults
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -23,13 +23,13 @@
io.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdrivers-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/driver-http/pom.xml b/driver-http/pom.xml
index 0a7543952..ddf35a5d8 100644
--- a/driver-http/pom.xml
+++ b/driver-http/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -22,13 +22,13 @@
io.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdrivers-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/driver-jmx/pom.xml b/driver-jmx/pom.xml
index e728686c3..c38259925 100644
--- a/driver-jmx/pom.xml
+++ b/driver-jmx/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -22,13 +22,13 @@
io.nosqlbenchdrivers-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/driver-kafka/pom.xml b/driver-kafka/pom.xml
index 4549b8f5a..8dc0bef7a 100644
--- a/driver-kafka/pom.xml
+++ b/driver-kafka/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -44,13 +44,13 @@
io.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdriver-stdout
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/driver-mongodb/pom.xml b/driver-mongodb/pom.xml
index b3816f48f..37138df14 100644
--- a/driver-mongodb/pom.xml
+++ b/driver-mongodb/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -21,13 +21,13 @@
io.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdrivers-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/driver-stdout/pom.xml b/driver-stdout/pom.xml
index 4dfe527ea..5175e32be 100644
--- a/driver-stdout/pom.xml
+++ b/driver-stdout/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -22,13 +22,13 @@
io.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdrivers-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/driver-tcp/pom.xml b/driver-tcp/pom.xml
index 6f2e409ad..9462878a7 100644
--- a/driver-tcp/pom.xml
+++ b/driver-tcp/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -24,19 +24,19 @@
io.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdrivers-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdriver-stdout
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/driver-web/pom.xml b/driver-web/pom.xml
index fb93b7881..9ac89affa 100644
--- a/driver-web/pom.xml
+++ b/driver-web/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -22,13 +22,13 @@
io.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdrivers-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/drivers-api/pom.xml b/drivers-api/pom.xml
index 3f4e8817a..b51ee675b 100644
--- a/drivers-api/pom.xml
+++ b/drivers-api/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -23,13 +23,13 @@
io.nosqlbenchnb-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchvirtdata-userlibs
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/engine-api/pom.xml b/engine-api/pom.xml
index 23fe9bfbf..dd67637cb 100644
--- a/engine-api/pom.xml
+++ b/engine-api/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -23,25 +23,25 @@
io.nosqlbenchnb-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdrivers-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchnb-annotations
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchvirtdata-userlibs
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/engine-cli/pom.xml b/engine-cli/pom.xml
index 1a0fc0fa6..efc5314c5 100644
--- a/engine-cli/pom.xml
+++ b/engine-cli/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -23,13 +23,13 @@
io.nosqlbenchengine-core
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchengine-docker
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/engine-clients/pom.xml b/engine-clients/pom.xml
index 32aad946d..0c0dc49c3 100644
--- a/engine-clients/pom.xml
+++ b/engine-clients/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -21,7 +21,7 @@
io.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/engine-core/pom.xml b/engine-core/pom.xml
index 365e9d745..67bc4df8e 100644
--- a/engine-core/pom.xml
+++ b/engine-core/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -28,13 +28,13 @@
io.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdrivers-api
- 3.12.155
+ 3.12.156-SNAPSHOT
@@ -90,7 +90,7 @@
io.nosqlbenchengine-clients
- 3.12.155
+ 3.12.156-SNAPSHOTcompile
diff --git a/engine-docker/pom.xml b/engine-docker/pom.xml
index 969dc47ef..4e3368a67 100644
--- a/engine-docker/pom.xml
+++ b/engine-docker/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -65,7 +65,7 @@
io.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/engine-docs/pom.xml b/engine-docs/pom.xml
index e1eb3e31b..3571c7aff 100644
--- a/engine-docs/pom.xml
+++ b/engine-docs/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -28,7 +28,7 @@
io.nosqlbenchdocsys
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/engine-extensions/pom.xml b/engine-extensions/pom.xml
index 714ffca56..a4eef4090 100644
--- a/engine-extensions/pom.xml
+++ b/engine-extensions/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -22,7 +22,7 @@
io.nosqlbenchengine-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/engine-rest/pom.xml b/engine-rest/pom.xml
index d8495afda..446e932a7 100644
--- a/engine-rest/pom.xml
+++ b/engine-rest/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -47,7 +47,7 @@
io.nosqlbenchengine-cli
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/mvn-defaults/pom.xml b/mvn-defaults/pom.xml
index 0aa94449e..5f5fd76bf 100644
--- a/mvn-defaults/pom.xml
+++ b/mvn-defaults/pom.xml
@@ -3,7 +3,7 @@
io.nosqlbenchmvn-defaults
- 3.12.155
+ 3.12.156-SNAPSHOTpom
@@ -95,7 +95,7 @@
scm:git:https://github.com/nosqlbench/nosqlbench.git
- nosqlbench-3.12.155
+ HEAD
diff --git a/nb-annotations/pom.xml b/nb-annotations/pom.xml
index ee56907aa..8a655563b 100644
--- a/nb-annotations/pom.xml
+++ b/nb-annotations/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
diff --git a/nb-api/pom.xml b/nb-api/pom.xml
index 82f628576..6daf0666b 100644
--- a/nb-api/pom.xml
+++ b/nb-api/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -31,7 +31,7 @@
io.nosqlbenchnb-annotations
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/nb/pom.xml b/nb/pom.xml
index f905b3ec1..54837d431 100644
--- a/nb/pom.xml
+++ b/nb/pom.xml
@@ -5,7 +5,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -24,31 +24,31 @@
io.nosqlbenchengine-rest
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchengine-cli
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchengine-docs
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchengine-core
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchengine-extensions
- 3.12.155
+ 3.12.156-SNAPSHOT
@@ -60,67 +60,67 @@
io.nosqlbenchdriver-web
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdriver-kafka
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdriver-stdout
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdriver-diag
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdriver-tcp
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdriver-http
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdriver-jmx
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdriver-dsegraph-shaded
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdriver-cql-shaded
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdriver-cqlverify
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchdriver-mongodb
- 3.12.155
+ 3.12.156-SNAPSHOT
@@ -259,7 +259,7 @@
io.nosqlbenchdriver-mongodb
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/pom.xml b/pom.xml
index 5db1a1559..42c461ecf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOTmvn-defaults
@@ -145,7 +145,7 @@
scm:git:https://github.com/nosqlbench/nosqlbench.git
scm:git:git@github.com:nosqlbench/nosqlbench.git
- nosqlbench-3.12.155
+ HEAD
diff --git a/virtdata-api/pom.xml b/virtdata-api/pom.xml
index b1e41362f..f7e15ce94 100644
--- a/virtdata-api/pom.xml
+++ b/virtdata-api/pom.xml
@@ -7,7 +7,7 @@
io.nosqlbenchmvn-defaults
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -23,14 +23,14 @@
io.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOTnb-apiio.nosqlbenchvirtdata-lang
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/virtdata-lang/pom.xml b/virtdata-lang/pom.xml
index 10131c033..d883e3ac0 100644
--- a/virtdata-lang/pom.xml
+++ b/virtdata-lang/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
diff --git a/virtdata-lib-basics/pom.xml b/virtdata-lib-basics/pom.xml
index c461c77d7..5e5974d36 100644
--- a/virtdata-lib-basics/pom.xml
+++ b/virtdata-lib-basics/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -20,7 +20,7 @@
io.nosqlbenchvirtdata-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/virtdata-lib-curves4/pom.xml b/virtdata-lib-curves4/pom.xml
index a7082c086..c88224403 100644
--- a/virtdata-lib-curves4/pom.xml
+++ b/virtdata-lib-curves4/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -22,13 +22,13 @@
io.nosqlbenchvirtdata-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchvirtdata-lib-basics
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/virtdata-lib-random/pom.xml b/virtdata-lib-random/pom.xml
index 5933d678f..a259d6b73 100644
--- a/virtdata-lib-random/pom.xml
+++ b/virtdata-lib-random/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -20,13 +20,13 @@
io.nosqlbenchvirtdata-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchvirtdata-lib-basics
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/virtdata-lib-realer/pom.xml b/virtdata-lib-realer/pom.xml
index 4e9444f6f..41121ee38 100644
--- a/virtdata-lib-realer/pom.xml
+++ b/virtdata-lib-realer/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -20,7 +20,7 @@
io.nosqlbenchvirtdata-lib-basics
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/virtdata-realdata/pom.xml b/virtdata-realdata/pom.xml
index 2ac839bd4..14cc88ca8 100644
--- a/virtdata-realdata/pom.xml
+++ b/virtdata-realdata/pom.xml
@@ -7,7 +7,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -18,7 +18,7 @@
io.nosqlbenchvirtdata-api
- 3.12.155
+ 3.12.156-SNAPSHOT
diff --git a/virtdata-userlibs/pom.xml b/virtdata-userlibs/pom.xml
index 1ee5422e4..3ee4b0b8d 100644
--- a/virtdata-userlibs/pom.xml
+++ b/virtdata-userlibs/pom.xml
@@ -4,7 +4,7 @@
mvn-defaultsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOT../mvn-defaults
@@ -18,36 +18,36 @@
io.nosqlbenchvirtdata-realdata
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchvirtdata-lib-realer
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchvirtdata-api
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbenchvirtdata-lib-random
- 3.12.155
+ 3.12.156-SNAPSHOTio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOTvirtdata-lib-basicsio.nosqlbench
- 3.12.155
+ 3.12.156-SNAPSHOTvirtdata-lib-curves4
@@ -55,7 +55,7 @@
io.nosqlbenchdocsys
- 3.12.155
+ 3.12.156-SNAPSHOT
From 93e10e6a70275edfa2e6bc413a10cb763533207a Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 16:29:40 -0600
Subject: [PATCH 014/164] config model improvements
---
.../nosqlbench/nb/api/config/ConfigAware.java | 3 +-
.../nb/api/config/ConfigElement.java | 59 +++++++++++++++++++
.../nb/api/config/ConfigReader.java | 40 +++++++++++++
3 files changed, 101 insertions(+), 1 deletion(-)
create mode 100644 nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigElement.java
create mode 100644 nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigReader.java
diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigAware.java b/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigAware.java
index de040a6fe..2ec877dd4 100644
--- a/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigAware.java
+++ b/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigAware.java
@@ -3,6 +3,7 @@ package io.nosqlbench.nb.api.config;
import java.util.Map;
public interface ConfigAware {
- void applyConfig(Map element);
+ void applyConfig(Map providedConfig);
+
ConfigModel getConfigModel();
}
diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigElement.java b/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigElement.java
new file mode 100644
index 000000000..b8f1bfaa4
--- /dev/null
+++ b/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigElement.java
@@ -0,0 +1,59 @@
+package io.nosqlbench.nb.api.config;
+
+public class ConfigElement {
+
+ public final String name;
+ public final Class extends T> type;
+ public final String description;
+ private final T defaultValue;
+ public boolean required;
+
+ public ConfigElement(
+ String name,
+ Class extends T> type,
+ String description,
+ boolean required,
+ T defaultValue
+ ) {
+ this.name = name;
+ this.type = type;
+ this.description = description;
+ this.required = required;
+ this.defaultValue = defaultValue;
+ }
+
+ @Override
+ public String toString() {
+ return "Element{" +
+ "name='" + name + '\'' +
+ ", type=" + type +
+ ", description='" + description + '\'' +
+ ", required=" + required +
+ ", defaultValue = " + defaultValue +
+ '}';
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Class> getType() {
+ return type;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public boolean isRequired() {
+ return required;
+ }
+
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+
+ public T getDefaultValue() {
+ return defaultValue;
+ }
+}
diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigReader.java b/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigReader.java
new file mode 100644
index 000000000..5457fa8d4
--- /dev/null
+++ b/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigReader.java
@@ -0,0 +1,40 @@
+package io.nosqlbench.nb.api.config;
+
+import io.nosqlbench.nb.api.Environment;
+
+import java.util.LinkedHashMap;
+import java.util.Optional;
+
+public class ConfigReader extends LinkedHashMap {
+ private final ConfigModel configModel;
+
+ public ConfigReader(ConfigModel model, LinkedHashMap validConfig) {
+ super(validConfig);
+ this.configModel = model;
+ }
+
+ public T paramEnv(String name, Class extends T> vclass) {
+ T param = param(name, vclass);
+ if (param instanceof String) {
+ Optional interpolated = Environment.INSTANCE.interpolate(param.toString());
+ if (interpolated.isEmpty()) {
+ throw new RuntimeException("Unable to interpolate env and sys props in '" + param + "'");
+ }
+ return (T) interpolated.get();
+ } else {
+ return param;
+ }
+
+ }
+
+ public T param(String name, Class extends T> vclass) {
+ Object o = get(name);
+ ConfigElement> elem = configModel.getElements().get(name);
+ if (elem == null) {
+ throw new RuntimeException("Invalid config element named '" + name + "'");
+ }
+ Class type = (Class) elem.getType();
+ T typeCastedValue = type.cast(o);
+ return typeCastedValue;
+ }
+}
From 55edec5389c5102c00e5346b3bc9466d2d330247 Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 16:32:21 -0600
Subject: [PATCH 015/164] add ToByteBuffer binding function
---
.../conversions/from_long/ToByteBuffer.java | 22 ++++++++++--
.../from_long/ToByteBufferTest.java | 35 +++++++++++++++++++
2 files changed, 55 insertions(+), 2 deletions(-)
create mode 100644 virtdata-lib-basics/src/test/java/io/nosqlbench/virtdata/library/basics/shared/conversions/from_long/ToByteBufferTest.java
diff --git a/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/conversions/from_long/ToByteBuffer.java b/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/conversions/from_long/ToByteBuffer.java
index 307782c84..0fad52b1e 100644
--- a/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/conversions/from_long/ToByteBuffer.java
+++ b/virtdata-lib-basics/src/main/java/io/nosqlbench/virtdata/library/basics/shared/conversions/from_long/ToByteBuffer.java
@@ -20,6 +20,7 @@ package io.nosqlbench.virtdata.library.basics.shared.conversions.from_long;
import io.nosqlbench.virtdata.api.annotations.Categories;
import io.nosqlbench.virtdata.api.annotations.Category;
+import io.nosqlbench.virtdata.api.annotations.Example;
import io.nosqlbench.virtdata.api.annotations.ThreadSafeMapper;
import java.nio.ByteBuffer;
@@ -32,10 +33,27 @@ import java.util.function.LongFunction;
@Categories({Category.conversion})
public class ToByteBuffer implements LongFunction {
+ private final int allocSize;
+ private final int bufSize;
+
+ public ToByteBuffer() {
+ this.allocSize = Long.BYTES;
+ this.bufSize = Long.BYTES;
+ }
+
+ @Example({"ToByteBuffer(13)", "Repeat the input long value to make a 13byte buffer"})
+ public ToByteBuffer(int size) {
+ this.bufSize = size;
+ this.allocSize = ((size + Long.BYTES - 1) / Long.BYTES) * Long.BYTES;
+ }
+
@Override
public ByteBuffer apply(long input) {
- ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES);
- buffer.putLong(input);
+ ByteBuffer buffer = ByteBuffer.allocate(allocSize);
+ while (buffer.remaining() >= Long.BYTES) {
+ buffer.putLong(input);
+ }
+ buffer.position(this.bufSize);
buffer.flip();
return buffer;
}
diff --git a/virtdata-lib-basics/src/test/java/io/nosqlbench/virtdata/library/basics/shared/conversions/from_long/ToByteBufferTest.java b/virtdata-lib-basics/src/test/java/io/nosqlbench/virtdata/library/basics/shared/conversions/from_long/ToByteBufferTest.java
new file mode 100644
index 000000000..3f7ac17b1
--- /dev/null
+++ b/virtdata-lib-basics/src/test/java/io/nosqlbench/virtdata/library/basics/shared/conversions/from_long/ToByteBufferTest.java
@@ -0,0 +1,35 @@
+package io.nosqlbench.virtdata.library.basics.shared.conversions.from_long;
+
+import org.junit.Test;
+
+import java.nio.ByteBuffer;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class ToByteBufferTest {
+
+ @Test
+ public void toByteBuffer7() {
+ ToByteBuffer f = new ToByteBuffer(7);
+ ByteBuffer byteBuffer = f.apply(33);
+ ByteBuffer expected = ByteBuffer.wrap(new byte[]{0, 0, 0, 0, 0, 0, 0});
+ assertThat(byteBuffer).isEqualByComparingTo(expected);
+ }
+
+ @Test
+ public void toByteBuffer8() {
+ ToByteBuffer f = new ToByteBuffer(8);
+ ByteBuffer byteBuffer = f.apply(33);
+ ByteBuffer expected = ByteBuffer.wrap(new byte[]{0, 0, 0, 0, 0, 0, 0, 33});
+ assertThat(byteBuffer).isEqualByComparingTo(expected);
+ }
+
+ @Test
+ public void toByteBuffer9() {
+ ToByteBuffer f = new ToByteBuffer(9);
+ ByteBuffer byteBuffer = f.apply(33);
+ ByteBuffer expected = ByteBuffer.wrap(new byte[]{0, 0, 0, 0, 0, 0, 0, 33, 0});
+ assertThat(byteBuffer).isEqualByComparingTo(expected);
+ }
+
+}
\ No newline at end of file
From 4d65dc625f5d292df197f9b8f0b74f8a9ceea823 Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 17:22:01 -0600
Subject: [PATCH 016/164] update inactive coords
---
driver-cqld4/pom.xml | 6 +-
nb/pom.xml | 168 +++++++++++++++++++++----------------------
2 files changed, 87 insertions(+), 87 deletions(-)
diff --git a/driver-cqld4/pom.xml b/driver-cqld4/pom.xml
index d8216bd72..f6b1252f5 100644
--- a/driver-cqld4/pom.xml
+++ b/driver-cqld4/pom.xml
@@ -4,7 +4,7 @@
io.nosqlbenchmvn-defaults
- 3.12.141-SNAPSHOT
+ 3.12.155-SNAPSHOT../mvn-defaults
@@ -23,13 +23,13 @@
io.nosqlbenchengine-api
- 3.12.141-SNAPSHOT
+ 3.12.155-SNAPSHOTio.nosqlbenchdrivers-api
- 3.12.146-SNAPSHOT
+ 3.12.155-SNAPSHOT
diff --git a/nb/pom.xml b/nb/pom.xml
index 18a60f899..d71d03574 100644
--- a/nb/pom.xml
+++ b/nb/pom.xml
@@ -230,90 +230,90 @@
-
-
- with-cql-d4
-
- false
-
-
-
- io.nosqlbench
- driver-cqld4
- 3.12.141-SNAPSHOT
-
-
-
-
- with-mongodb
-
- true
-
-
-
- io.nosqlbench
- driver-mongodb
- 3.12.155-SNAPSHOT
-
-
-
-
- build-nb-appimage
-
-
- unix
- linux
- amd64
-
-
-
-
-
- org.codehaus.mojo
- exec-maven-plugin
-
-
- build-nb-appimage
- package
-
- exec
-
-
- ${project.basedir}
- ${project.basedir}/build-bin.sh
-
-
-
-
-
-
-
-
- enforce
-
- false
-
-
-
-
-
-
-
- enforce
-
-
-
- org.apache.maven.plugins
- maven-enforcer-plugin
-
-
-
-
-
-
-
-
-
+
+
+ with-cql-d4
+
+ false
+
+
+
+ io.nosqlbench
+ driver-cqld4
+ 3.12.155-SNAPSHOT
+
+
+
+
+ with-mongodb
+
+ true
+
+
+
+ io.nosqlbench
+ driver-mongodb
+ 3.12.155-SNAPSHOT
+
+
+
+
+ build-nb-appimage
+
+
+ unix
+ linux
+ amd64
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+
+ build-nb-appimage
+ package
+
+ exec
+
+
+ ${project.basedir}
+ ${project.basedir}/build-bin.sh
+
+
+
+
+
+
+
+
+ enforce
+
+ false
+
+
+
+
+
+
+
+ enforce
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+
+
+
+
+
+
+
+
+
From 52b029f8b8bdd5ba73458a2954b872493b86d22b Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 17:22:12 -0600
Subject: [PATCH 017/164] typos, culling, and alignment
---
devdocs/docstructure/bundled_docs.md | 3 +-
.../nosqlbench/docsys/core/DocServerApp.java | 15 ------
.../nosqlbench/engine/cli/NBCLIOptions.java | 2 +-
.../engine/core/script/BufferAppender.java | 49 -------------------
.../docs/NosqlbenchMarkdownManifest.java | 7 +--
.../script/AsyncScriptIntegrationTests.java | 1 +
6 files changed, 8 insertions(+), 69 deletions(-)
delete mode 100644 engine-core/src/main/java/io/nosqlbench/engine/core/script/BufferAppender.java
diff --git a/devdocs/docstructure/bundled_docs.md b/devdocs/docstructure/bundled_docs.md
index 8291e64fa..bc08c9434 100644
--- a/devdocs/docstructure/bundled_docs.md
+++ b/devdocs/docstructure/bundled_docs.md
@@ -9,7 +9,8 @@ can be used by the documentation system.
## MarkdownDocs Service
-The primary markdown service that is meant to be consumed by the documetnation system is known simply as
+The primary markdown service that is meant to be consumed by the
+ documentation system is known simply as
MarkdownDocs
diff --git a/docsys/src/main/java/io/nosqlbench/docsys/core/DocServerApp.java b/docsys/src/main/java/io/nosqlbench/docsys/core/DocServerApp.java
index e99c836ff..e93da3b3e 100644
--- a/docsys/src/main/java/io/nosqlbench/docsys/core/DocServerApp.java
+++ b/docsys/src/main/java/io/nosqlbench/docsys/core/DocServerApp.java
@@ -14,21 +14,6 @@ import java.util.Arrays;
public class DocServerApp {
private static final Logger logger = LogManager.getLogger(DocServerApp.class);
-// static {
-// // defer to an extant logger context if it is there, otherwise
-// // assume a local and docserver specific logging configuration
-//
-// LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
-// if (context.getLoggerList().size() == 1 && context.getLoggerList().get(0).getName().equals("ROOT")) {
-// configureDocServerLogging(context);
-// logger = LoggerFactory.getLogger(DocServerApp.class);
-// logger.info("Configured logging system from logback-docsys.xml");
-// } else {
-// logger = LoggerFactory.getLogger(DocServerApp.class);
-// logger.info("Configured logging within existing logging context.");
-// }
-// }
-
public static void main(String[] args) {
if (args.length > 0 && args[0].contains("help")) {
showHelp();
diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
index fe0398152..807377d0a 100644
--- a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
+++ b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
@@ -624,7 +624,7 @@ public class NBCLIOptions {
private String readWordOrThrow(LinkedList arglist, String required) {
if (arglist.peekFirst() == null) {
- throw new InvalidParameterException(required + " not found");
+ throw new InvalidParameterException(required + " is required after this option");
}
return arglist.removeFirst();
}
diff --git a/engine-core/src/main/java/io/nosqlbench/engine/core/script/BufferAppender.java b/engine-core/src/main/java/io/nosqlbench/engine/core/script/BufferAppender.java
deleted file mode 100644
index 2391df249..000000000
--- a/engine-core/src/main/java/io/nosqlbench/engine/core/script/BufferAppender.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright 2016 jshook
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * /
- */
-
-package io.nosqlbench.engine.core.script;
-
-import ch.qos.logback.core.OutputStreamAppender;
-
-import java.io.CharArrayWriter;
-
-public class BufferAppender extends OutputStreamAppender {
-
- private CharArrayWriter buffer = new CharArrayWriter(0);
-
- @Override
- public void start() {
- buffer = new CharArrayWriter(0);
- super.start();
- }
-
- @Override
- public void stop() {
- super.stop();
- buffer.reset();
- }
-
- @Override
- protected void append(E eventObject) {
- super.append(eventObject);
- buffer.append(eventObject.toString());
- }
-
- public String toString() {
- return (buffer==null) ? "" : buffer.toString();
- }
-}
diff --git a/engine-docs/src/main/java/io/nosqlbench/engine/docs/NosqlbenchMarkdownManifest.java b/engine-docs/src/main/java/io/nosqlbench/engine/docs/NosqlbenchMarkdownManifest.java
index f170de708..9bd03fcea 100644
--- a/engine-docs/src/main/java/io/nosqlbench/engine/docs/NosqlbenchMarkdownManifest.java
+++ b/engine-docs/src/main/java/io/nosqlbench/engine/docs/NosqlbenchMarkdownManifest.java
@@ -10,9 +10,10 @@ public class NosqlbenchMarkdownManifest implements DocsysDynamicManifest {
@Override
public DocsBinder getDocs() {
return new Docs().namespace("docs-for-eb")
- .addFirstFoundPath("engine-docs/src/main/resources/docs-for-nb/",
- "docs-for-nb/")
- .setEnabledByDefault(true)
+ .addFirstFoundPath(
+ "engine-docs/src/main/resources/docs-for-nb/",
+ "docs-for-nb/"
+ ).setEnabledByDefault(true)
.asDocsBinder();
}
}
diff --git a/nb/src/test/java/io/nosqlbench/engine/core/script/AsyncScriptIntegrationTests.java b/nb/src/test/java/io/nosqlbench/engine/core/script/AsyncScriptIntegrationTests.java
index ba80381fb..d0d734a1e 100644
--- a/nb/src/test/java/io/nosqlbench/engine/core/script/AsyncScriptIntegrationTests.java
+++ b/nb/src/test/java/io/nosqlbench/engine/core/script/AsyncScriptIntegrationTests.java
@@ -29,6 +29,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
+import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
From e6e70f713f4ce8b0957ad8203fe0f2b7e241655c Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 17:22:20 -0600
Subject: [PATCH 018/164] support DoubleToIntFunction in function matrix
---
.../io/nosqlbench/virtdata/api/bindings/VirtDataFunctions.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/virtdata-api/src/main/java/io/nosqlbench/virtdata/api/bindings/VirtDataFunctions.java b/virtdata-api/src/main/java/io/nosqlbench/virtdata/api/bindings/VirtDataFunctions.java
index e1b07eb6e..c6dedba74 100644
--- a/virtdata-api/src/main/java/io/nosqlbench/virtdata/api/bindings/VirtDataFunctions.java
+++ b/virtdata-api/src/main/java/io/nosqlbench/virtdata/api/bindings/VirtDataFunctions.java
@@ -18,6 +18,7 @@ public class VirtDataFunctions {
LongUnaryOperator(java.util.function.LongUnaryOperator.class, long.class),
IntFunction(java.util.function.IntFunction.class, int.class),
IntUnaryOperator(java.util.function.IntUnaryOperator.class, int.class),
+ DoubleToIntFunction(java.util.function.DoubleToIntFunction.class, int.class),
DoubleFunction(java.util.function.DoubleFunction.class, double.class),
DoubleUnaryOperator(java.util.function.DoubleUnaryOperator.class, double.class),
Function(java.util.function.Function.class, Object.class);
From 089a29d8466d7462b48063d28105b20db61d5a1e Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 17:22:35 -0600
Subject: [PATCH 019/164] grafana api tokens
---
.../engine/clients/grafana/ApiToken.java | 35 ++++++++++++++++++
.../grafana/transfer/ApiTokenRequest.java | 36 +++++++++++++++++++
2 files changed, 71 insertions(+)
create mode 100644 engine-clients/src/main/java/io/nosqlbench/engine/clients/grafana/ApiToken.java
create mode 100644 engine-clients/src/main/java/io/nosqlbench/engine/clients/grafana/transfer/ApiTokenRequest.java
diff --git a/engine-clients/src/main/java/io/nosqlbench/engine/clients/grafana/ApiToken.java b/engine-clients/src/main/java/io/nosqlbench/engine/clients/grafana/ApiToken.java
new file mode 100644
index 000000000..6b678c65f
--- /dev/null
+++ b/engine-clients/src/main/java/io/nosqlbench/engine/clients/grafana/ApiToken.java
@@ -0,0 +1,35 @@
+package io.nosqlbench.engine.clients.grafana;
+
+public class ApiToken {
+ private String name;
+ private String key;
+
+ public ApiToken(String name, String key) {
+ this.name = name;
+ this.key = key;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ @Override
+ public String toString() {
+ return "ApiToken{" +
+ "name='" + name + '\'' +
+ ", key='" + key + '\'' +
+ '}';
+ }
+}
diff --git a/engine-clients/src/main/java/io/nosqlbench/engine/clients/grafana/transfer/ApiTokenRequest.java b/engine-clients/src/main/java/io/nosqlbench/engine/clients/grafana/transfer/ApiTokenRequest.java
new file mode 100644
index 000000000..9e1a5eb49
--- /dev/null
+++ b/engine-clients/src/main/java/io/nosqlbench/engine/clients/grafana/transfer/ApiTokenRequest.java
@@ -0,0 +1,36 @@
+package io.nosqlbench.engine.clients.grafana.transfer;
+
+import java.util.Set;
+
+public class ApiTokenRequest {
+
+ public static final Set VALID_ROLES = Set.of("Admin", "Editor", "Viewer");
+ private final String name;
+ private final String role;
+ private final long ttl;
+
+ public ApiTokenRequest(String name, String role, long ttl) {
+ this.name = name;
+ this.role = checkRole(role);
+ this.ttl = ttl;
+ }
+
+ private String checkRole(String role) {
+ if (!VALID_ROLES.contains(role)) {
+ throw new RuntimeException("Role '" + role + "' must be one of " + VALID_ROLES.toString());
+ }
+ return role;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getRole() {
+ return role;
+ }
+
+ public long getTtl() {
+ return ttl;
+ }
+}
From 831361394313a90b4e6e2e6f91eb81e56ae8cd1f Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 17:22:43 -0600
Subject: [PATCH 020/164] generalize op source
---
.../api/activityapi/planning/OpSequence.java | 13 ++-------
.../api/activityapi/planning/OpSource.java | 27 +++++++++++++++++++
2 files changed, 29 insertions(+), 11 deletions(-)
create mode 100644 engine-api/src/main/java/io/nosqlbench/engine/api/activityapi/planning/OpSource.java
diff --git a/engine-api/src/main/java/io/nosqlbench/engine/api/activityapi/planning/OpSequence.java b/engine-api/src/main/java/io/nosqlbench/engine/api/activityapi/planning/OpSequence.java
index 608987dde..4b70099c0 100644
--- a/engine-api/src/main/java/io/nosqlbench/engine/api/activityapi/planning/OpSequence.java
+++ b/engine-api/src/main/java/io/nosqlbench/engine/api/activityapi/planning/OpSequence.java
@@ -23,19 +23,10 @@ import java.util.function.Function;
/**
* An OpSequence provides fast access to a set of operations in a specific
* order.
+ *
* @param The type of element which is to be sequenced
*/
-public interface OpSequence {
-
- /**
- * Get the next operation for the given long value. This is simply
- * the offset indicated by the offset sequence array at a modulo
- * position.
- *
- * @param selector the long value that determines the next op
- * @return An op of type T
- */
- T get(long selector);
+public interface OpSequence extends OpSource {
/**
* Get the list of individual operations which could be returned by {@link #get(long)}.
diff --git a/engine-api/src/main/java/io/nosqlbench/engine/api/activityapi/planning/OpSource.java b/engine-api/src/main/java/io/nosqlbench/engine/api/activityapi/planning/OpSource.java
new file mode 100644
index 000000000..20a55326a
--- /dev/null
+++ b/engine-api/src/main/java/io/nosqlbench/engine/api/activityapi/planning/OpSource.java
@@ -0,0 +1,27 @@
+package io.nosqlbench.engine.api.activityapi.planning;
+
+import java.util.function.LongFunction;
+
+/**
+ * An OpSource provides an Op when given an ordinal.
+ * OpSources are expected to be deterministic with respect to inputs.
+ *
+ * @param
+ */
+public interface OpSource extends LongFunction {
+
+ /**
+ * Get the next operation for the given long value. This is simply
+ * the offset indicated by the offset sequence array at a modulo
+ * position.
+ *
+ * @param selector the long value that determines the next op
+ * @return An op of type T
+ */
+ T get(long selector);
+
+ @Override
+ default T apply(long value) {
+ return get(value);
+ }
+}
From a3a513814e3d9f4eb7f21fa10fe5db5dc74d3276 Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 17:27:40 -0600
Subject: [PATCH 021/164] update inactive coords
---
nb/pom.xml | 400 ++++++++++++++++++++++++++---------------------------
1 file changed, 200 insertions(+), 200 deletions(-)
diff --git a/nb/pom.xml b/nb/pom.xml
index d71d03574..2d28f3325 100644
--- a/nb/pom.xml
+++ b/nb/pom.xml
@@ -1,234 +1,234 @@
-
- 4.0.0
+
+ 4.0.0
-
- mvn-defaults
- io.nosqlbench
- 3.12.155-SNAPSHOT
- ../mvn-defaults
-
+
+ mvn-defaults
+ io.nosqlbench
+ 3.12.155-SNAPSHOT
+ ../mvn-defaults
+
- nb
- jar
- ${project.artifactId}
- CLI for nosqlbench.
+ nb
+ jar
+ ${project.artifactId}
+ CLI for nosqlbench.
-
- UTF-8
- nosqlbench Command Line
-
+
+ UTF-8
+ nosqlbench Command Line
+
-
+
-
- io.nosqlbench
- engine-rest
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ engine-rest
+ 3.12.155-SNAPSHOT
+
-
- io.nosqlbench
- engine-cli
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ engine-cli
+ 3.12.155-SNAPSHOT
+
-
- io.nosqlbench
- engine-docs
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ engine-docs
+ 3.12.155-SNAPSHOT
+
-
- io.nosqlbench
- engine-core
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ engine-core
+ 3.12.155-SNAPSHOT
+
-
- io.nosqlbench
- engine-extensions
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ engine-extensions
+ 3.12.155-SNAPSHOT
+
-
-
-
-
-
+
+
+
+
+
-
- io.nosqlbench
- driver-web
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ driver-web
+ 3.12.155-SNAPSHOT
+
-
- io.nosqlbench
- driver-kafka
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ driver-kafka
+ 3.12.155-SNAPSHOT
+
-
- io.nosqlbench
- driver-stdout
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ driver-stdout
+ 3.12.155-SNAPSHOT
+
-
- io.nosqlbench
- driver-diag
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ driver-diag
+ 3.12.155-SNAPSHOT
+
-
- io.nosqlbench
- driver-tcp
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ driver-tcp
+ 3.12.155-SNAPSHOT
+
-
- io.nosqlbench
- driver-http
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ driver-http
+ 3.12.155-SNAPSHOT
+
-
- io.nosqlbench
- driver-jmx
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ driver-jmx
+ 3.12.155-SNAPSHOT
+
-
- io.nosqlbench
- driver-cql-shaded
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ driver-cql-shaded
+ 3.12.155-SNAPSHOT
+
-
- io.nosqlbench
- driver-cqlverify
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ driver-cqlverify
+ 3.12.155-SNAPSHOT
+
-
- io.nosqlbench
- driver-mongodb
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ driver-mongodb
+ 3.12.155-SNAPSHOT
+
-
-
-
-
-
+
+
+
+
+
-
- ch.qos.logback
- logback-classic
-
+
+ javax.activation
+ activation
+
-
- javax.activation
- activation
-
+
+ javax.xml.bind
+ jaxb-api
+
-
- javax.xml.bind
- jaxb-api
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
-
+
+
+
+ src/main/resources
+ true
+
+
-
-
-
- src/main/resources
- true
-
-
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 3.3.0
+
+
+ assembly.xml
+
+
+
+ io.nosqlbench.engine.cli.NBCLI
+
+
+ true
+
+
+
+
+
+ assemble-nb
+ package
+
+ single
+
+
+
+
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
- 3.3.0
-
-
- assembly.xml
-
-
-
- io.nosqlbench.engine.cli.NBCLI
-
-
-
-
-
- assemble-nb
- package
-
- single
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+
+ link-nb-jar-name
+ package
+
+ exec
+
+
+
+ ${project.version}
+
+ ${project.basedir}
+ ${project.basedir}/nb-scripts/link-jar-name.sh
+
+
+
+ build-static-guidebook
+ package
+
+ exec
+
+
+ ${project.basedir}
+ ${project.basedir}/gendocs.sh
+
+
+
+
-
- org.codehaus.mojo
- exec-maven-plugin
-
-
- link-nb-jar-name
- package
-
- exec
-
-
-
- ${project.version}
-
- ${project.basedir}
- ${project.basedir}/nb-scripts/link-jar-name.sh
-
-
-
- build-static-guidebook
- package
-
- exec
-
-
- ${project.basedir}
- ${project.basedir}/gendocs.sh
-
-
-
-
-
-
-
+
+
@@ -316,7 +316,7 @@
-
+
From 2c09b8ae7ae4a64b1bade9606d7afdcdb53c315e Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 17:27:48 -0600
Subject: [PATCH 022/164] typos, culling, and alignment
---
.../nosqlbench/engine/cli/ConsoleLogging.java | 75 -------------------
1 file changed, 75 deletions(-)
delete mode 100644 engine-cli/src/main/java/io/nosqlbench/engine/cli/ConsoleLogging.java
diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/ConsoleLogging.java b/engine-cli/src/main/java/io/nosqlbench/engine/cli/ConsoleLogging.java
deleted file mode 100644
index cfc7999d8..000000000
--- a/engine-cli/src/main/java/io/nosqlbench/engine/cli/ConsoleLogging.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- *
- * Copyright 2016 jshook
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * /
- */
-
-package io.nosqlbench.engine.cli;
-
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.Logger;
-import ch.qos.logback.classic.LoggerContext;
-import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
-import ch.qos.logback.classic.spi.ILoggingEvent;
-import ch.qos.logback.classic.spi.LoggingEvent;
-import ch.qos.logback.core.ConsoleAppender;
-import ch.qos.logback.core.filter.AbstractMatcherFilter;
-import ch.qos.logback.core.spi.FilterReply;
-import org.slf4j.LoggerFactory;
-
-public class ConsoleLogging {
-
- public static void enableConsoleLogging(Level level, String loggingPattern) {
-
- LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
- //List copyOfListenerList = loggerContext.getCopyOfListenerList();
-
- ConsoleAppender ca = new ConsoleAppender<>();
- ca.setContext(loggerContext);
-
- PatternLayoutEncoder ple = new PatternLayoutEncoder();
- ple.setPattern(loggingPattern);
- ple.setContext(loggerContext);
- ple.start();
- ca.setEncoder(ple);
- LevelFilter levelFilter = new LevelFilter<>(level);
- levelFilter.start();
- ca.addFilter(levelFilter);
- ca.start();
-
- Logger root = loggerContext.getLogger("ROOT");
- root.addAppender(ca);
- root.setLevel(Level.TRACE);
- }
-
- private static class LevelFilter extends AbstractMatcherFilter {
-
- private final Level filterLevel;
-
- public LevelFilter(Level filterLevel) {
- this.filterLevel = filterLevel;
- }
- @Override
- public FilterReply decide(Object event) {
- if (!isStarted()) {
- return FilterReply.NEUTRAL;
- }
- LoggingEvent loggingEvent = (LoggingEvent) event;
- if (((LoggingEvent) event).getLevel().isGreaterOrEqual(filterLevel)) {
- return FilterReply.ACCEPT;
- }
- return FilterReply.DENY;
- }
- }
-}
From a97db87f845aa77dfd987a5a99edba2e98f63318 Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 17:27:58 -0600
Subject: [PATCH 023/164] include JSON support in project API
---
nb-api/pom.xml | 39 +++++++++++--------
.../src/test/resources/importable-config.json | 6 +++
virtdata-userlibs/pom.xml | 5 ---
3 files changed, 28 insertions(+), 22 deletions(-)
create mode 100644 nb-api/src/test/resources/importable-config.json
diff --git a/nb-api/pom.xml b/nb-api/pom.xml
index 5a41f6031..f00001771 100644
--- a/nb-api/pom.xml
+++ b/nb-api/pom.xml
@@ -58,26 +58,31 @@
log4j-api
-
- org.apache.logging.log4j
- log4j-core
-
+
+ org.apache.logging.log4j
+ log4j-core
+
-
- net.sf.jopt-simple
- jopt-simple
- 5.0.3
-
+
+ net.sf.jopt-simple
+ jopt-simple
+ 5.0.3
+
-
+
+ com.google.code.gson
+ gson
+
-
- org.openjdk.jmh
- jmh-core
-
-
- org.openjdk.jmh
- jmh-generator-annprocess
+
+
+
+ org.openjdk.jmh
+ jmh-core
+
+
+ org.openjdk.jmh
+ jmh-generator-annprocess
diff --git a/nb-api/src/test/resources/importable-config.json b/nb-api/src/test/resources/importable-config.json
new file mode 100644
index 000000000..004d0f757
--- /dev/null
+++ b/nb-api/src/test/resources/importable-config.json
@@ -0,0 +1,6 @@
+{
+ "a": "B",
+ "b": "C",
+ "c": 123,
+ "d": 45.6
+}
\ No newline at end of file
diff --git a/virtdata-userlibs/pom.xml b/virtdata-userlibs/pom.xml
index fd434bd34..0142b6716 100644
--- a/virtdata-userlibs/pom.xml
+++ b/virtdata-userlibs/pom.xml
@@ -58,11 +58,6 @@
3.12.155-SNAPSHOT
-
- com.google.code.gson
- gson
-
-
From 897a8389c9797b999f85c63c069e76f1a29214c7 Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 17:28:10 -0600
Subject: [PATCH 024/164] generalize log level to NB
---
.../java/io/nosqlbench/engine/cli/NBCLI.java | 1 +
.../nosqlbench/engine/cli/NBCLIOptions.java | 29 ++++++-------
.../nosqlbench/nb/api/logging/NBLogLevel.java | 42 +++++++++++++++++++
3 files changed, 58 insertions(+), 14 deletions(-)
create mode 100644 nb-api/src/main/java/io/nosqlbench/nb/api/logging/NBLogLevel.java
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 db6f08530..34ee57d16 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
@@ -21,6 +21,7 @@ import io.nosqlbench.nb.api.annotation.Annotator;
import io.nosqlbench.nb.api.content.Content;
import io.nosqlbench.nb.api.content.NBIO;
import io.nosqlbench.nb.api.errors.BasicError;
+import io.nosqlbench.nb.api.logging.NBLogLevel;
import io.nosqlbench.nb.api.markdown.exporter.MarkdownExporter;
import io.nosqlbench.virtdata.userlibs.apps.VirtDataMainApp;
import org.slf4j.Logger;
diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
index 807377d0a..10bafb9c2 100644
--- a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
+++ b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIOptions.java
@@ -108,7 +108,7 @@ public class NBCLIOptions {
private String wantsMetricsForActivity;
private String sessionName = "";
private boolean showScript = false;
- private Level consoleLevel = Level.WARN;
+ private NBLogLevel consoleLevel = NBLogLevel.WARN;
private final List histoLoggerConfigs = new ArrayList<>();
private final List statsLoggerConfigs = new ArrayList<>();
private final List classicHistoConfigs = new ArrayList<>();
@@ -120,8 +120,8 @@ public class NBCLIOptions {
private String[] rleDumpOptions = new String[0];
private String[] cyclelogImportOptions = new String[0];
private String consoleLoggingPattern = DEFAULT_CONSOLE_LOGGING_PATTERN;
- private String logsLevel = "INFO";
- private Map logLevelsOverrides = new HashMap<>();
+ private NBLogLevel logsLevel = NBLogLevel.INFO;
+ private Map logLevelsOverrides = new HashMap<>();
private boolean enableChart = false;
private boolean dockerMetrics = false;
private boolean wantsScenariosList = false;
@@ -393,7 +393,8 @@ public class NBCLIOptions {
break;
case LOGS_LEVEL:
arglist.removeFirst();
- logsLevel = readWordOrThrow(arglist, "a log level");
+ String loglevel = readWordOrThrow(arglist, "a log level");
+ this.logsLevel = NBLogLevel.valueOfName(loglevel);
break;
case LOG_LEVEL_OVERRIDE:
arglist.removeFirst();
@@ -464,15 +465,15 @@ public class NBCLIOptions {
wantsMarkerTypes = true;
break;
case DASH_V_INFO:
- consoleLevel = Level.INFO;
+ consoleLevel = NBLogLevel.INFO;
arglist.removeFirst();
break;
case DASH_VV_DEBUG:
- consoleLevel = Level.DEBUG;
+ consoleLevel = NBLogLevel.DEBUG;
arglist.removeFirst();
break;
case DASH_VVV_TRACE:
- consoleLevel = Level.TRACE;
+ consoleLevel = NBLogLevel.TRACE;
arglist.removeFirst();
break;
case WITH_LOGGING_PATTERN:
@@ -508,14 +509,14 @@ public class NBCLIOptions {
return wantsToIncludePaths.toArray(new String[0]);
}
- private Map parseLogLevelOverrides(String levelsSpec) {
- Map levels = new HashMap<>();
+ private Map parseLogLevelOverrides(String levelsSpec) {
+ Map levels = new HashMap<>();
Arrays.stream(levelsSpec.split("[,;]")).forEach(kp -> {
String[] ll = kp.split(":");
if (ll.length != 2) {
throw new RuntimeException("Log level must have name:level format");
}
- levels.put(ll[0], Level.toLevel(ll[1]));
+ levels.put(ll[0], ll[1]);
});
return levels;
}
@@ -618,7 +619,7 @@ public class NBCLIOptions {
return sessionName;
}
- public Level wantsConsoleLogLevel() {
+ public NBLogLevel wantsConsoleLogLevel() {
return consoleLevel;
}
@@ -642,7 +643,7 @@ public class NBCLIOptions {
public String getProgressSpec() {
ProgressSpec spec = parseProgressSpec(this.progressSpec);// sanity check
if (spec.indicatorMode == IndicatorMode.console) {
- if (Level.INFO.isGreaterOrEqual(wantsConsoleLogLevel())) {
+ if (NBLogLevel.INFO.isGreaterOrEqualTo(wantsConsoleLogLevel())) {
logger.warn("Console is already logging info or more, so progress data on console is suppressed.");
spec.indicatorMode = IndicatorMode.logonly;
} else if (this.getCommands().stream().anyMatch(cmd -> cmd.getCmdType().equals(Cmd.CmdType.script))) {
@@ -677,7 +678,7 @@ public class NBCLIOptions {
return logsMax;
}
- public String getLogsLevel() {
+ public NBLogLevel getScenarioLogLevel() {
return logsLevel;
}
@@ -721,7 +722,7 @@ public class NBCLIOptions {
return consoleLoggingPattern;
}
- public Map getLogLevelOverrides() {
+ public Map getLogLevelOverrides() {
return logLevelsOverrides;
}
diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/logging/NBLogLevel.java b/nb-api/src/main/java/io/nosqlbench/nb/api/logging/NBLogLevel.java
new file mode 100644
index 000000000..a726a7dc1
--- /dev/null
+++ b/nb-api/src/main/java/io/nosqlbench/nb/api/logging/NBLogLevel.java
@@ -0,0 +1,42 @@
+package io.nosqlbench.nb.api.logging;
+
+public enum NBLogLevel {
+ NONE(0L),
+ FATAL(1L << 0),
+ ERROR(1L << 1),
+ WARN(1L << 2),
+ INFO(1L << 3),
+ DEBUG(1L << 4),
+ TRACE(1L << 5),
+ ALL(1L << 30),
+ ;
+
+ private final long level;
+
+ NBLogLevel(long level) {
+ this.level = level;
+ }
+
+ public static NBLogLevel valueOfName(String name) {
+ for (NBLogLevel possible : NBLogLevel.values()) {
+ if (name.toUpperCase().equals(possible.toString())) {
+ return possible;
+ }
+ }
+ throw new RuntimeException("Unable to find NBLogLevel for " + name);
+ }
+
+ public static NBLogLevel max(NBLogLevel... levels) {
+ NBLogLevel max = NBLogLevel.NONE;
+ for (NBLogLevel level : levels) {
+ if (level.level > max.level) {
+ max = level;
+ }
+ }
+ return max;
+ }
+
+ public boolean isGreaterOrEqualTo(NBLogLevel other) {
+ return level >= other.level;
+ }
+}
From e9d2b48985b7f3bb844c42eb479d51571b8f44be Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 17:28:19 -0600
Subject: [PATCH 025/164] environment API improvements
---
.../src/main/java/io/nosqlbench/nb/api}/Environment.java | 8 ++++----
.../test/java/io/nosqlbench/nb/api}/EnvironmentTest.java | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
rename {engine-cli/src/main/java/io/nosqlbench/engine/cli => nb-api/src/main/java/io/nosqlbench/nb/api}/Environment.java (97%)
rename {engine-cli/src/test/java/io/nosqlbench/engine/cli => nb-api/src/test/java/io/nosqlbench/nb/api}/EnvironmentTest.java (92%)
diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/Environment.java b/nb-api/src/main/java/io/nosqlbench/nb/api/Environment.java
similarity index 97%
rename from engine-cli/src/main/java/io/nosqlbench/engine/cli/Environment.java
rename to nb-api/src/main/java/io/nosqlbench/nb/api/Environment.java
index adf3da550..4d92c0c93 100644
--- a/engine-cli/src/main/java/io/nosqlbench/engine/cli/Environment.java
+++ b/nb-api/src/main/java/io/nosqlbench/nb/api/Environment.java
@@ -1,8 +1,8 @@
-package io.nosqlbench.engine.cli;
+package io.nosqlbench.nb.api;
import io.nosqlbench.nb.api.errors.BasicError;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.*;
import java.util.regex.Matcher;
@@ -36,7 +36,7 @@ import java.util.regex.Pattern;
* invalid in this API, except when provided as a default value.
*/
public class Environment {
- private final static Logger logger = LoggerFactory.getLogger(Environment.class);
+ private final static Logger logger = LogManager.getLogger("ENVIRONMENT");
// package private for testing
Environment() {
diff --git a/engine-cli/src/test/java/io/nosqlbench/engine/cli/EnvironmentTest.java b/nb-api/src/test/java/io/nosqlbench/nb/api/EnvironmentTest.java
similarity index 92%
rename from engine-cli/src/test/java/io/nosqlbench/engine/cli/EnvironmentTest.java
rename to nb-api/src/test/java/io/nosqlbench/nb/api/EnvironmentTest.java
index c65b069f1..55b99eaee 100644
--- a/engine-cli/src/test/java/io/nosqlbench/engine/cli/EnvironmentTest.java
+++ b/nb-api/src/test/java/io/nosqlbench/nb/api/EnvironmentTest.java
@@ -1,4 +1,4 @@
-package io.nosqlbench.engine.cli;
+package io.nosqlbench.nb.api;
import org.junit.Test;
From e0498ff29b71b9d5983f84e8472a72f260a3f06f Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 17:28:26 -0600
Subject: [PATCH 026/164] docs updates
---
engine-cli/src/main/resources/argsfile.md | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/engine-cli/src/main/resources/argsfile.md b/engine-cli/src/main/resources/argsfile.md
index 6dba1011c..7803a29b6 100644
--- a/engine-cli/src/main/resources/argsfile.md
+++ b/engine-cli/src/main/resources/argsfile.md
@@ -99,3 +99,9 @@ To simply set global defaults, you can run nosqlbench with a command
line like this:
./nb --pin --docker-metrics-at metricsnode --pin --annotate all
+
+# Compatibility
+
+You should use the --pin and --unpin options to make any changes to the
+ argsfile when integrating or automating workflows. This ensures that
+ any changes to file format are handled for you by nb.
\ No newline at end of file
From 4996d206c71dfd5cd8d62a97b4bc67fbab4b3242 Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 17:28:39 -0600
Subject: [PATCH 027/164] config API improvements
---
.../nb/api/config/ConfigLoader.java | 115 ++++++++++++++++++
.../nosqlbench/nb/api/config/ConfigModel.java | 16 +--
.../nb/api/config/MutableConfigModel.java | 110 +++++++++++++++--
.../nb/api/config/ConfigLoaderTest.java | 49 ++++++++
.../basics/shared/stateful/LoadElement.java | 8 +-
5 files changed, 273 insertions(+), 25 deletions(-)
create mode 100644 nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigLoader.java
create mode 100644 nb-api/src/test/java/io/nosqlbench/nb/api/config/ConfigLoaderTest.java
diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigLoader.java b/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigLoader.java
new file mode 100644
index 000000000..a4e693a58
--- /dev/null
+++ b/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigLoader.java
@@ -0,0 +1,115 @@
+package io.nosqlbench.nb.api.config;
+
+import com.google.gson.*;
+import io.nosqlbench.nb.api.content.NBIO;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+
+/**
+ *
The config loader is meant to be the way that configurations
+ * for objects or subsystems are loaded generically.
+ *
+ *
It supports value which are defined as JSON objects, lists
+ * of JSON objects, or as a fall-back simple parameter maps according to
+ * {@link ParamsParser} rules.
+ *
+ * If a block of config data begins with a '[' (open square bracket),
+ * it is taken as a JSON list of configs. If it starts with a '{' (open curly
+ * brace), it is taken as a single config. Otherwise it is taken as a simple
+ * set of named parameters using '=' as an assignment operator.
+ *
+ * An empty string represents the null value.
+ *
+ * Users of this interface should be prepared to receive a null, or a list
+ * of zero or more config elements of the requested type.
+ *
+ *
Importing configs
+ *
+ * Configs can be imported from local files, classpath resources, or URLs.
+ * This is supported with the form of
{@code IMPORT{URL}}
+ * where URL can be any form mentioned above. This syntax is obtuse and
+ * strange, but the point of this is to use something
+ * that should never occur in the wild, to avoid collisions with actual
+ * configuration content, but which is also clearly doing what it says.
+ */
+public class ConfigLoader {
+ private static final Gson gson = new GsonBuilder().setPrettyPrinting().create();
+ private final static Logger logger = LogManager.getLogger("CONFIG");
+
+ /**
+ * Load a string into an ordered map of objects, with the key being defined
+ * by an extractor function over the objects. Any duplicate keys are treated
+ * as an error. This is a useful method for loading configuration blocks
+ * which must be distinctly named.
+ *
+ * @param source The config data
+ * @param type The type of configuration object to be stored in the map values
+ * @param keyer The function that extracts the key
+ * @param The generic parameter for the type field
+ * @return A map of named configuration objects
+ */
+ public LinkedHashMap loadMap(
+ CharSequence source,
+ Class extends V> type,
+ Function keyer) {
+
+ LinkedHashMap mapOf = new LinkedHashMap<>();
+ List elems = load(source, type);
+
+ for (V elem : elems) {
+ String key = keyer.apply(elem);
+ if (mapOf.containsKey(key)) {
+ throw new RuntimeException("Duplicitous key mappings are disallowed here.");
+ }
+ mapOf.put(key, elem);
+ }
+ return mapOf;
+ }
+
+ public List load(CharSequence source, Class extends T> type) {
+ List cfgs = new ArrayList<>();
+
+ String data = source.toString();
+ data = data.trim();
+ if (data.isEmpty()) {
+ return null;
+ }
+
+ if (data.startsWith("IMPORT{") && data.endsWith("}")) {
+ String filename = data.substring("IMPORT{".length(), data.length() - 1);
+ Path filepath = Path.of(filename);
+
+ data = NBIO.all().name(filename).first()
+ .map(c -> {
+ logger.debug("found 'data' at " + c.getURI());
+ return c.asString();
+ }).orElseThrow();
+ }
+
+ if (data.startsWith("{") || data.startsWith("[")) {
+ JsonParser parser = new JsonParser();
+
+ JsonElement jsonElement = parser.parse(data);
+ if (jsonElement.isJsonArray()) {
+ JsonArray asJsonArray = jsonElement.getAsJsonArray();
+ for (JsonElement element : asJsonArray) {
+ T object = gson.fromJson(element, type);
+ cfgs.add(object);
+ }
+ } else if (jsonElement.isJsonObject()) {
+ cfgs.add(gson.fromJson(jsonElement, type));
+ }
+ } else if (Map.class.isAssignableFrom(type)) {
+ Map parsedMap = ParamsParser.parse(data, false);
+ cfgs.add(type.cast(parsedMap));
+ }
+ return cfgs;
+ }
+}
diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigModel.java b/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigModel.java
index 4a1eff0ce..0043275a9 100644
--- a/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigModel.java
+++ b/nb-api/src/main/java/io/nosqlbench/nb/api/config/ConfigModel.java
@@ -1,17 +1,13 @@
package io.nosqlbench.nb.api.config;
-import java.util.List;
+import java.util.Map;
public interface ConfigModel {
- List getElements();
+ Map getElements();
- class Element {
- public final String name;
- public final Class> type;
+ Class> getOf();
- public Element(String name, Class> type) {
- this.name = name;
- this.type = type;
- }
- }
+ void assertValidConfig(Map config);
+
+ ConfigReader apply(Map config);
}
diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/config/MutableConfigModel.java b/nb-api/src/main/java/io/nosqlbench/nb/api/config/MutableConfigModel.java
index 18790b595..16f3ed183 100644
--- a/nb-api/src/main/java/io/nosqlbench/nb/api/config/MutableConfigModel.java
+++ b/nb-api/src/main/java/io/nosqlbench/nb/api/config/MutableConfigModel.java
@@ -1,22 +1,52 @@
package io.nosqlbench.nb.api.config;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
public class MutableConfigModel implements ConfigModel {
- private final List elements = new ArrayList<>();
+ private final LinkedHashMap elements = new LinkedHashMap<>();
+ private final Class> ofType;
- public MutableConfigModel() {}
+ public MutableConfigModel(Class> ofType) {
+ this.ofType = ofType;
+ }
- public MutableConfigModel add(String name, Class> clazz) {
- add(new ConfigModel.Element(name, clazz));
+ public MutableConfigModel(Object ofObject) {
+ this.ofType = ofObject.getClass();
+ }
+
+ public MutableConfigModel optional(String name, Class> clazz) {
+ add(new ConfigElement(name, clazz, "", false, null));
return this;
}
- private void add(ConfigModel.Element element) {
- this.elements.add(element);
+ public MutableConfigModel optional(String name, Class> clazz, String description) {
+ add(new ConfigElement(name, clazz, description, false, null));
+ return this;
+ }
+
+ public MutableConfigModel required(String name, Class> clazz, String description) {
+ add(new ConfigElement(name, clazz, description, true, null));
+ return this;
+ }
+
+ public MutableConfigModel required(String name, Class> clazz) {
+ add(new ConfigElement(name, clazz, "", true, null));
+ return this;
+ }
+
+ public MutableConfigModel defaultto(String name, Object defaultValue) {
+ add(new ConfigElement(name, defaultValue.getClass(), "", true, defaultValue));
+ return this;
+ }
+
+ public MutableConfigModel defaultto(String name, Object defaultValue, String description) {
+ add(new ConfigElement(name, defaultValue.getClass(), description, true, defaultValue));
+ return this;
+ }
+
+ private void add(ConfigElement element) {
+ this.elements.put(element.name, element);
}
public ConfigModel asReadOnly() {
@@ -24,7 +54,65 @@ public class MutableConfigModel implements ConfigModel {
}
@Override
- public List getElements() {
- return Collections.unmodifiableList(elements);
+ public Map getElements() {
+ return Collections.unmodifiableMap(elements);
+ }
+
+ @Override
+ public Class> getOf() {
+ return ofType;
+ }
+
+ @Override
+ public void assertValidConfig(Map config) {
+ for (String configkey : config.keySet()) {
+ ConfigElement element = this.elements.get(configkey);
+ if (element == null) {
+ throw new RuntimeException(
+ "Unknown config parameter in config model '" + configkey + "'\n" +
+ "while configuring a " + getOf().getSimpleName());
+ }
+ Object value = config.get(configkey);
+ if (!element.getType().isAssignableFrom(value.getClass())) {
+ throw new RuntimeException("Unable to assign provided configuration\n" +
+ "of type '" + value.getClass().getSimpleName() + " to config\n" +
+ "parameter of type '" + element.getType().getSimpleName() + "'\n" +
+ "while configuring a " + getOf().getSimpleName());
+ }
+ }
+ for (ConfigElement element : elements.values()) {
+ if (element.isRequired() && element.getDefaultValue() == null) {
+ if (!config.containsKey(element.getName())) {
+ throw new RuntimeException("A required config element named '" + element.getName() +
+ "' and type '" + element.getType().getSimpleName() + "' was not found\n" +
+ "for configuring a " + getOf().getSimpleName());
+ }
+ }
+ }
+ }
+
+ @Override
+ public ConfigReader apply(Map config) {
+ assertValidConfig(config);
+ LinkedHashMap validConfig = new LinkedHashMap<>();
+
+ elements.forEach((k, v) -> {
+ String name = v.getName();
+ Class> type = v.getType();
+ Object cval = config.get(name);
+ if (cval == null && v.isRequired()) {
+ cval = v.getDefaultValue();
+ }
+ if (cval != null) {
+ if (type.isAssignableFrom(cval.getClass())) {
+ validConfig.put(name, cval);
+ } else {
+ throw new RuntimeException("Unable to assign a " + cval.getClass().getSimpleName() +
+ " to a " + type.getSimpleName());
+ }
+ }
+ });
+
+ return new ConfigReader(this.asReadOnly(), validConfig);
}
}
diff --git a/nb-api/src/test/java/io/nosqlbench/nb/api/config/ConfigLoaderTest.java b/nb-api/src/test/java/io/nosqlbench/nb/api/config/ConfigLoaderTest.java
new file mode 100644
index 000000000..9ad30c9d2
--- /dev/null
+++ b/nb-api/src/test/java/io/nosqlbench/nb/api/config/ConfigLoaderTest.java
@@ -0,0 +1,49 @@
+package io.nosqlbench.nb.api.config;
+
+import org.junit.Test;
+
+import java.util.List;
+import java.util.Map;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+
+public class ConfigLoaderTest {
+
+ @Test
+ public void testSingleParams() {
+ ConfigLoader cl = new ConfigLoader();
+ List
-
- org.slf4j
- slf4j-api
-
-
diff --git a/driver-kafka/pom.xml b/driver-kafka/pom.xml
index 63fe03ed0..d4d9d6bc6 100644
--- a/driver-kafka/pom.xml
+++ b/driver-kafka/pom.xml
@@ -43,21 +43,21 @@
io.nosqlbench
- engine-api
- 3.12.155-SNAPSHOT
+ engine-api
+ 3.12.155-SNAPSHOT
-
- io.nosqlbench
- driver-stdout
- 3.12.155-SNAPSHOT
-
+
+ io.nosqlbench
+ driver-stdout
+ 3.12.155-SNAPSHOT
+
-
- org.slf4j
- slf4j-api
- 1.7.25
-
+
+
+
+
+
diff --git a/engine-api/pom.xml b/engine-api/pom.xml
index cc264b70b..df0d69b2f 100644
--- a/engine-api/pom.xml
+++ b/engine-api/pom.xml
@@ -49,16 +49,6 @@
graal-sdk
-
- org.slf4j
- slf4j-api
-
-
-
- ch.qos.logback
- logback-classic
-
-
io.dropwizard.metricsmetrics-core
diff --git a/engine-cli/pom.xml b/engine-cli/pom.xml
index a5e010a26..ddc1efb6d 100644
--- a/engine-cli/pom.xml
+++ b/engine-cli/pom.xml
@@ -32,13 +32,6 @@
3.12.155-SNAPSHOT
-
- ch.qos.logback
- logback-classic
- 1.2.3
-
-
-
diff --git a/engine-core/pom.xml b/engine-core/pom.xml
index 12a95183f..ef918eec9 100644
--- a/engine-core/pom.xml
+++ b/engine-core/pom.xml
@@ -37,11 +37,6 @@
3.12.155-SNAPSHOT
-
- ch.qos.logback
- logback-classic
-
-
io.dropwizard.metricsmetrics-core
diff --git a/engine-rest/pom.xml b/engine-rest/pom.xml
index cccec2954..8ed0d58e9 100644
--- a/engine-rest/pom.xml
+++ b/engine-rest/pom.xml
@@ -50,12 +50,6 @@
3.12.155-SNAPSHOT
-
- ch.qos.logback
- logback-classic
- 1.2.3
-
-
diff --git a/mvn-defaults/pom.xml b/mvn-defaults/pom.xml
index 97cb7bfb4..7d44e8a69 100644
--- a/mvn-defaults/pom.xml
+++ b/mvn-defaults/pom.xml
@@ -40,8 +40,7 @@
1.222.9.95.3.2
- 2.13.3
- 1.2.3
+
1.4.11.1.04.0.7
@@ -50,7 +49,7 @@
4.1.47.Final1.0.0
- 1.7.29
+
1.231.1.2.6
@@ -152,15 +151,15 @@
io.dropwizard.metrics
- metrics-core
- ${metrics.version}
+ metrics-core
+ ${metrics.version}
-
- org.apache.commons
- commons-text
- ${commons.text.version}
-
+
+ org.apache.commons
+ commons-text
+ ${commons.text.version}
+ org.slf4j
@@ -168,15 +167,15 @@
${slf4j.version}
-
- org.openjdk.jmh
- jmh-core
- ${jmh.version}
-
-
- org.openjdk.jmh
- jmh-generator-annprocess
- ${jmh.version}
+
+ org.openjdk.jmh
+ jmh-core
+ ${jmh.version}
+
+
+ org.openjdk.jmh
+ jmh-generator-annprocess
+ ${jmh.version}
diff --git a/nb-annotations/pom.xml b/nb-annotations/pom.xml
index 9ea4bb229..75ed9dbaf 100644
--- a/nb-annotations/pom.xml
+++ b/nb-annotations/pom.xml
@@ -21,16 +21,6 @@
-
- org.slf4j
- slf4j-api
-
-
-
- ch.qos.logback
- logback-classic
-
-
org.apache.commons
diff --git a/nb-api/pom.xml b/nb-api/pom.xml
index f00001771..19f3d3eb9 100644
--- a/nb-api/pom.xml
+++ b/nb-api/pom.xml
@@ -34,16 +34,6 @@
3.12.155-SNAPSHOT
-
- org.slf4j
- slf4j-api
-
-
-
- ch.qos.logback
- logback-classic
-
-
com.vladsch.flexmarkflexmark-ext-yaml-front-matter
From a09efbe9948ba5cccdc073517d66125c98566165 Mon Sep 17 00:00:00 2001
From: Jonathan Shook
Date: Mon, 16 Nov 2020 17:30:20 -0600
Subject: [PATCH 035/164] consolidate to log4j2
---
.../cql/codecsupport/UDTCodecInjector.java | 10 +-
.../cql/codecsupport/UserCodecProvider.java | 8 +-
.../activitytype/cql/core/CQLOptions.java | 6 +-
.../activitytype/cql/core/CqlAction.java | 6 +-
.../activitytype/cql/core/CqlActivity.java | 6 +-
.../activitytype/cql/core/CqlAsyncAction.java | 6 +-
.../long_string/ModuloCSVLineToUUID.java | 10 +-
.../functions/to_tuple/CustomFunc955.java | 8 +-
.../cql/errorhandling/CQLExceptionEnum.java | 8 +-
.../errorhandling/HashedCQLErrorHandler.java | 10 +-
.../errorhandling/NBCycleErrorHandler.java | 10 +-
.../binders/DiagnosticPreparedBinder.java | 6 +-
.../binders/DirectArrayValuesBinder.java | 6 +-
.../binders/UnsettableValuesBinder.java | 6 +-
.../cql/statements/core/CQLSessionCache.java | 6 +-
.../cql/statements/core/CQLStatementDef.java | 6 +-
.../core/CQLStatementDefParser.java | 18 +-
.../core/ReadyCQLStatementTemplate.java | 6 +-
.../core/YamlCQLStatementLoader.java | 10 +-
.../cql/statements/rowoperators/Save.java | 6 +-
.../rsoperators/CqlResultSetLogger.java | 6 +-
.../statements/rsoperators/TraceLogger.java | 8 +-
.../cqld4/codecsupport/UDTCodecInjector.java | 8 +-
.../cqld4/codecsupport/UserCodecProvider.java | 8 +-
.../activitytype/cqld4/core/CQLOptions.java | 2 +-
.../activitytype/cqld4/core/CqlAction.java | 6 +-
.../activitytype/cqld4/core/CqlActivity.java | 6 +-
.../cqld4/core/CqlAsyncAction.java | 6 +-
.../cqld4/errorhandling/CQLExceptionEnum.java | 16 +-
.../errorhandling/HashedCQLErrorHandler.java | 10 +-
.../errorhandling/NBCycleErrorHandler.java | 6 +-
.../binders/DiagnosticPreparedBinder.java | 6 +-
.../binders/DirectArrayValuesBinder.java | 6 +-
.../binders/UnsettableValuesBinder.java | 8 +-
.../statements/core/CQLSessionCache.java | 10 +-
.../statements/core/CQLStatementDef.java | 6 +-
.../core/CQLStatementDefParser.java | 18 +-
.../core/ReadyCQLStatementTemplate.java | 6 +-
.../core/YamlCQLStatementLoader.java | 6 +-
.../cqld4/statements/rowoperators/Save.java | 8 +-
.../rsoperators/CqlD4ResultSetLogger.java | 6 +-
.../statements/rsoperators/TraceLogger.java | 8 +-
.../cqlverify/CqlVerifyActivity.java | 6 +-
.../activitytype/diag/AsyncDiagAction.java | 10 +-
.../activitytype/diag/DiagAction.java | 8 +-
.../diag/DiagActionDispenser.java | 9 +-
.../activitytype/diag/DiagActivityType.java | 6 +-
.../activitytype/diag/SequenceBlocker.java | 6 +-
.../activitytype/http/HttpAction.java | 6 +-
.../activitytype/http/HttpActivity.java | 6 +-
.../activitytype/http/HttpActivityType.java | 6 +-
.../http/async/HttpAsyncAction.java | 6 +-
.../io/nosqlbench/driver/jmx/JMXAction.java | 6 +-
.../io/nosqlbench/driver/jmx/SecureUtils.java | 7 +-
.../io/nosqlbench/driver/jmx/ops/JmxOp.java | 6 +-
.../ebdrivers/kafkaproducer/KafkaAction.java | 6 +-
.../kafkaproducer/KafkaProducerActivity.java | 18 +-
.../kafkaproducer/KafkaStatement.java | 6 +-
.../driver/mongodb/MongoAction.java | 6 +-
.../driver/mongodb/MongoActivity.java | 6 +-
.../mongodb/ReadyMongoStatementTest.java | 30 +-
.../stdout/AsyncStdoutAction.java | 6 +-
.../activitytype/stdout/StdoutAction.java | 20 +-
.../activitytype/stdout/StdoutActivity.java | 6 +-
.../tcpclient/TCPClientActivity.java | 6 +-
.../tcpserver/TCPServerActivity.java | 12 +-
.../driver/webdriver/WebContext.java | 10 +-
.../driver/webdriver/WebDriverAction.java | 8 +-
.../driver/webdriver/WebDriverActivity.java | 13 +-
.../driver/webdriver/verbs/AssertElement.java | 9 +-
.../driver/webdriver/verbs/FindElement.java | 7 +-
.../driver/webdriver/verbs/FindElements.java | 7 +-
.../driver/webdriver/verbs/Get.java | 6 +-
.../webdriver/verbs/WebDriverVerbs.java | 6 +-
.../api/activityapi/core/BaseAsyncAction.java | 6 +-
.../CycleResultsRLEBufferTarget.java | 12 +-
.../tristate/EnumReadableMappingFilter.java | 8 +-
.../inputs/cyclelog/CycleLogInput.java | 6 +-
.../ReorderingConcurrentResultBuffer.java | 10 +-
.../outputs/cyclelog/CycleLogOutput.java | 10 +-
.../outputs/cyclelog/CycleLogOutputType.java | 8 +-
.../logger/LoggingMarkerDispenser.java | 8 +-
.../outputs/logger/LoggingOutput.java | 8 +-
.../errorhandling/CycleErrorHandlers.java | 6 +-
.../errorhandling/HashedErrorHandler.java | 12 +-
.../activityapi/planning/SequencePlanner.java | 6 +-
.../ratelimits/HybridRateLimiter.java | 8 +-
.../activityapi/ratelimits/RateLimiters.java | 6 +-
.../api/activityapi/ratelimits/RateSpec.java | 11 +-
.../activityapi/ratelimits/TokenFiller.java | 8 +-
.../api/activityapi/ratelimits/TokenPool.java | 6 +-
.../api/activityapi/sysperf/SysPerf.java | 6 +-
.../activityapi/sysperf/SysPerfBaseliner.java | 6 +-
.../engine/api/activityconfig/ParsedStmt.java | 6 +-
.../api/activityconfig/StatementsLoader.java | 6 +-
.../activityconfig/rawyaml/RawStmtFields.java | 6 +-
.../rawyaml/RawStmtsLoader.java | 2 +-
.../engine/api/activityimpl/ActivityDef.java | 10 +-
.../engine/api/activityimpl/CpuInfo.java | 6 +-
.../engine/api/activityimpl/ParameterMap.java | 8 +-
.../api/activityimpl/SimpleActivity.java | 6 +-
.../api/activityimpl/SlotStateTracker.java | 6 +-
.../api/activityimpl/action/CoreAction.java | 6 +-
.../action/CoreActionDispenser.java | 8 +-
.../api/activityimpl/input/AtomicInput.java | 6 +-
.../marker/ContiguousOutputChunker.java | 20 +-
.../api/activityimpl/motor/CoreMotor.java | 16 +-
.../api/activityimpl/motor/StrideTracker.java | 6 +-
.../api/extensions/ScriptingPluginInfo.java | 2 +-
.../engine/api/metrics/ActivityMetrics.java | 10 +-
.../api/metrics/ClassicHistoListener.java | 18 +-
.../api/metrics/ClassicTimerListener.java | 18 +-
.../metrics/DeltaHdrHistogramReservoir.java | 8 +-
.../api/metrics/HistoIntervalLogger.java | 14 +-
.../api/metrics/HistoLogChartGenerator.java | 8 +-
.../api/metrics/HistoStatsCSVWriter.java | 6 +-
.../engine/api/metrics/HistoStatsLogger.java | 14 +-
.../engine/api/metrics/PeriodicRunnable.java | 10 +-
.../api/scenarios/NBCLIScenarioParser.java | 6 +-
.../api/scripting/NashornEvaluator.java | 6 +-
.../api/templating/CommandTemplate.java | 8 +-
.../engine/api/util/SSLKsFactory.java | 6 +-
.../engine/api/util/SimpleServiceLoader.java | 6 +-
.../io/nosqlbench/engine/api/util/Unit.java | 26 +-
.../rawyaml/BindingEscapingTest.java | 6 +-
.../rawyaml/RawYamlStatementLoaderTest.java | 6 +-
.../activityconfig/rawyaml/StmtDefTest.java | 6 +-
.../rawyaml/StmtEscapingTest.java | 6 +-
.../rawyaml/StmtVariationTests.java | 6 +-
.../activityconfig/yaml/ParsedStmtTest.java | 6 +-
.../yaml/StmtDetailOverrideTest.java | 6 +-
.../activityconfig/yaml/StmtsDocListTest.java | 12 +-
.../engine/cli/BasicScriptBuffer.java | 6 +-
.../java/io/nosqlbench/engine/cli/Cmd.java | 6 +-
.../java/io/nosqlbench/engine/cli/NBCLI.java | 11 +-
.../nosqlbench/engine/cli/NBCLIArgsFile.java | 7 +-
.../nosqlbench/engine/cli/NBCLIOptions.java | 9 +-
.../engine/cli/PathCanonicalizer.java | 6 +-
.../engine/core/ActivityExecutor.java | 8 +-
.../core/ActivityProgressIndicator.java | 6 +-
.../engine/core/MarkdownDocInfo.java | 12 +-
.../core/PolyglotScenarioController.java | 7 +-
.../engine/core/ScenarioController.java | 8 +-
.../engine/core/ScenarioErrorHandler.java | 6 +-
.../engine/core/ScenarioResult.java | 10 +-
.../engine/core/ScenariosResults.java | 6 +-
.../core/logging/Log4JMetricsReporter.java | 418 ++++++++++++++++++
.../engine/core/metrics/MetricMap.java | 6 +-
.../engine/core/metrics/MetricReporters.java | 12 +-
.../NashornMetricRegistryBindings.java | 10 +-
.../PolyglotMetricRegistryBindings.java | 8 +-
.../engine/core/script/MetricsMapper.java | 12 +-
.../engine/core/script/Scenario.java | 33 +-
.../engine/core/script/ScenariosExecutor.java | 14 +-
.../engine/core/script/ScriptParams.java | 9 +-
.../engine/core/ActivityExecutorTest.java | 8 +-
.../engine/docker/DockerHelper.java | 6 +-
.../engine/docker/DockerMetricsManager.java | 6 +-
.../nosqlbench/engine/docker/RestHelper.java | 7 +-
.../extensions/csvmetrics/CSVMetrics.java | 4 +-
.../csvmetrics/CSVMetricsPlugin.java | 2 +-
.../csvmetrics/CSVMetricsPluginData.java | 2 +-
.../extensions/example/ExamplePluginData.java | 2 +-
.../files/FileAccessPluginData.java | 2 +-
.../GlobalVarsScriptingPluginData.java | 2 +-
.../histologger/HdrHistoLogPlugin.java | 8 +-
.../histologger/HdrHistoLogPluginData.java | 2 +-
.../histostatslogger/HistoStatsPlugin.java | 8 +-
.../HistoStatsPluginData.java | 2 +-
.../extensions/http/HttpPluginData.java | 3 +-
.../optimizers/BobyqaOptimizerInstance.java | 4 +-
.../optimizers/BobyqaOptimizerPlugin.java | 2 +-
.../optimizers/BobyqaOptimizerPluginData.java | 2 +-
.../optimizers/MultivariateArrayScript.java | 4 +-
.../optimizers/MultivariateDynamicScript.java | 4 +-
.../NashornMultivariateObjectScript.java | 4 +-
.../PolyglotMultivariateObjectScript.java | 2 +-
.../scriptingmetrics/ScriptingMetrics.java | 8 +-
.../ScriptingMetricsPluginData.java | 2 +-
.../resources/ScenarioExecutorEndpoint.java | 36 +-
mvn-defaults/pom.xml | 20 +-
.../io/nosqlbench/nb/api/config/Synonyms.java | 2 +-
.../nosqlbench/nb/api/content/PathFinder.java | 6 +-
.../nb/api/content/ResolverForURL.java | 8 +-
.../script/AsyncScriptIntegrationTests.java | 3 +-
.../core/script/NBCliIntegrationTests.java | 6 +-
.../core/script/ScriptIntegrationTests.java | 9 +-
187 files changed, 1153 insertions(+), 756 deletions(-)
create mode 100644 engine-core/src/main/java/io/nosqlbench/engine/core/logging/Log4JMetricsReporter.java
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/codecsupport/UDTCodecInjector.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/codecsupport/UDTCodecInjector.java
index c2fb720c9..85acc8973 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/codecsupport/UDTCodecInjector.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/codecsupport/UDTCodecInjector.java
@@ -3,18 +3,18 @@ package io.nosqlbench.activitytype.cql.codecsupport;
import com.datastax.driver.core.CodecRegistry;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.UserType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.ArrayList;
import java.util.List;
import java.util.ServiceLoader;
public class UDTCodecInjector {
- private final static Logger logger = LoggerFactory.getLogger(UDTCodecInjector.class);
+ private final static Logger logger = LogManager.getLogger(UDTCodecInjector.class);
- private List codecProviders = new ArrayList<>();
- private List userTypes = new ArrayList<>();
+ private final List codecProviders = new ArrayList<>();
+ private final List userTypes = new ArrayList<>();
public void injectUserProvidedCodecs(Session session, boolean allowAcrossKeyspaces) {
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/codecsupport/UserCodecProvider.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/codecsupport/UserCodecProvider.java
index 3a9cb4efa..d9998ed27 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/codecsupport/UserCodecProvider.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/codecsupport/UserCodecProvider.java
@@ -1,8 +1,8 @@
package io.nosqlbench.activitytype.cql.codecsupport;
import com.datastax.driver.core.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.lang.reflect.Constructor;
import java.util.*;
@@ -10,7 +10,7 @@ import java.util.stream.Collectors;
public abstract class UserCodecProvider {
- private final static Logger logger = LoggerFactory.getLogger(UserCodecProvider.class);
+ private final static Logger logger = LogManager.getLogger(UserCodecProvider.class);
public List registerCodecsForCluster(
Session session,
@@ -131,7 +131,7 @@ public abstract class UserCodecProvider {
.orElseThrow(
() -> new RuntimeException("Unable to find UDTJavaType annotation for " + codecClass.getCanonicalName())
);
- return (Class>) javaType;
+ return javaType;
}
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CQLOptions.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CQLOptions.java
index 660bc5fc5..27fbd5b29 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CQLOptions.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CQLOptions.java
@@ -4,8 +4,8 @@ import com.datastax.driver.core.*;
import com.datastax.driver.core.policies.*;
import io.netty.util.HashedWheelTimer;
import io.nosqlbench.nb.api.errors.BasicError;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.net.InetSocketAddress;
import java.util.*;
@@ -16,7 +16,7 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
public class CQLOptions {
- private final static Logger logger = LoggerFactory.getLogger(CQLOptions.class);
+ private final static Logger logger = LogManager.getLogger(CQLOptions.class);
private final static Pattern CORE_AND_MAX_RQ_PATTERN = Pattern.compile("(?\\d+)(:(?\\d+)(:(?\\d+))?)?(,(?\\d+)(:(?\\d+)(:(?\\d+))?)?)?(,?heartbeat_interval_s:(?\\d+))?(,?idle_timeout_s:(?\\d+))?(,?pool_timeout_ms:(?\\d+))?");
private final static Pattern PERCENTILE_EAGER_PATTERN = Pattern.compile("^p(?[^:]+)(:(?\\d+))?(:(?\\d+)ms)?$");
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CqlAction.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CqlAction.java
index 7ce4c6107..04613f3f8 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CqlAction.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CqlAction.java
@@ -19,8 +19,8 @@ import io.nosqlbench.engine.api.activityapi.core.MultiPhaseAction;
import io.nosqlbench.engine.api.activityapi.core.SyncAction;
import io.nosqlbench.engine.api.activityapi.planning.OpSequence;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -28,7 +28,7 @@ import java.util.concurrent.TimeUnit;
@SuppressWarnings("Duplicates")
public class CqlAction implements SyncAction, MultiPhaseAction, ActivityDefObserver {
- private final static Logger logger = LoggerFactory.getLogger(CqlAction.class);
+ private final static Logger logger = LogManager.getLogger(CqlAction.class);
private final int slot;
private final CqlActivity cqlActivity;
private final ActivityDef activityDef;
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CqlActivity.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CqlActivity.java
index 5aa718fd8..23f0f9ece 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CqlActivity.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CqlActivity.java
@@ -44,8 +44,8 @@ import io.nosqlbench.engine.api.util.TagFilter;
import io.nosqlbench.engine.api.util.Unit;
import io.nosqlbench.nb.api.errors.BasicError;
import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.io.FileWriter;
import java.io.IOException;
@@ -56,7 +56,7 @@ import java.util.*;
@SuppressWarnings("Duplicates")
public class CqlActivity extends SimpleActivity implements Activity, ActivityDefObserver {
- private final static Logger logger = LoggerFactory.getLogger(CqlActivity.class);
+ private final static Logger logger = LogManager.getLogger(CqlActivity.class);
private final ExceptionCountMetrics exceptionCountMetrics;
private final ExceptionHistoMetrics exceptionHistoMetrics;
private final ActivityDef activityDef;
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CqlAsyncAction.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CqlAsyncAction.java
index 43f16f7ef..695b7852e 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CqlAsyncAction.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/core/CqlAsyncAction.java
@@ -23,8 +23,8 @@ import io.nosqlbench.engine.api.activityapi.core.ops.fluent.opfacets.SucceededOp
import io.nosqlbench.engine.api.activityapi.core.ops.fluent.opfacets.TrackedOp;
import io.nosqlbench.engine.api.activityapi.planning.OpSequence;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -33,7 +33,7 @@ import java.util.function.LongFunction;
@SuppressWarnings("Duplicates")
public class CqlAsyncAction extends BaseAsyncAction {
- private final static Logger logger = LoggerFactory.getLogger(CqlAsyncAction.class);
+ private final static Logger logger = LogManager.getLogger(CqlAsyncAction.class);
private final ActivityDef activityDef;
private List rowOps;
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/datamappers/functions/long_string/ModuloCSVLineToUUID.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/datamappers/functions/long_string/ModuloCSVLineToUUID.java
index 838c329fa..9af56f0f4 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/datamappers/functions/long_string/ModuloCSVLineToUUID.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/datamappers/functions/long_string/ModuloCSVLineToUUID.java
@@ -25,8 +25,8 @@ import io.nosqlbench.virtdata.api.annotations.ThreadSafeMapper;
import io.nosqlbench.virtdata.library.basics.shared.from_long.to_string.ModuloLineToString;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.ArrayList;
import java.util.List;
@@ -40,11 +40,11 @@ import java.util.function.LongFunction;
*/
@ThreadSafeMapper
public class ModuloCSVLineToUUID implements LongFunction {
- private final static Logger logger = LoggerFactory.getLogger(ModuloLineToString.class);
+ private final static Logger logger = LogManager.getLogger(ModuloLineToString.class);
- private List lines = new ArrayList<>();
+ private final List lines = new ArrayList<>();
- private String filename;
+ private final String filename;
@Example({"ModuloCSVLineToUUID('data/myfile.csv','lat')","load values for 'lat' from the CSV file myfile.csv."})
public ModuloCSVLineToUUID(String filename, String fieldname) {
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/datamappers/functions/to_tuple/CustomFunc955.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/datamappers/functions/to_tuple/CustomFunc955.java
index b3e359c87..c3d80306c 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/datamappers/functions/to_tuple/CustomFunc955.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/datamappers/functions/to_tuple/CustomFunc955.java
@@ -71,8 +71,8 @@ public class CustomFunc955 implements LongFunction>, ConfigAware {
}
@Override
- public void applyConfig(Map elements) {
- this.cluster = Optional.ofNullable(elements.get("cluster"))
+ public void applyConfig(Map providedConfig) {
+ this.cluster = Optional.ofNullable(providedConfig.get("cluster"))
.map(Cluster.class::cast)
.orElseThrow();
this.tupleType = cluster.getMetadata().newTupleType(DataType.cint(), DataType.bigint());
@@ -80,8 +80,8 @@ public class CustomFunc955 implements LongFunction>, ConfigAware {
@Override
public ConfigModel getConfigModel() {
- return new MutableConfigModel()
- .add("", Cluster.class)
+ return new MutableConfigModel(this)
+ .optional("", Cluster.class)
.asReadOnly();
}
}
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/errorhandling/CQLExceptionEnum.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/errorhandling/CQLExceptionEnum.java
index 0e5723e45..83fe72e1f 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/errorhandling/CQLExceptionEnum.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/errorhandling/CQLExceptionEnum.java
@@ -3,8 +3,8 @@ package io.nosqlbench.activitytype.cql.errorhandling;
import com.datastax.driver.core.exceptions.*;
import io.nosqlbench.activitytype.cql.errorhandling.exceptions.*;
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.ResultReadable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.ArrayList;
import java.util.HashMap;
@@ -64,10 +64,10 @@ public enum CQLExceptionEnum implements ResultReadable {
EbdseCycleException(CqlGenericCycleException.class, 42),
MaxTriesExhaustedException(io.nosqlbench.activitytype.cql.errorhandling.exceptions.MaxTriesExhaustedException.class,43);
- private final static Logger logger = LoggerFactory.getLogger(CQLExceptionEnum.class);
+ private final static Logger logger = LogManager.getLogger(CQLExceptionEnum.class);
private static Map codesByName = getCodesByName();
- private static String[] namesByCode = getNamesByCode();
+ private static final String[] namesByCode = getNamesByCode();
private final Class extends Exception> exceptionClass;
private final int resultCode;
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/errorhandling/HashedCQLErrorHandler.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/errorhandling/HashedCQLErrorHandler.java
index 2a4dcdc79..e23069ce2 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/errorhandling/HashedCQLErrorHandler.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/errorhandling/HashedCQLErrorHandler.java
@@ -8,18 +8,18 @@ import io.nosqlbench.activitytype.cql.errorhandling.exceptions.RowVerificationEx
import io.nosqlbench.engine.api.activityapi.errorhandling.CycleErrorHandler;
import io.nosqlbench.engine.api.activityapi.errorhandling.HashedErrorHandler;
import io.nosqlbench.engine.api.metrics.ExceptionCountMetrics;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
public class HashedCQLErrorHandler extends HashedErrorHandler {
- private static final Logger logger = LoggerFactory.getLogger(HashedCQLErrorHandler.class);
+ private static final Logger logger = LogManager.getLogger(HashedCQLErrorHandler.class);
// private static Set> UNVERIFIED_ERRORS = new HashSet>() {{
// add(RowVerificationException.class);
// add(ResultSetVerificationException.class);
// }};
- private ExceptionCountMetrics exceptionCountMetrics;
- private static ThreadLocal tlResultCode = ThreadLocal.withInitial(() -> (0));
+ private final ExceptionCountMetrics exceptionCountMetrics;
+ private static final ThreadLocal tlResultCode = ThreadLocal.withInitial(() -> (0));
public HashedCQLErrorHandler(ExceptionCountMetrics exceptionCountMetrics) {
this.exceptionCountMetrics = exceptionCountMetrics;
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/errorhandling/NBCycleErrorHandler.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/errorhandling/NBCycleErrorHandler.java
index 43f36c6a1..88ed8e17d 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/errorhandling/NBCycleErrorHandler.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/errorhandling/NBCycleErrorHandler.java
@@ -6,8 +6,8 @@ import io.nosqlbench.activitytype.cql.errorhandling.exceptions.CQLExceptionDetai
import io.nosqlbench.engine.api.activityapi.errorhandling.CycleErrorHandler;
import io.nosqlbench.engine.api.metrics.ExceptionCountMetrics;
import io.nosqlbench.engine.api.metrics.ExceptionHistoMetrics;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* A contextualized error handler that can catch a cycle-specific error.
@@ -42,10 +42,10 @@ import org.slf4j.LoggerFactory;
@SuppressWarnings("Duplicates")
public class NBCycleErrorHandler implements CycleErrorHandler {
- private static final Logger logger = LoggerFactory.getLogger(NBCycleErrorHandler.class);
+ private static final Logger logger = LogManager.getLogger(NBCycleErrorHandler.class);
- private ErrorResponse errorResponse;
- private ExceptionCountMetrics exceptionCountMetrics;
+ private final ErrorResponse errorResponse;
+ private final ExceptionCountMetrics exceptionCountMetrics;
private final ExceptionHistoMetrics exceptionHistoMetrics;
private boolean throwExceptionOnStop=false;
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/binders/DiagnosticPreparedBinder.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/binders/DiagnosticPreparedBinder.java
index 2c7a2fe2f..238911192 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/binders/DiagnosticPreparedBinder.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/binders/DiagnosticPreparedBinder.java
@@ -3,8 +3,8 @@ package io.nosqlbench.activitytype.cql.statements.binders;
import com.datastax.driver.core.*;
import io.nosqlbench.activitytype.cql.core.CQLBindHelper;
import io.nosqlbench.virtdata.core.bindings.ValuesArrayBinder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.List;
@@ -15,7 +15,7 @@ import java.util.List;
* order to explain in more detail what is happening for users.
*/
public class DiagnosticPreparedBinder implements ValuesArrayBinder {
- public static final Logger logger = LoggerFactory.getLogger(DiagnosticPreparedBinder.class);
+ public static final Logger logger = LogManager.getLogger(DiagnosticPreparedBinder.class);
@Override
public Statement bindValues(PreparedStatement prepared, Object[] values) {
ColumnDefinitions columnDefinitions = prepared.getVariables();
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/binders/DirectArrayValuesBinder.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/binders/DirectArrayValuesBinder.java
index 7d9a1aa3b..046781c24 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/binders/DirectArrayValuesBinder.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/binders/DirectArrayValuesBinder.java
@@ -3,8 +3,8 @@ package io.nosqlbench.activitytype.cql.statements.binders;
import com.datastax.driver.core.PreparedStatement;
import com.datastax.driver.core.Statement;
import io.nosqlbench.virtdata.core.bindings.ValuesArrayBinder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.Arrays;
@@ -19,7 +19,7 @@ import java.util.Arrays;
* will become the default.
*/
public class DirectArrayValuesBinder implements ValuesArrayBinder {
- public final static Logger logger = LoggerFactory.getLogger(DirectArrayValuesBinder.class);
+ public final static Logger logger = LogManager.getLogger(DirectArrayValuesBinder.class);
@Override
public Statement bindValues(PreparedStatement preparedStatement, Object[] objects) {
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/binders/UnsettableValuesBinder.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/binders/UnsettableValuesBinder.java
index 64fa5484c..5a8c1cc44 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/binders/UnsettableValuesBinder.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/binders/UnsettableValuesBinder.java
@@ -3,14 +3,14 @@ package io.nosqlbench.activitytype.cql.statements.binders;
import com.datastax.driver.core.*;
import io.nosqlbench.virtdata.api.bindings.VALUE;
import io.nosqlbench.virtdata.core.bindings.ValuesArrayBinder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.nio.ByteBuffer;
import java.util.List;
public class UnsettableValuesBinder implements ValuesArrayBinder {
- private final static Logger logger = LoggerFactory.getLogger(UnsettableValuesBinder.class);
+ private final static Logger logger = LogManager.getLogger(UnsettableValuesBinder.class);
private final Session session;
private final CodecRegistry codecRegistry;
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/CQLSessionCache.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/CQLSessionCache.java
index a274bf451..db84e375e 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/CQLSessionCache.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/CQLSessionCache.java
@@ -14,8 +14,8 @@ import io.nosqlbench.engine.api.metrics.ActivityMetrics;
import io.nosqlbench.engine.api.scripting.NashornEvaluator;
import io.nosqlbench.engine.api.util.SSLKsFactory;
import io.nosqlbench.nb.api.errors.BasicError;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import javax.net.ssl.SSLContext;
import java.io.File;
@@ -28,7 +28,7 @@ import java.util.*;
public class CQLSessionCache implements Shutdownable {
- private final static Logger logger = LoggerFactory.getLogger(CQLSessionCache.class);
+ private final static Logger logger = LogManager.getLogger(CQLSessionCache.class);
private final static String DEFAULT_SESSION_ID = "default";
private static final CQLSessionCache instance = new CQLSessionCache();
private final Map sessionCache = new HashMap<>();
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/CQLStatementDef.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/CQLStatementDef.java
index 043cea6c6..27edcbb19 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/CQLStatementDef.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/CQLStatementDef.java
@@ -1,14 +1,14 @@
package io.nosqlbench.activitytype.cql.statements.core;
import com.datastax.driver.core.ConsistencyLevel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.*;
import java.util.stream.Collectors;
public class CQLStatementDef {
- private final static Logger logger = LoggerFactory.getLogger(CQLStatementDef.class);
+ private final static Logger logger = LogManager.getLogger(CQLStatementDef.class);
private Map params = new HashMap<>();
private String name = "";
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/CQLStatementDefParser.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/CQLStatementDefParser.java
index c82b124b0..7e4ddc076 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/CQLStatementDefParser.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/CQLStatementDefParser.java
@@ -1,7 +1,7 @@
package io.nosqlbench.activitytype.cql.statements.core;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.*;
import java.util.regex.Matcher;
@@ -9,7 +9,7 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
public class CQLStatementDefParser {
- private final static Logger logger = LoggerFactory.getLogger(CQLStatementDefParser.class);
+ private final static Logger logger = LogManager.getLogger(CQLStatementDefParser.class);
// private final static Pattern templateToken = Pattern.compile("<<(\\w+(:(.+?))?)>>");
private final static Pattern stmtToken = Pattern.compile("\\?(\\w+[-_\\d\\w]*)|\\{(\\w+[-_\\d\\w.]*)}");
private final static String UNSET_VALUE = "UNSET-VALUE";
@@ -93,9 +93,7 @@ public class CQLStatementDefParser {
if (!namedBindings.contains(tokenName)) {
missingBindings.add(tokenName);
} else {
- if (missingAnchors.contains(tokenName)) {
- missingAnchors.remove(tokenName);
- }
+ missingAnchors.remove(tokenName);
}
}
@@ -114,11 +112,11 @@ public class CQLStatementDefParser {
}
public static class ParseResult {
- private Set missingGenerators;
- private Set missingAnchors;
- private String statement;
+ private final Set missingGenerators;
+ private final Set missingAnchors;
+ private final String statement;
private Map bindings;
- private String name;
+ private final String name;
public ParseResult(String stmt, String name, Map bindings, Set missingGenerators, Set missingAnchors) {
this.missingGenerators = missingGenerators;
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/ReadyCQLStatementTemplate.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/ReadyCQLStatementTemplate.java
index f76fc422e..6f5ad5813 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/ReadyCQLStatementTemplate.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/ReadyCQLStatementTemplate.java
@@ -15,15 +15,15 @@ import io.nosqlbench.engine.api.metrics.ActivityMetrics;
import io.nosqlbench.virtdata.core.bindings.BindingsTemplate;
import io.nosqlbench.virtdata.core.bindings.ContextualBindingsArrayTemplate;
import io.nosqlbench.virtdata.core.bindings.ValuesArrayBinder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.io.Writer;
import java.util.Map;
public class ReadyCQLStatementTemplate {
- private final static Logger logger = LoggerFactory.getLogger(ReadyCQLStatementTemplate.class);
+ private final static Logger logger = LogManager.getLogger(ReadyCQLStatementTemplate.class);
private final Session session;
private final ContextualBindingsArrayTemplate, Statement> template;
private final long ratio;
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/YamlCQLStatementLoader.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/YamlCQLStatementLoader.java
index ec2be1090..109772f73 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/YamlCQLStatementLoader.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/core/YamlCQLStatementLoader.java
@@ -3,25 +3,21 @@ package io.nosqlbench.activitytype.cql.statements.core;
import io.nosqlbench.engine.api.activityimpl.ActivityInitializationError;
import io.nosqlbench.nb.api.content.Content;
import io.nosqlbench.nb.api.content.NBIO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.yaml.snakeyaml.TypeDescription;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
-import java.util.stream.Collectors;
@SuppressWarnings("ALL")
public class YamlCQLStatementLoader {
- private final static Logger logger = LoggerFactory.getLogger(YamlCQLStatementLoader.class);
+ private final static Logger logger = LogManager.getLogger(YamlCQLStatementLoader.class);
List> transformers = new ArrayList<>();
public YamlCQLStatementLoader() {
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/rowoperators/Save.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/rowoperators/Save.java
index 5517f622c..6fae4d104 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/rowoperators/Save.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/rowoperators/Save.java
@@ -4,8 +4,8 @@ import com.datastax.driver.core.ColumnDefinitions;
import com.datastax.driver.core.Row;
import io.nosqlbench.activitytype.cql.api.RowCycleOperator;
import io.nosqlbench.virtdata.library.basics.core.threadstate.SharedState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.Arrays;
import java.util.HashMap;
@@ -16,7 +16,7 @@ import java.util.stream.Collectors;
* Save specific variables to the thread local object map
*/
public class Save implements RowCycleOperator {
- private final static Logger logger = LoggerFactory.getLogger(Save.class);
+ private final static Logger logger = LogManager.getLogger(Save.class);
ThreadLocal> tl_objectMap = SharedState.tl_ObjectMap;
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/rsoperators/CqlResultSetLogger.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/rsoperators/CqlResultSetLogger.java
index b7ee30db5..b4149e749 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/rsoperators/CqlResultSetLogger.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/rsoperators/CqlResultSetLogger.java
@@ -2,15 +2,15 @@ package io.nosqlbench.activitytype.cql.statements.rsoperators;
import com.datastax.driver.core.*;
import io.nosqlbench.activitytype.cql.api.ResultSetCycleOperator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* Logs a trace-level event for the result set, including
* cycles, rows, fetched row count, and the statement.
*/
public class CqlResultSetLogger implements ResultSetCycleOperator {
- private final static Logger logger = LoggerFactory.getLogger(CqlResultSetLogger.class);
+ private final static Logger logger = LogManager.getLogger(CqlResultSetLogger.class);
private static String getQueryString(Statement stmt) {
if (stmt instanceof PreparedStatement) {
diff --git a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/rsoperators/TraceLogger.java b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/rsoperators/TraceLogger.java
index a432bd669..81f86a243 100644
--- a/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/rsoperators/TraceLogger.java
+++ b/driver-cql-shaded/src/main/java/io/nosqlbench/activitytype/cql/statements/rsoperators/TraceLogger.java
@@ -7,8 +7,8 @@ import com.datastax.driver.core.Statement;
import io.nosqlbench.activitytype.cql.api.ResultSetCycleOperator;
import io.nosqlbench.activitytype.cql.statements.modifiers.StatementModifier;
import io.nosqlbench.engine.api.util.SimpleConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.io.FileDescriptor;
import java.io.FileWriter;
@@ -18,9 +18,9 @@ import java.util.Date;
public class TraceLogger implements ResultSetCycleOperator, StatementModifier {
- private final static Logger logger = LoggerFactory.getLogger(TraceLogger.class);
+ private final static Logger logger = LogManager.getLogger(TraceLogger.class);
- private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.SSS");
+ private static final SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.SSS");
private final long modulo;
private final String filename;
private final FileWriter writer;
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/codecsupport/UDTCodecInjector.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/codecsupport/UDTCodecInjector.java
index d5acdc7fa..76d94c59f 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/codecsupport/UDTCodecInjector.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/codecsupport/UDTCodecInjector.java
@@ -2,17 +2,17 @@ package io.nosqlbench.activitytype.cqld4.codecsupport;
import com.datastax.oss.driver.api.core.session.Session;
import com.datastax.oss.driver.api.core.type.codec.registry.CodecRegistry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.ArrayList;
import java.util.List;
import java.util.ServiceLoader;
public class UDTCodecInjector {
- private final static Logger logger = LoggerFactory.getLogger(UDTCodecInjector.class);
+ private final static Logger logger = LogManager.getLogger(UDTCodecInjector.class);
- private List codecProviders = new ArrayList<>();
+ private final List codecProviders = new ArrayList<>();
public void injectUserProvidedCodecs(Session session, boolean allowAcrossKeyspaces) {
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/codecsupport/UserCodecProvider.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/codecsupport/UserCodecProvider.java
index c0ea70137..4b02f6b8a 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/codecsupport/UserCodecProvider.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/codecsupport/UserCodecProvider.java
@@ -6,8 +6,8 @@ import com.datastax.oss.driver.api.core.type.UserDefinedType;
import com.datastax.oss.driver.api.core.type.codec.TypeCodec;
import com.datastax.oss.driver.api.core.type.codec.registry.CodecRegistry;
import com.datastax.oss.driver.api.core.type.codec.registry.MutableCodecRegistry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.lang.reflect.Constructor;
import java.util.*;
@@ -15,7 +15,7 @@ import java.util.stream.Collectors;
public abstract class UserCodecProvider {
- private final static Logger logger = LoggerFactory.getLogger(UserCodecProvider.class);
+ private final static Logger logger = LogManager.getLogger(UserCodecProvider.class);
public List> registerCodecsForCluster(
Session session,
@@ -139,7 +139,7 @@ public abstract class UserCodecProvider {
.orElseThrow(
() -> new RuntimeException("Unable to find UDTJavaType annotation for " + codecClass.getCanonicalName())
);
- return (Class>) javaType;
+ return javaType;
}
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CQLOptions.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CQLOptions.java
index 9143026a8..60262dad8 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CQLOptions.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CQLOptions.java
@@ -1,7 +1,7 @@
package io.nosqlbench.activitytype.cqld4.core;
public class CQLOptions {
-// private final static Logger logger = LoggerFactory.getLogger(CQLOptions.class);
+// private final static Logger logger = LogManager.getLogger(CQLOptions.class);
//
// private final static Pattern CORE_AND_MAX_RQ_PATTERN = Pattern.compile("(?\\d+)(:(?\\d+)(:(?\\d+))?)?(,(?\\d+)(:(?\\d+)(:(?\\d+))?)?)?(,?heartbeat_interval_s:(?\\d+))?(,?idle_timeout_s:(?\\d+))?(,?pool_timeout_ms:(?\\d+))?");
// private final static Pattern PERCENTILE_EAGER_PATTERN = Pattern.compile("^p(?[^:]+)(:(?\\d+))?(:(?\\d+)ms)?$");
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CqlAction.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CqlAction.java
index a23e7961c..00d370e93 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CqlAction.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CqlAction.java
@@ -17,8 +17,8 @@ import io.nosqlbench.engine.api.activityapi.core.MultiPhaseAction;
import io.nosqlbench.engine.api.activityapi.core.SyncAction;
import io.nosqlbench.engine.api.activityapi.planning.OpSequence;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.List;
import java.util.concurrent.CompletionStage;
@@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit;
@SuppressWarnings("Duplicates")
public class CqlAction implements SyncAction, MultiPhaseAction, ActivityDefObserver {
- private final static Logger logger = LoggerFactory.getLogger(CqlAction.class);
+ private final static Logger logger = LogManager.getLogger(CqlAction.class);
private final int slot;
private final CqlActivity cqlActivity;
private final ActivityDef activityDef;
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CqlActivity.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CqlActivity.java
index f6048798b..4e9cc05bf 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CqlActivity.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CqlActivity.java
@@ -45,8 +45,8 @@ import io.nosqlbench.engine.api.util.SimpleConfig;
import io.nosqlbench.engine.api.templating.StrInterpolator;
import io.nosqlbench.engine.api.util.TagFilter;
import io.nosqlbench.engine.api.util.Unit;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.io.FileWriter;
import java.io.IOException;
@@ -57,7 +57,7 @@ import java.util.*;
@SuppressWarnings("Duplicates")
public class CqlActivity extends SimpleActivity implements Activity, ActivityDefObserver {
- private final static Logger logger = LoggerFactory.getLogger(CqlActivity.class);
+ private final static Logger logger = LogManager.getLogger(CqlActivity.class);
private final ExceptionCountMetrics exceptionCountMetrics;
private final ExceptionHistoMetrics exceptionHistoMetrics;
private final ActivityDef activityDef;
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CqlAsyncAction.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CqlAsyncAction.java
index 1702eb60e..f00f6f2f2 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CqlAsyncAction.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/core/CqlAsyncAction.java
@@ -22,8 +22,8 @@ import io.nosqlbench.engine.api.activityapi.core.ops.fluent.opfacets.SucceededOp
import io.nosqlbench.engine.api.activityapi.core.ops.fluent.opfacets.TrackedOp;
import io.nosqlbench.engine.api.activityapi.planning.OpSequence;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.List;
import java.util.concurrent.CompletionStage;
@@ -33,7 +33,7 @@ import java.util.function.LongFunction;
@SuppressWarnings("Duplicates")
public class CqlAsyncAction extends BaseAsyncAction {
- private final static Logger logger = LoggerFactory.getLogger(CqlAsyncAction.class);
+ private final static Logger logger = LogManager.getLogger(CqlAsyncAction.class);
private final ActivityDef activityDef;
private List rowOps;
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/errorhandling/CQLExceptionEnum.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/errorhandling/CQLExceptionEnum.java
index 5d4a81909..8968319a4 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/errorhandling/CQLExceptionEnum.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/errorhandling/CQLExceptionEnum.java
@@ -1,18 +1,12 @@
package io.nosqlbench.activitytype.cqld4.errorhandling;
-import com.datastax.dse.driver.api.core.servererrors.UnfitClientException;
-import com.datastax.oss.driver.api.core.*;
+import com.datastax.oss.driver.api.core.RequestThrottlingException;
import com.datastax.oss.driver.api.core.connection.ClosedConnectionException;
-import com.datastax.oss.driver.api.core.connection.ConnectionInitException;
-import com.datastax.oss.driver.api.core.connection.FrameTooLongException;
-import com.datastax.oss.driver.api.core.connection.HeartbeatException;
import com.datastax.oss.driver.api.core.servererrors.*;
-import com.datastax.oss.driver.internal.core.channel.ClusterNameMismatchException;
-import com.datastax.oss.driver.shaded.guava.common.collect.ComputationException;
import io.nosqlbench.activitytype.cqld4.errorhandling.exceptions.CqlGenericCycleException;
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.ResultReadable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import java.util.ArrayList;
import java.util.HashMap;
@@ -92,10 +86,10 @@ public enum CQLExceptionEnum implements ResultReadable {
RequestThrottlingException(RequestThrottlingException.class,57),
CqlGenericCycleException(CqlGenericCycleException.class,58);
- private final static Logger logger = LoggerFactory.getLogger(CQLExceptionEnum.class);
+ private final static Logger logger = LogManager.getLogger(CQLExceptionEnum.class);
private static Map codesByName = getCodesByName();
- private static String[] namesByCode = getNamesByCode();
+ private static final String[] namesByCode = getNamesByCode();
private final Class extends Exception> exceptionClass;
private final int resultCode;
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/errorhandling/HashedCQLErrorHandler.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/errorhandling/HashedCQLErrorHandler.java
index 8d4cae63c..6d5dd4ef5 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/errorhandling/HashedCQLErrorHandler.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/errorhandling/HashedCQLErrorHandler.java
@@ -16,18 +16,18 @@ import io.nosqlbench.activitytype.cqld4.errorhandling.exceptions.RowVerification
import io.nosqlbench.engine.api.activityapi.errorhandling.CycleErrorHandler;
import io.nosqlbench.engine.api.activityapi.errorhandling.HashedErrorHandler;
import io.nosqlbench.engine.api.metrics.ExceptionCountMetrics;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
public class HashedCQLErrorHandler extends HashedErrorHandler {
- private static final Logger logger = LoggerFactory.getLogger(HashedCQLErrorHandler.class);
+ private static final Logger logger = LogManager.getLogger(HashedCQLErrorHandler.class);
// private static Set> UNVERIFIED_ERRORS = new HashSet>() {{
// add(RowVerificationException.class);
// add(ResultSetVerificationException.class);
// }};
- private ExceptionCountMetrics exceptionCountMetrics;
- private static ThreadLocal tlResultCode = ThreadLocal.withInitial(() -> (0));
+ private final ExceptionCountMetrics exceptionCountMetrics;
+ private static final ThreadLocal tlResultCode = ThreadLocal.withInitial(() -> (0));
public HashedCQLErrorHandler(ExceptionCountMetrics exceptionCountMetrics) {
this.exceptionCountMetrics = exceptionCountMetrics;
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/errorhandling/NBCycleErrorHandler.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/errorhandling/NBCycleErrorHandler.java
index 0f6fb88c6..526a0e683 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/errorhandling/NBCycleErrorHandler.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/errorhandling/NBCycleErrorHandler.java
@@ -5,8 +5,8 @@ import io.nosqlbench.activitytype.cqld4.errorhandling.exceptions.CQLCycleWithSta
import io.nosqlbench.engine.api.activityapi.errorhandling.CycleErrorHandler;
import io.nosqlbench.engine.api.metrics.ExceptionCountMetrics;
import io.nosqlbench.engine.api.metrics.ExceptionHistoMetrics;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* A contextualized error handler that can catch a cycle-specific error.
@@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory;
@SuppressWarnings("Duplicates")
public class NBCycleErrorHandler implements CycleErrorHandler {
- private static final Logger logger = LoggerFactory.getLogger(NBCycleErrorHandler.class);
+ private static final Logger logger = LogManager.getLogger(NBCycleErrorHandler.class);
private final ErrorResponse errorResponse;
private final ExceptionCountMetrics exceptionCountMetrics;
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/binders/DiagnosticPreparedBinder.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/binders/DiagnosticPreparedBinder.java
index 354d71746..71dc6c48d 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/binders/DiagnosticPreparedBinder.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/binders/DiagnosticPreparedBinder.java
@@ -5,8 +5,8 @@ import com.datastax.oss.driver.api.core.cql.*;
import com.datastax.oss.driver.api.core.type.DataType;
import io.nosqlbench.activitytype.cqld4.core.CQLBindHelper;
import io.nosqlbench.virtdata.core.bindings.ValuesArrayBinder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.ArrayList;
import java.util.List;
@@ -19,7 +19,7 @@ import java.util.List;
*/
public class DiagnosticPreparedBinder implements ValuesArrayBinder> {
- public static final Logger logger = LoggerFactory.getLogger(DiagnosticPreparedBinder.class);
+ public static final Logger logger = LogManager.getLogger(DiagnosticPreparedBinder.class);
private final CqlSession session;
public DiagnosticPreparedBinder(CqlSession session) {
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/binders/DirectArrayValuesBinder.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/binders/DirectArrayValuesBinder.java
index 2b10dba55..1341b5207 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/binders/DirectArrayValuesBinder.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/binders/DirectArrayValuesBinder.java
@@ -4,8 +4,8 @@ import com.datastax.oss.driver.api.core.CqlSession;
import com.datastax.oss.driver.api.core.cql.PreparedStatement;
import com.datastax.oss.driver.api.core.cql.Statement;
import io.nosqlbench.virtdata.core.bindings.ValuesArrayBinder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.Arrays;
@@ -20,7 +20,7 @@ import java.util.Arrays;
* will become the default.
*/
public class DirectArrayValuesBinder implements ValuesArrayBinder> {
- public final static Logger logger = LoggerFactory.getLogger(DirectArrayValuesBinder.class);
+ public final static Logger logger = LogManager.getLogger(DirectArrayValuesBinder.class);
private final CqlSession session;
public DirectArrayValuesBinder(CqlSession session) {
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/binders/UnsettableValuesBinder.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/binders/UnsettableValuesBinder.java
index 25177543c..d9048a397 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/binders/UnsettableValuesBinder.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/binders/UnsettableValuesBinder.java
@@ -1,6 +1,5 @@
package io.nosqlbench.activitytype.cqld4.statements.binders;
-import com.datastax.driver.core.*;
import com.datastax.oss.driver.api.core.ProtocolVersion;
import com.datastax.oss.driver.api.core.cql.*;
import com.datastax.oss.driver.api.core.session.Session;
@@ -9,16 +8,15 @@ import com.datastax.oss.driver.api.core.type.codec.TypeCodec;
import com.datastax.oss.driver.api.core.type.codec.registry.CodecRegistry;
import io.nosqlbench.virtdata.api.bindings.VALUE;
import io.nosqlbench.virtdata.core.bindings.ValuesArrayBinder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import java.nio.ByteBuffer;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
public class UnsettableValuesBinder implements ValuesArrayBinder> {
- private final static Logger logger = LoggerFactory.getLogger(UnsettableValuesBinder.class);
+ private final static Logger logger = LogManager.getLogger(UnsettableValuesBinder.class);
private final Session session;
private final CodecRegistry codecRegistry;
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/CQLSessionCache.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/CQLSessionCache.java
index 9aaae99ed..7026e7fa7 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/CQLSessionCache.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/CQLSessionCache.java
@@ -23,8 +23,8 @@ import io.nosqlbench.engine.api.scripting.NashornEvaluator;
import io.nosqlbench.engine.api.util.SSLKsFactory;
import org.apache.tinkerpop.gremlin.driver.Cluster;
import org.graalvm.options.OptionMap;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.io.File;
import java.io.IOException;
@@ -37,10 +37,10 @@ import java.util.concurrent.ConcurrentHashMap;
public class CQLSessionCache implements Shutdownable {
- private final static Logger logger = LoggerFactory.getLogger(CQLSessionCache.class);
+ private final static Logger logger = LogManager.getLogger(CQLSessionCache.class);
private final static String DEFAULT_SESSION_ID = "default";
- private static CQLSessionCache instance = new CQLSessionCache();
- private Map sessionCache = new HashMap<>();
+ private static final CQLSessionCache instance = new CQLSessionCache();
+ private final Map sessionCache = new HashMap<>();
public final static class SessionConfig extends ConcurrentHashMap {
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/CQLStatementDef.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/CQLStatementDef.java
index 33cdca1ce..cf236d32a 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/CQLStatementDef.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/CQLStatementDef.java
@@ -1,14 +1,14 @@
package io.nosqlbench.activitytype.cqld4.statements.core;
import com.datastax.oss.driver.api.core.ConsistencyLevel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.*;
import java.util.stream.Collectors;
public class CQLStatementDef {
- private final static Logger logger = LoggerFactory.getLogger(CQLStatementDef.class);
+ private final static Logger logger = LogManager.getLogger(CQLStatementDef.class);
private Map params = new HashMap<>();
private String name = "";
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/CQLStatementDefParser.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/CQLStatementDefParser.java
index a750a8cc9..361ca7edf 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/CQLStatementDefParser.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/CQLStatementDefParser.java
@@ -1,7 +1,7 @@
package io.nosqlbench.activitytype.cqld4.statements.core;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.*;
import java.util.regex.Matcher;
@@ -9,7 +9,7 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
public class CQLStatementDefParser {
- private final static Logger logger = LoggerFactory.getLogger(CQLStatementDefParser.class);
+ private final static Logger logger = LogManager.getLogger(CQLStatementDefParser.class);
// private final static Pattern templateToken = Pattern.compile("<<(\\w+(:(.+?))?)>>");
private final static Pattern stmtToken = Pattern.compile("\\?(\\w+[-_\\d\\w]*)|\\{(\\w+[-_\\d\\w.]*)}");
private final static String UNSET_VALUE = "UNSET-VALUE";
@@ -93,9 +93,7 @@ public class CQLStatementDefParser {
if (!namedBindings.contains(tokenName)) {
missingBindings.add(tokenName);
} else {
- if (missingAnchors.contains(tokenName)) {
- missingAnchors.remove(tokenName);
- }
+ missingAnchors.remove(tokenName);
}
}
@@ -114,11 +112,11 @@ public class CQLStatementDefParser {
}
public static class ParseResult {
- private Set missingGenerators;
- private Set missingAnchors;
- private String statement;
+ private final Set missingGenerators;
+ private final Set missingAnchors;
+ private final String statement;
private Map bindings;
- private String name;
+ private final String name;
public ParseResult(String stmt, String name, Map bindings, Set missingGenerators, Set missingAnchors) {
this.missingGenerators = missingGenerators;
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/ReadyCQLStatementTemplate.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/ReadyCQLStatementTemplate.java
index d29c7219f..8496ea6e0 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/ReadyCQLStatementTemplate.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/ReadyCQLStatementTemplate.java
@@ -16,15 +16,15 @@ import io.nosqlbench.engine.api.metrics.ActivityMetrics;
import io.nosqlbench.virtdata.core.bindings.BindingsTemplate;
import io.nosqlbench.virtdata.core.bindings.ContextualBindingsArrayTemplate;
import io.nosqlbench.virtdata.core.bindings.ValuesArrayBinder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.io.Writer;
import java.util.Map;
public class ReadyCQLStatementTemplate {
- private final static Logger logger = LoggerFactory.getLogger(ReadyCQLStatementTemplate.class);
+ private final static Logger logger = LogManager.getLogger(ReadyCQLStatementTemplate.class);
private final Session session;
private final ContextualBindingsArrayTemplate, Statement>> template;
private final long ratio;
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/YamlCQLStatementLoader.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/YamlCQLStatementLoader.java
index 8eaf8fced..9806c9876 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/YamlCQLStatementLoader.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/core/YamlCQLStatementLoader.java
@@ -3,8 +3,8 @@ package io.nosqlbench.activitytype.cqld4.statements.core;
import io.nosqlbench.engine.api.activityimpl.ActivityInitializationError;
import io.nosqlbench.nb.api.content.Content;
import io.nosqlbench.nb.api.content.NBIO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import org.yaml.snakeyaml.TypeDescription;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
@@ -17,7 +17,7 @@ import java.util.function.Function;
@SuppressWarnings("ALL")
public class YamlCQLStatementLoader {
- private final static Logger logger = LoggerFactory.getLogger(YamlCQLStatementLoader.class);
+ private final static Logger logger = LogManager.getLogger(YamlCQLStatementLoader.class);
List> transformers = new ArrayList<>();
public YamlCQLStatementLoader() {
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rowoperators/Save.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rowoperators/Save.java
index fc01f6934..99fefc89b 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rowoperators/Save.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rowoperators/Save.java
@@ -4,8 +4,8 @@ import com.datastax.oss.driver.api.core.cql.ColumnDefinition;
import com.datastax.oss.driver.api.core.cql.Row;
import io.nosqlbench.activitytype.cqld4.api.RowCycleOperator;
import io.nosqlbench.virtdata.library.basics.core.threadstate.SharedState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.Arrays;
import java.util.HashMap;
@@ -17,11 +17,11 @@ import java.util.stream.StreamSupport;
* Save specific variables to the thread local object map
*/
public class Save implements RowCycleOperator {
- private final static Logger logger = LoggerFactory.getLogger(Save.class);
+ private final static Logger logger = LogManager.getLogger(Save.class);
ThreadLocal> tl_objectMap = SharedState.tl_ObjectMap;
- private String[] varnames;
+ private final String[] varnames;
public Save(String... varnames) {
this.varnames = varnames;
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rsoperators/CqlD4ResultSetLogger.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rsoperators/CqlD4ResultSetLogger.java
index 8ddce18c7..57e6b3863 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rsoperators/CqlD4ResultSetLogger.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rsoperators/CqlD4ResultSetLogger.java
@@ -2,15 +2,15 @@ package io.nosqlbench.activitytype.cqld4.statements.rsoperators;
import com.datastax.oss.driver.api.core.cql.*;
import io.nosqlbench.activitytype.cqld4.api.D4ResultSetCycleOperator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* Logs a trace-level event for the result set, including
* cycles, rows, fetched row count, and the statement.
*/
public class CqlD4ResultSetLogger implements D4ResultSetCycleOperator {
- private final static Logger logger = LoggerFactory.getLogger(CqlD4ResultSetLogger.class);
+ private final static Logger logger = LogManager.getLogger(CqlD4ResultSetLogger.class);
private static String getQueryString(Statement stmt) {
if (stmt instanceof PreparedStatement) {
diff --git a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rsoperators/TraceLogger.java b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rsoperators/TraceLogger.java
index 263197529..c38189e96 100644
--- a/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rsoperators/TraceLogger.java
+++ b/driver-cqld4/src/main/java/io/nosqlbench/activitytype/cqld4/statements/rsoperators/TraceLogger.java
@@ -4,8 +4,8 @@ import com.datastax.oss.driver.api.core.cql.*;
import io.nosqlbench.activitytype.cqld4.api.D4ResultSetCycleOperator;
import io.nosqlbench.activitytype.cqld4.core.StatementModifier;
import io.nosqlbench.engine.api.util.SimpleConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.io.FileDescriptor;
import java.io.FileWriter;
@@ -15,9 +15,9 @@ import java.util.Date;
public class TraceLogger implements D4ResultSetCycleOperator, StatementModifier {
- private final static Logger logger = LoggerFactory.getLogger(TraceLogger.class);
+ private final static Logger logger = LogManager.getLogger(TraceLogger.class);
- private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.SSS");
+ private static final SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.SSS");
private final long modulo;
private final String filename;
private final FileWriter writer;
diff --git a/driver-cqlverify/src/main/java/io/nosqlbench/activitytype/cqlverify/CqlVerifyActivity.java b/driver-cqlverify/src/main/java/io/nosqlbench/activitytype/cqlverify/CqlVerifyActivity.java
index d20f479a9..487008c89 100644
--- a/driver-cqlverify/src/main/java/io/nosqlbench/activitytype/cqlverify/CqlVerifyActivity.java
+++ b/driver-cqlverify/src/main/java/io/nosqlbench/activitytype/cqlverify/CqlVerifyActivity.java
@@ -5,8 +5,8 @@ import io.nosqlbench.activitytype.cql.statements.rsoperators.AssertSingleRowResu
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
import io.nosqlbench.virtdata.core.bindings.Bindings;
import io.nosqlbench.virtdata.core.bindings.BindingsTemplate;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.ArrayList;
import java.util.List;
@@ -15,7 +15,7 @@ import java.util.Optional;
public class CqlVerifyActivity extends CqlActivity {
- private final static Logger logger = LoggerFactory.getLogger(CqlVerifyActivity.class);
+ private final static Logger logger = LogManager.getLogger(CqlVerifyActivity.class);
private BindingsTemplate expectedValuesTemplate;
private VerificationMetrics verificationMetrics;
diff --git a/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/AsyncDiagAction.java b/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/AsyncDiagAction.java
index d2d127167..1f67a1016 100644
--- a/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/AsyncDiagAction.java
+++ b/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/AsyncDiagAction.java
@@ -24,8 +24,8 @@ import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.op_output.StrideOut
import io.nosqlbench.engine.api.activityapi.ratelimits.RateLimiter;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
import io.nosqlbench.engine.api.activityimpl.ParameterMap;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.util.List;
import java.util.concurrent.BlockingQueue;
@@ -38,7 +38,7 @@ import java.util.stream.Collectors;
public class AsyncDiagAction extends BaseAsyncAction implements Thread.UncaughtExceptionHandler, StrideOutputConsumer {
- private final static Logger logger = LoggerFactory.getLogger(AsyncDiagAction.class);
+ private final static Logger logger = LogManager.getLogger(AsyncDiagAction.class);
private long lastUpdate;
private long quantizedInterval;
@@ -213,8 +213,8 @@ public class AsyncDiagAction extends BaseAsyncAction i
private final AsyncDiagAction action;
AsyncDiagAction mainContext;
private volatile boolean running = true;
- private Thread thread;
- private String name;
+ private final Thread thread;
+ private final String name;
public OpFinisher(String name, BlockingQueue> queue, AsyncDiagAction action) {
this.queue = queue;
diff --git a/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/DiagAction.java b/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/DiagAction.java
index 0bab6740e..5f84a400c 100644
--- a/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/DiagAction.java
+++ b/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/DiagAction.java
@@ -20,16 +20,16 @@ import io.nosqlbench.engine.api.activityapi.core.MultiPhaseAction;
import io.nosqlbench.engine.api.activityapi.core.SyncAction;
import io.nosqlbench.engine.api.activityapi.ratelimits.RateLimiter;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
public class DiagAction implements SyncAction, ActivityDefObserver, MultiPhaseAction {
- private final static Logger logger = LoggerFactory.getLogger(DiagAction.class);
+ private final static Logger logger = LogManager.getLogger(DiagAction.class);
private final ActivityDef activityDef;
private final DiagActivity diagActivity;
- private int slot;
+ private final int slot;
private long lastUpdate;
private long quantizedInterval;
private long reportModulo;
diff --git a/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/DiagActionDispenser.java b/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/DiagActionDispenser.java
index 1ff3a45c3..c961844f1 100644
--- a/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/DiagActionDispenser.java
+++ b/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/DiagActionDispenser.java
@@ -16,14 +16,13 @@ package io.nosqlbench.activitytype.diag;
import io.nosqlbench.engine.api.activityapi.core.Action;
import io.nosqlbench.engine.api.activityapi.core.ActionDispenser;
-import org.slf4j.Logger;
-
-import static org.slf4j.LoggerFactory.getLogger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
public class DiagActionDispenser implements ActionDispenser {
- private final static Logger logger = getLogger(DiagActionDispenser.class);
- private DiagActivity activity;
+ private final static Logger logger = LogManager.getLogger(DiagActionDispenser.class);
+ private final DiagActivity activity;
public DiagActionDispenser(DiagActivity activity) {
this.activity = activity;
diff --git a/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/DiagActivityType.java b/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/DiagActivityType.java
index 8196384c5..27083fe2f 100644
--- a/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/DiagActivityType.java
+++ b/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/DiagActivityType.java
@@ -19,8 +19,8 @@ import io.nosqlbench.engine.api.activityapi.core.ActionDispenser;
import io.nosqlbench.engine.api.activityapi.core.ActivityType;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
import io.nosqlbench.nb.annotations.Service;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* The DiagActivity, aka "diag", is simply a diagnostic activity.
@@ -33,7 +33,7 @@ import org.slf4j.LoggerFactory;
@Service(ActivityType.class)
public class DiagActivityType implements ActivityType {
- private static final Logger logger = LoggerFactory.getLogger(DiagActivityType.class);
+ private static final Logger logger = LogManager.getLogger(DiagActivityType.class);
@Override
public String getName() {
diff --git a/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/SequenceBlocker.java b/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/SequenceBlocker.java
index af96a1225..550cb353d 100644
--- a/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/SequenceBlocker.java
+++ b/driver-diag/src/main/java/io/nosqlbench/activitytype/diag/SequenceBlocker.java
@@ -17,14 +17,14 @@
package io.nosqlbench.activitytype.diag;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.security.InvalidParameterException;
import java.util.concurrent.atomic.AtomicLong;
public class SequenceBlocker {
- private final static Logger logger = LoggerFactory.getLogger(SequenceBlocker.class);
+ private final static Logger logger = LogManager.getLogger(SequenceBlocker.class);
private final AtomicLong sequence;
private final AtomicLong waiting=new AtomicLong(0L);
private final boolean errorsAreFatal;
diff --git a/driver-http/src/main/java/io/nosqlbench/activitytype/http/HttpAction.java b/driver-http/src/main/java/io/nosqlbench/activitytype/http/HttpAction.java
index 327b79c6c..b97425c47 100644
--- a/driver-http/src/main/java/io/nosqlbench/activitytype/http/HttpAction.java
+++ b/driver-http/src/main/java/io/nosqlbench/activitytype/http/HttpAction.java
@@ -8,8 +8,8 @@ import io.nosqlbench.engine.api.activityapi.planning.OpSequence;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
import io.nosqlbench.nb.api.errors.BasicError;
import io.nosqlbench.virtdata.core.templates.StringBindings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.io.*;
import java.net.http.HttpClient;
@@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit;
public class HttpAction implements SyncAction {
- private final static Logger logger = LoggerFactory.getLogger(HttpAction.class);
+ private final static Logger logger = LogManager.getLogger(HttpAction.class);
private final HttpActivity httpActivity;
private final int slot;
diff --git a/driver-http/src/main/java/io/nosqlbench/activitytype/http/HttpActivity.java b/driver-http/src/main/java/io/nosqlbench/activitytype/http/HttpActivity.java
index f0169b7b6..01d40da6c 100644
--- a/driver-http/src/main/java/io/nosqlbench/activitytype/http/HttpActivity.java
+++ b/driver-http/src/main/java/io/nosqlbench/activitytype/http/HttpActivity.java
@@ -10,14 +10,14 @@ import io.nosqlbench.engine.api.activityapi.planning.OpSequence;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
import io.nosqlbench.engine.api.activityimpl.SimpleActivity;
import io.nosqlbench.engine.api.metrics.ActivityMetrics;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.net.http.HttpClient;
import java.util.function.Function;
public class HttpActivity extends SimpleActivity implements Activity, ActivityDefObserver {
- private final static Logger logger = LoggerFactory.getLogger(HttpActivity.class);
+ private final static Logger logger = LogManager.getLogger(HttpActivity.class);
private final ActivityDef activityDef;
public HttpConsoleFormats console;
diff --git a/driver-http/src/main/java/io/nosqlbench/activitytype/http/HttpActivityType.java b/driver-http/src/main/java/io/nosqlbench/activitytype/http/HttpActivityType.java
index 800e5bd24..6d24956dc 100644
--- a/driver-http/src/main/java/io/nosqlbench/activitytype/http/HttpActivityType.java
+++ b/driver-http/src/main/java/io/nosqlbench/activitytype/http/HttpActivityType.java
@@ -4,13 +4,13 @@ import io.nosqlbench.engine.api.activityapi.core.ActionDispenser;
import io.nosqlbench.engine.api.activityapi.core.ActivityType;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
import io.nosqlbench.nb.annotations.Service;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
@Service(ActivityType.class)
public class HttpActivityType implements ActivityType {
- private static final Logger logger = LoggerFactory.getLogger(HttpActivityType.class);
+ private static final Logger logger = LogManager.getLogger(HttpActivityType.class);
@Override
public String getName() {
diff --git a/driver-http/src/main/java/io/nosqlbench/activitytype/http/async/HttpAsyncAction.java b/driver-http/src/main/java/io/nosqlbench/activitytype/http/async/HttpAsyncAction.java
index 676e335e6..461a66088 100644
--- a/driver-http/src/main/java/io/nosqlbench/activitytype/http/async/HttpAsyncAction.java
+++ b/driver-http/src/main/java/io/nosqlbench/activitytype/http/async/HttpAsyncAction.java
@@ -7,8 +7,8 @@ import io.nosqlbench.activitytype.http.HttpActivity;
import io.nosqlbench.engine.api.activityapi.core.BaseAsyncAction;
import io.nosqlbench.engine.api.activityapi.core.ops.fluent.opfacets.TrackedOp;
import io.nosqlbench.engine.api.activityapi.planning.OpSequence;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.net.http.HttpClient;
import java.net.http.HttpResponse;
@@ -17,7 +17,7 @@ import java.util.function.LongFunction;
public class HttpAsyncAction extends BaseAsyncAction {
- private final static Logger logger = LoggerFactory.getLogger(HttpAsyncAction.class);
+ private final static Logger logger = LogManager.getLogger(HttpAsyncAction.class);
private OpSequence sequencer;
private HttpClient client;
diff --git a/driver-jmx/src/main/java/io/nosqlbench/driver/jmx/JMXAction.java b/driver-jmx/src/main/java/io/nosqlbench/driver/jmx/JMXAction.java
index fdd6d0010..b5e22ed46 100644
--- a/driver-jmx/src/main/java/io/nosqlbench/driver/jmx/JMXAction.java
+++ b/driver-jmx/src/main/java/io/nosqlbench/driver/jmx/JMXAction.java
@@ -4,12 +4,12 @@ import io.nosqlbench.driver.jmx.ops.JmxOp;
import io.nosqlbench.engine.api.activityapi.core.SyncAction;
import io.nosqlbench.engine.api.activityapi.planning.OpSequence;
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
public class JMXAction implements SyncAction {
- private final static Logger logger = LoggerFactory.getLogger(JMXAction.class);
+ private final static Logger logger = LogManager.getLogger(JMXAction.class);
private final ActivityDef activityDef;
private final int slot;
diff --git a/driver-jmx/src/main/java/io/nosqlbench/driver/jmx/SecureUtils.java b/driver-jmx/src/main/java/io/nosqlbench/driver/jmx/SecureUtils.java
index e103540bd..7934ecbe7 100644
--- a/driver-jmx/src/main/java/io/nosqlbench/driver/jmx/SecureUtils.java
+++ b/driver-jmx/src/main/java/io/nosqlbench/driver/jmx/SecureUtils.java
@@ -1,16 +1,15 @@
package io.nosqlbench.driver.jmx;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
-import java.io.Console;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
public class SecureUtils {
- private final static Logger logger = LoggerFactory.getLogger(SecureUtils.class);
+ private final static Logger logger = LogManager.getLogger(SecureUtils.class);
public static String readSecret(String description, String source) {
if (source==null) {
diff --git a/driver-jmx/src/main/java/io/nosqlbench/driver/jmx/ops/JmxOp.java b/driver-jmx/src/main/java/io/nosqlbench/driver/jmx/ops/JmxOp.java
index 99a5985ae..abd006fa8 100644
--- a/driver-jmx/src/main/java/io/nosqlbench/driver/jmx/ops/JmxOp.java
+++ b/driver-jmx/src/main/java/io/nosqlbench/driver/jmx/ops/JmxOp.java
@@ -1,7 +1,7 @@
package io.nosqlbench.driver.jmx.ops;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
@@ -12,7 +12,7 @@ import javax.management.remote.JMXConnector;
*/
public abstract class JmxOp {
- protected final static Logger logger = LoggerFactory.getLogger(JmxOp.class);
+ protected final static Logger logger = LogManager.getLogger(JmxOp.class);
protected JMXConnector connector;
protected ObjectName objectName;
diff --git a/driver-kafka/src/main/java/com/datastax/ebdrivers/kafkaproducer/KafkaAction.java b/driver-kafka/src/main/java/com/datastax/ebdrivers/kafkaproducer/KafkaAction.java
index f01b3e82b..c34143c2c 100644
--- a/driver-kafka/src/main/java/com/datastax/ebdrivers/kafkaproducer/KafkaAction.java
+++ b/driver-kafka/src/main/java/com/datastax/ebdrivers/kafkaproducer/KafkaAction.java
@@ -2,13 +2,13 @@ package com.datastax.ebdrivers.kafkaproducer;
import io.nosqlbench.engine.api.activityapi.core.SyncAction;
import io.nosqlbench.engine.api.activityapi.planning.OpSequence;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
public class KafkaAction implements SyncAction {
- private final static Logger logger = LoggerFactory.getLogger(KafkaAction.class);
+ private final static Logger logger = LogManager.getLogger(KafkaAction.class);
private final KafkaProducerActivity activity;
private final int slot;
diff --git a/driver-kafka/src/main/java/com/datastax/ebdrivers/kafkaproducer/KafkaProducerActivity.java b/driver-kafka/src/main/java/com/datastax/ebdrivers/kafkaproducer/KafkaProducerActivity.java
index 30189c531..54ec6513b 100644
--- a/driver-kafka/src/main/java/com/datastax/ebdrivers/kafkaproducer/KafkaProducerActivity.java
+++ b/driver-kafka/src/main/java/com/datastax/ebdrivers/kafkaproducer/KafkaProducerActivity.java
@@ -4,7 +4,6 @@ import com.codahale.metrics.Timer;
import io.nosqlbench.engine.api.activityapi.planning.OpSequence;
import io.nosqlbench.engine.api.activityapi.planning.SequencePlanner;
import io.nosqlbench.engine.api.activityapi.planning.SequencerType;
-import io.nosqlbench.engine.api.activityconfig.ParsedStmt;
import io.nosqlbench.engine.api.activityconfig.StatementsLoader;
import io.nosqlbench.engine.api.activityconfig.yaml.OpTemplate;
import io.nosqlbench.engine.api.activityconfig.yaml.StmtsDocList;
@@ -12,22 +11,15 @@ import io.nosqlbench.engine.api.activityimpl.ActivityDef;
import io.nosqlbench.engine.api.activityimpl.SimpleActivity;
import io.nosqlbench.engine.api.metrics.ActivityMetrics;
import io.nosqlbench.engine.api.templating.StrInterpolator;
-import io.nosqlbench.virtdata.core.bindings.BindingsTemplate;
-import io.nosqlbench.virtdata.core.templates.StringBindings;
-import io.nosqlbench.virtdata.core.templates.StringBindingsTemplate;
-import org.apache.kafka.clients.producer.*;
-import org.apache.kafka.common.serialization.StringSerializer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
-import java.util.*;
-import java.util.concurrent.Future;
-import java.util.function.Function;
-import java.util.regex.Pattern;
+import java.util.Arrays;
+import java.util.List;
import java.util.stream.Collectors;
public class KafkaProducerActivity extends SimpleActivity {
- private final static Logger logger = LoggerFactory.getLogger(KafkaProducerActivity.class);
+ private final static Logger logger = LogManager.getLogger(KafkaProducerActivity.class);
private String yamlLoc;
private String clientId;
private String servers;
diff --git a/driver-kafka/src/main/java/com/datastax/ebdrivers/kafkaproducer/KafkaStatement.java b/driver-kafka/src/main/java/com/datastax/ebdrivers/kafkaproducer/KafkaStatement.java
index e0323248c..20796b233 100644
--- a/driver-kafka/src/main/java/com/datastax/ebdrivers/kafkaproducer/KafkaStatement.java
+++ b/driver-kafka/src/main/java/com/datastax/ebdrivers/kafkaproducer/KafkaStatement.java
@@ -9,8 +9,8 @@ import io.nosqlbench.virtdata.core.templates.StringBindings;
import io.nosqlbench.virtdata.core.templates.StringBindingsTemplate;
import org.apache.kafka.clients.producer.*;
import org.apache.kafka.common.serialization.StringSerializer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.io.IOException;
import java.nio.file.Files;
@@ -20,7 +20,7 @@ import java.util.Properties;
import java.util.concurrent.Future;
public class KafkaStatement {
- private final static Logger logger = LoggerFactory.getLogger(KafkaStatement.class);
+ private final static Logger logger = LogManager.getLogger(KafkaStatement.class);
private Producer