mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
jshook/nosqlbench-2055-mapfix2 (#2144)
* HOF component funcs inherit default input type from parent * minor fixes to test * fix for preview action syntax
This commit is contained in:
parent
54a3569ce5
commit
c0db7a195a
@ -117,9 +117,11 @@ public class VirtDataComposer {
|
|||||||
|
|
||||||
for (int pos = 0; pos <fargs.length; pos++) { // Resolve functions recursively if needed
|
for (int pos = 0; pos <fargs.length; pos++) { // Resolve functions recursively if needed
|
||||||
Object param = fargs[pos];
|
Object param = fargs[pos];
|
||||||
if (param instanceof FunctionCall) {
|
if (param instanceof FunctionCall innerFcall) {
|
||||||
|
if (innerFcall.getInputType()==null) {
|
||||||
List<ResolvedFunction> resolvedAt = resolve(diagnostics, (FunctionCall) param, cconfig);
|
innerFcall.setInputType(fcall.getInputType());
|
||||||
|
}
|
||||||
|
List<ResolvedFunction> resolvedAt = resolve(diagnostics, innerFcall, cconfig);
|
||||||
Object[] pfuncs = new Object[resolvedAt.size()];
|
Object[] pfuncs = new Object[resolvedAt.size()];
|
||||||
for (int pfunc = 0; pfunc < pfuncs.length; pfunc++) {
|
for (int pfunc = 0; pfunc < pfuncs.length; pfunc++) {
|
||||||
pfuncs[pfunc]=resolvedAt.get(pfunc).getFunctionObject();
|
pfuncs[pfunc]=resolvedAt.get(pfunc).getFunctionObject();
|
||||||
@ -167,6 +169,11 @@ public class VirtDataComposer {
|
|||||||
|
|
||||||
for (int i = flow.getExpressions().size() - 1; i >= 0; i--) {
|
for (int i = flow.getExpressions().size() - 1; i >= 0; i--) {
|
||||||
FunctionCall call = flow.getExpressions().get(i).getCall();
|
FunctionCall call = flow.getExpressions().get(i).getCall();
|
||||||
|
if (flow.getExpressions().size()==1) {
|
||||||
|
if (call.getInputType()==null) {
|
||||||
|
call.setInputType("long");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
diagnostics.trace("FUNCTION[" + i + "]: " + call.toString() + ", resolving args");
|
diagnostics.trace("FUNCTION[" + i + "]: " + call.toString() + ", resolving args");
|
||||||
|
|
||||||
@ -306,7 +313,8 @@ public class VirtDataComposer {
|
|||||||
* @param funcs the list of candidate functions offered at each phase, in List<List> form.
|
* @param funcs the list of candidate functions offered at each phase, in List<List> form.
|
||||||
* @return a List of resolved functions that has been fully optimized
|
* @return a List of resolved functions that has been fully optimized
|
||||||
*/
|
*/
|
||||||
private List<ResolvedFunction> optimizePath(List<List<ResolvedFunction>> funcs, Class<?> type) {
|
public List<ResolvedFunction> optimizePath(List<List<ResolvedFunction>> funcs,
|
||||||
|
Class<?> type) {
|
||||||
List<ResolvedFunction> prevFuncs = null;
|
List<ResolvedFunction> prevFuncs = null;
|
||||||
List<ResolvedFunction> nextFuncs = null;
|
List<ResolvedFunction> nextFuncs = null;
|
||||||
int progress = -1;
|
int progress = -1;
|
||||||
@ -345,12 +353,18 @@ public class VirtDataComposer {
|
|||||||
progress += reduceByPreferredResultTypes(funcs.get(0));
|
progress += reduceByPreferredResultTypes(funcs.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (List<ResolvedFunction> func : funcs) {
|
||||||
|
func.sort(ResolvedFunction.PREFERRED_TYPE_COMPARATOR);
|
||||||
|
}
|
||||||
|
|
||||||
List<ResolvedFunction> optimized = funcs.stream().map(l -> l.get(0)).collect(Collectors.toList());
|
List<ResolvedFunction> optimized = funcs.stream().map(l -> l.get(0)).collect(Collectors.toList());
|
||||||
|
|
||||||
return optimized;
|
return optimized;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int reduceByRequiredResultsType(List<ResolvedFunction> endFuncs, Class<?> resultType) {
|
public int reduceByRequiredResultsType(List<ResolvedFunction> endFuncs,
|
||||||
|
Class<?> resultType) {
|
||||||
int progressed = 0;
|
int progressed = 0;
|
||||||
LinkedList<ResolvedFunction> tmpList = new LinkedList<>(endFuncs);
|
LinkedList<ResolvedFunction> tmpList = new LinkedList<>(endFuncs);
|
||||||
for (ResolvedFunction endFunc : tmpList) {
|
for (ResolvedFunction endFunc : tmpList) {
|
||||||
|
@ -65,7 +65,8 @@ class ExitStatusIntegrationTests {
|
|||||||
|
|
||||||
// Forcing a thread exception via basic command issue.
|
// Forcing a thread exception via basic command issue.
|
||||||
ProcessResult result = invoker.run("exitstatus_threadexception", 30,
|
ProcessResult result = invoker.run("exitstatus_threadexception", 30,
|
||||||
"java", "--enable-preview", "-jar", JARNAME, "--logs-dir", "logs/test/threadexcep", "--logs-level",
|
java, "--enable-preview", "-jar", JARNAME, "--logs-dir", "logs/test/threadexcep",
|
||||||
|
"--logs-level",
|
||||||
"debug", "run",
|
"debug", "run",
|
||||||
"driver=diag", "cyclerate=10", "not_a_thing", "cycles=100", "-vvv"
|
"driver=diag", "cyclerate=10", "not_a_thing", "cycles=100", "-vvv"
|
||||||
);
|
);
|
||||||
@ -79,7 +80,8 @@ class ExitStatusIntegrationTests {
|
|||||||
ProcessInvoker invoker = new ProcessInvoker();
|
ProcessInvoker invoker = new ProcessInvoker();
|
||||||
invoker.setLogDir("logs/test");
|
invoker.setLogDir("logs/test");
|
||||||
ProcessResult result = invoker.run("exitstatus_asyncstoprequest", 60,
|
ProcessResult result = invoker.run("exitstatus_asyncstoprequest", 60,
|
||||||
"java", "--enable-preview", "-jar", JARNAME, "--logs-dir", "logs/test/asyncstop", "--logs-level", "debug", "run",
|
java, "--enable-preview", "-jar", JARNAME, "--logs-dir", "logs/test/asyncstop",
|
||||||
|
"--logs-level", "debug", "run",
|
||||||
"driver=diag", "threads=2", "cyclerate=10", "op=erroroncycle:erroroncycle=10", "cycles=50", "-vvv"
|
"driver=diag", "threads=2", "cyclerate=10", "op=erroroncycle:erroroncycle=10", "cycles=50", "-vvv"
|
||||||
);
|
);
|
||||||
assertThat(result.exception).isNull();
|
assertThat(result.exception).isNull();
|
||||||
|
Loading…
Reference in New Issue
Block a user