summaryrefslogtreecommitdiffstats
path: root/vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisit.java
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-12-05 13:56:34 +0100
committerTor Brede Vekterli <vekterli@yahooinc.com>2022-12-05 14:02:05 +0100
commit23e9f20ebc1b0d013bd3f95a9463a9fe92a2cb44 (patch)
tree0343335032ebc686ae2d91ebabacb46dfde982f3 /vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisit.java
parent8890a936e4fddea023fcb94b2841f5b4208ad908 (diff)
Add tensor short form output option to vespa-visit tool
Specified with `--tensor-short-form`. No single-char option alias, as short form output will be the default on Vespa 9 and we're running out of usable option characters for this tool anyway.
Diffstat (limited to 'vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisit.java')
-rw-r--r--vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisit.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisit.java b/vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisit.java
index 9a5df96b705..c022713cbb6 100644
--- a/vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisit.java
+++ b/vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisit.java
@@ -348,6 +348,13 @@ public class VdsVisit {
FixedBucketSpaces.defaultSpace(), FixedBucketSpaces.globalSpace(), FixedBucketSpaces.defaultSpace()))
.build());
+ // TODO Vespa 9 replace with --tensor-long-form ?
+ options.addOption(Option.builder()
+ .longOpt("tensor-short-form")
+ .desc("Output JSON tensors in short form. Will be the default on Vespa 9")
+ .hasArg(false)
+ .build());
+
return options;
}
@@ -363,6 +370,7 @@ public class VdsVisit {
private int processTime = 0;
private int fullTimeout = 7 * 24 * 60 * 60 * 1000;
private boolean jsonOutput = false;
+ private boolean tensorShortForm = false; // TODO Vespa 9: change default to true
public VisitorParameters getVisitorParameters() {
return visitorParameters;
@@ -431,6 +439,14 @@ public class VdsVisit {
public void setJsonOutput(boolean jsonOutput) {
this.jsonOutput = jsonOutput;
}
+
+ public boolean tensorShortForm() {
+ return tensorShortForm;
+ }
+
+ public void setTensorShortForm(boolean tensorShortForm) {
+ this.tensorShortForm = tensorShortForm;
+ }
}
protected static class ArgumentParser {
@@ -553,6 +569,9 @@ public class VdsVisit {
throttlePolicy.setMaxPendingCount(((Number)line.getParsedOptionValue("maxpendingsuperbuckets")).intValue());
params.setThrottlePolicy(throttlePolicy);
}
+ if (line.hasOption("tensor-short-form")) {
+ allParams.setTensorShortForm(true);
+ }
boolean jsonOutput = line.hasOption("jsonoutput");
boolean xmlOutput = line.hasOption("xmloutput");
@@ -723,7 +742,8 @@ public class VdsVisit {
params.getStatisticsParts() != null,
params.getAbortOnClusterDown(),
params.getProcessTime(),
- params.jsonOutput);
+ params.jsonOutput,
+ params.tensorShortForm);
if (visitorParameters.getResumeFileName() != null) {
handler.setProgressFileName(visitorParameters.getResumeFileName());