Merge pull request #1970 from nosqlbench/my-astra-schema-examples

PR: QuickFix for Nested Templates + Sanitizing some block calls
This commit is contained in:
Jonathan Shook 2024-07-24 07:46:06 -05:00 committed by GitHub
commit 6115749098
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 24 additions and 24 deletions

View File

@ -10,7 +10,7 @@ scenarios:
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags==block:"main.*" cycles===TEMPLATE(main-cycles,10000000) threads=auto
astra:
schema: run driver=cql tags==block:schema-astra threads==1 cycles==UNDEF
schema: run driver=cql tags==block:schema_astra threads==1 cycles==UNDEF
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags==block:"main.*" cycles===TEMPLATE(main-cycles,10000000) threads=auto
basic_check:

View File

@ -14,7 +14,7 @@ scenarios:
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags=='block:main-.*' cycles===TEMPLATE(main-cycles,10000000) threads=auto
astra:
schema: run driver=cql tags==block:schema-astra threads==1 cycles==UNDEF
schema: run driver=cql tags==block:schema_astra threads==1 cycles==UNDEF
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags=='block:main-.*' cycles===TEMPLATE(main-cycles,10000000) threads=auto
basic_check:

View File

@ -11,7 +11,7 @@ scenarios:
main: run driver=cql tags==block:"main.*" cycles===TEMPLATE(main-cycles,10) threads=auto
# rampdown: run driver=cql tags==block:rampdown threads==1 cycles==UNDEF
astra:
schema: run driver=cql tags==block:schema-astra threads==1 cycles==UNDEF
schema: run driver=cql tags==block:schema_astra threads==1 cycles==UNDEF
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10) threads=auto
main: run driver=cql tags==block:"main.*" cycles===TEMPLATE(main-cycles,10) threads=auto
basic_check:

View File

@ -7,7 +7,7 @@ scenarios:
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags==block:main-*.* cycles===TEMPLATE(main-cycles,10000000) threads=auto
astra:
schema: run driver=cql tags==block:schema-astra threads==1 cycles==UNDEF
schema: run driver=cql tags==block:schema_astra threads==1 cycles==UNDEF
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags==block:main-*.* cycles===TEMPLATE(main-cycles,10000000) threads=auto
basic_check:

View File

@ -31,7 +31,7 @@ scenarios:
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,100) threads=auto
main: run driver=cql tags==block:"main.*" cycles===TEMPLATE(main-cycles,100) threads=auto
astra:
schema: run driver=cql tags==block:schema-astra threads==1 cycles==UNDEF
schema: run driver=cql tags==block:schema_astra threads==1 cycles==UNDEF
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,100) threads=auto
main: run driver=cql tags==block:"main.*" cycles===TEMPLATE(main-cycles,100) threads=auto
basic_check:

View File

@ -10,7 +10,7 @@ scenarios:
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags==block:"main.*" cycles===TEMPLATE(main-cycles,10000000) threads=auto
astra:
schema: run driver=cql tags==block:schema-astra threads==1 cycles==UNDEF
schema: run driver=cql tags==block:schema_astra threads==1 cycles==UNDEF
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags==block:"main.*" cycles===TEMPLATE(main-cycles,10000000) threads=auto
basic_check:

View File

@ -0,0 +1,4 @@
min_version: "5.21.0"
description: |
TBD, similar to find_one_and_delete.yaml

View File

@ -6,4 +6,4 @@ blocks:
list_collection_names:
ops:
op1:
list_collection_names:
list_collection_names: TBD

View File

@ -6,4 +6,4 @@ blocks:
list_collections:
ops:
op1:
list_collections:
list_collections: TBD

View File

@ -140,7 +140,7 @@ public class RawOpDef extends RawOpFields {
if (v == null) {
throw new OpConfigError("A map key '" + k.toString() + "' with a null value was encountered. This is not" +
" allowed, and may be the result of using an unquoted binding, like {" + k + "}. You can simply wrap this in quotes" +
" like \"{"+ k +"\"} to avoid interpreting this as a JSON map." +
" like \"{"+ k +"}\" to avoid interpreting this as a JSON map." +
(path.size()>0 ? String.join(".",path):""));
} else {
if (v instanceof Map) {

View File

@ -313,7 +313,7 @@ public class NBCLIScenarioPreprocessor {
}
private static final Pattern templatePattern = Pattern.compile("TEMPLATE\\((.+?)\\)");
private static final Pattern innerTemplatePattern = Pattern.compile("TEMPLATE\\((.+?)$");
private static final Pattern innerTemplatePattern = Pattern.compile("TEMPLATE\\((.+?)\\)");
private static final Pattern templatePattern2 = Pattern.compile("<<(.+?)>>");
public static List<WorkloadDesc> filterForScenarios(List<Content<?>> candidates) {
@ -444,22 +444,18 @@ public class NBCLIScenarioPreprocessor {
String match = matcher.group(1);
Matcher innerMatcher = innerTemplatePattern.matcher(match);
String[] matchArray = match.split("[,:]");
if (matchArray.length==1) {
matchArray = new String[]{matchArray[0],""};
}
// if (matchArray.length!=2) {
// throw new BasicError("TEMPLATE form must have two arguments separated by a comma, like 'TEMPLATE(a,b), not '" + match +"'");
// }
//TODO: support recursive matches
if (innerMatcher.find()) {
String[] innerMatch = innerMatcher.group(1).split("[,:]");
//We want the outer name with the inner default value
templates.put(matchArray[0], innerMatch[1]);
} else {
templates.put(matchArray[0], matchArray[1]);
String innerMatch = innerMatcher.group(1);
templates = matchTemplates("TEMPLATE(" + innerMatch + ")", templates);
String resolvedInner = templates.getOrDefault(innerMatch.split("[,:]")[0], "");
match = match.replace("TEMPLATE(" + innerMatch + ")", resolvedInner);
}
String[] matchArray = match.split("[,:]");
if (matchArray.length == 1) {
matchArray = new String[]{matchArray[0], ""};
}
templates.put(matchArray[0], matchArray[1]);
}
matcher = templatePattern2.matcher(line);