diff options
author | Geir Storli <geirst@oath.com> | 2018-02-02 13:10:30 +0100 |
---|---|---|
committer | Geir Storli <geirst@oath.com> | 2018-02-02 13:50:00 +0100 |
commit | 0c29fb32d7263487ce5d722e95e2fb89166b00c8 (patch) | |
tree | a36bb045c70c7281b30d839ae46814bba5106500 /vespaclient-java | |
parent | 711bf1a14c15796e7be2fa96f30d0ad816465288 (diff) |
Define and use fixed bucket spaces in Java code.
Diffstat (limited to 'vespaclient-java')
4 files changed, 10 insertions, 6 deletions
diff --git a/vespaclient-java/src/main/java/com/yahoo/vespastat/ClientParameters.java b/vespaclient-java/src/main/java/com/yahoo/vespastat/ClientParameters.java index a05e4ed1e48..3a51e9c858f 100644 --- a/vespaclient-java/src/main/java/com/yahoo/vespastat/ClientParameters.java +++ b/vespaclient-java/src/main/java/com/yahoo/vespastat/ClientParameters.java @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespastat; +import com.yahoo.document.FixedBucketSpaces; + /** * This class contains the program parameters. * @@ -25,7 +27,7 @@ public class ClientParameters { String route, SelectionType selectionType, String id) { - this(help, dumpData, route, selectionType, id, "default"); + this(help, dumpData, route, selectionType, id, FixedBucketSpaces.defaultSpace()); } public ClientParameters( @@ -51,7 +53,7 @@ public class ClientParameters { private String route; private SelectionType selectionType; private String id; - private String bucketSpace = "default"; // TODO repo etc etc + private String bucketSpace = FixedBucketSpaces.defaultSpace(); public Builder setHelp(boolean help) { this.help = help; diff --git a/vespaclient-java/src/main/java/com/yahoo/vespastat/CommandLineOptions.java b/vespaclient-java/src/main/java/com/yahoo/vespastat/CommandLineOptions.java index b6783efb25b..6c54dd5106b 100644 --- a/vespaclient-java/src/main/java/com/yahoo/vespastat/CommandLineOptions.java +++ b/vespaclient-java/src/main/java/com/yahoo/vespastat/CommandLineOptions.java @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespastat; +import com.yahoo.document.FixedBucketSpaces; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; @@ -54,7 +55,7 @@ public class CommandLineOptions { options.addOption(Option.builder("s") .hasArg(true) - .desc("Stat buckets within the given bucket space. If not provided, 'default' is used.") + .desc("Stat buckets within the given bucket space. If not provided, '" + FixedBucketSpaces.defaultSpace() + "' is used.") .argName("space") .longOpt(BUCKET_SPACE_OPTION) .build()); @@ -117,7 +118,7 @@ public class CommandLineOptions { builder.setHelp(cl.hasOption(HELP_OPTION)); builder.setDumpData(cl.hasOption(DUMP_OPTION)); builder.setRoute(cl.getOptionValue(ROUTE_OPTION, "default")); - builder.setBucketSpace(cl.getOptionValue(BUCKET_SPACE_OPTION, "default")); + builder.setBucketSpace(cl.getOptionValue(BUCKET_SPACE_OPTION, FixedBucketSpaces.defaultSpace())); if (cl.hasOption(USER_OPTION)) { builder.setSelectionType(ClientParameters.SelectionType.USER); 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 4f462bf187e..ee331d455ad 100644 --- a/vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisit.java +++ b/vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisit.java @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespavisit; +import com.yahoo.document.FixedBucketSpaces; import com.yahoo.document.select.parser.ParseException; import com.yahoo.documentapi.ProgressToken; import com.yahoo.documentapi.VisitorControlHandler; @@ -341,7 +342,8 @@ public class VdsVisit { .longOpt("bucketspace") .hasArg(true) .argName("space") - .desc("Bucket space to visit ('default' or 'global). If not specified, 'default' is used.") + .desc("Bucket space to visit ('" + FixedBucketSpaces.defaultSpace() + "' or '" + FixedBucketSpaces.globalSpace() + "'). " + + "If not specified, '" + FixedBucketSpaces.defaultSpace() + "' is used.") .build()); return options; diff --git a/vespaclient-java/src/test/java/com/yahoo/vespastat/CommandLineOptionsTest.java b/vespaclient-java/src/test/java/com/yahoo/vespastat/CommandLineOptionsTest.java index a6bd7280c36..857e6d934fd 100644 --- a/vespaclient-java/src/test/java/com/yahoo/vespastat/CommandLineOptionsTest.java +++ b/vespaclient-java/src/test/java/com/yahoo/vespastat/CommandLineOptionsTest.java @@ -70,7 +70,6 @@ public class CommandLineOptionsTest { } } - // TODO fixed bucket space repo @Test public void bucket_space_is_default_unless_specified() { assertEquals("default", getParsedOptions("--user", "id").bucketSpace); |