lay foundation for component hierarchy

This commit is contained in:
Jonathan Shook
2023-09-27 23:57:20 -05:00
parent 90519b9337
commit 40019912d3
9 changed files with 229 additions and 13 deletions

View File

@@ -72,7 +72,7 @@ import java.util.ServiceLoader.Provider;
import java.util.function.Function;
import java.util.stream.Collectors;
public class NBCLI implements Function<String[], Integer>, NBLabeledElement {
public class NBCLI implements Function<String[], Integer>, NBComponent {
private static Logger logger;
private static final LoggerConfig loggerConfig;
@@ -164,10 +164,11 @@ public class NBCLI implements Function<String[], Integer>, NBLabeledElement {
final NBCLIOptions globalOptions = new NBCLIOptions(args, Mode.ParseGlobalsOnly);
this.sessionCode = SystemId.genSessionCode(sessionTime);
this.sessionName = SessionNamer.format(globalOptions.getSessionName(),sessionTime).replaceAll("SESSIONCODE",sessionCode);
this.labels = NBLabels.forKV("appname", "nosqlbench")
.and("node",SystemId.getNodeId())
.and(globalOptions.getLabelMap());
this.sessionName = SessionNamer.format(globalOptions.getSessionName(), sessionTime).replaceAll("SESSIONCODE", sessionCode);
this.labels = NBLabels.forKV()
.and("appname", "nosqlbench")
.and("node", SystemId.getNodeId())
.and(globalOptions.getLabelMap());
NBCLI.loggerConfig
.setSessionName(sessionName)
@@ -599,4 +600,9 @@ public class NBCLI implements Function<String[], Integer>, NBLabeledElement {
public NBLabels getLabels() {
return labels;
}
@Override
public NBComponent getParent() {
return this;
}
}