summaryrefslogtreecommitdiffstats
path: root/vespaclient-java/src
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2018-11-13 09:46:15 +0000
committergjoranv <gv@oath.com>2019-01-21 15:09:26 +0100
commit8a292274bd5e3df677d5088acf07c6dad75ee7c8 (patch)
treee1531f4ed487fc111a1ec6f8242218ca927fc622 /vespaclient-java/src
parent854dfb8d8eea6b651b96eeb2d4b2b51830e75226 (diff)
remove or disable --headersonly flag
Diffstat (limited to 'vespaclient-java/src')
-rw-r--r--vespaclient-java/src/main/java/com/yahoo/vespaget/CommandLineOptions.java12
-rw-r--r--vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisit.java4
-rw-r--r--vespaclient-java/src/main/sh/vespa-visit.16
-rw-r--r--vespaclient-java/src/test/java/com/yahoo/vespaget/CommandLineOptionsTest.java19
4 files changed, 10 insertions, 31 deletions
diff --git a/vespaclient-java/src/main/java/com/yahoo/vespaget/CommandLineOptions.java b/vespaclient-java/src/main/java/com/yahoo/vespaget/CommandLineOptions.java
index 7cc7b95bdae..703cdeba247 100644
--- a/vespaclient-java/src/main/java/com/yahoo/vespaget/CommandLineOptions.java
+++ b/vespaclient-java/src/main/java/com/yahoo/vespaget/CommandLineOptions.java
@@ -68,7 +68,7 @@ public class CommandLineOptions {
options.addOption(Option.builder("e")
.hasArg(false)
- .desc("Retrieve header fields only. [Deprecated].")
+ .desc("Retrieve header fields only. [Removed in Vespa 7].")
.longOpt(HEADERSONLY_OPTION).build());
options.addOption(Option.builder("f")
@@ -180,17 +180,15 @@ public class CommandLineOptions {
throw new IllegalArgumentException("Cannot combine both xml and json output");
}
- if (printIdsOnly && headersOnly) {
- throw new IllegalArgumentException("Print ids and headers only options are mutually exclusive.");
+ if (headersOnly) {
+ throw new IllegalArgumentException("Headers only option has been removed.");
}
- if ((printIdsOnly || headersOnly) && !fieldSet.isEmpty()) {
- throw new IllegalArgumentException("Field set option can not be used in combination with print ids or headers only options.");
+ if (printIdsOnly && !fieldSet.isEmpty()) {
+ throw new IllegalArgumentException("Field set option can not be used in combination with print ids option.");
}
if (printIdsOnly) {
fieldSet = "[id]";
- } else if (headersOnly) {
- fieldSet = "[header]";
} else if (fieldSet.isEmpty()) {
fieldSet = "[all]";
}
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 0f8f0df0f27..4430af19fbc 100644
--- a/vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisit.java
+++ b/vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisit.java
@@ -189,7 +189,7 @@ public class VdsVisit {
.desc("Only visit up to the given timestamp (microseconds).")
.type(Number.class).build());
- options.addOption("e", "headersonly", false, "Only visit headers of documents.[Deprecated]");
+ options.addOption("e", "headersonly", false, "Only visit headers of documents.[Removed in Vespa 7]");
options.addOption(Option.builder("l")
.longOpt("fieldset")
@@ -480,7 +480,7 @@ public class VdsVisit {
params.setToTimestamp(((Number) line.getParsedOptionValue("t")).longValue());
}
if (line.hasOption("e")) {
- params.fieldSet("[header]");
+ throw new IllegalArgumentException("Headers only option has been removed.");
}
if (line.hasOption("l")) {
params.fieldSet(line.getOptionValue("l"));
diff --git a/vespaclient-java/src/main/sh/vespa-visit.1 b/vespaclient-java/src/main/sh/vespa-visit.1
index fb2f102234d..5ed40b1a410 100644
--- a/vespaclient-java/src/main/sh/vespa-visit.1
+++ b/vespaclient-java/src/main/sh/vespa-visit.1
@@ -35,12 +35,6 @@ visited. The time is given in microseconds since 1970.
If this option is given, only documents up to and including the given timestamp
will be visited. The time is given in microseconds since 1970.
.TP
-\fB\-e\fR, \fB\-\-headersonly\fR
-By default, the whole documents stored are processed. If this option is given
-only the header parts of documents will be processed. By defining the big
-document fields as body fields, you can efficiently visit all the header fields
-using this option.
-.TP
\fB\-i\fR, \fB\-\-printids\fR
Using this option, only the document identifiers will be printed to STDOUT.
In addition, if visiting removes, an additional tag will be added so you can
diff --git a/vespaclient-java/src/test/java/com/yahoo/vespaget/CommandLineOptionsTest.java b/vespaclient-java/src/test/java/com/yahoo/vespaget/CommandLineOptionsTest.java
index 05f8964e516..8848b6f1e7f 100644
--- a/vespaclient-java/src/test/java/com/yahoo/vespaget/CommandLineOptionsTest.java
+++ b/vespaclient-java/src/test/java/com/yahoo/vespaget/CommandLineOptionsTest.java
@@ -89,23 +89,9 @@ public class CommandLineOptionsTest {
}
@Test
- public void testInvalidCombination1() {
- exception.expect(IllegalArgumentException.class);
- exception.expectMessage("Print ids and headers only options are mutually exclusive.");
- getParsedOptions("--headersonly", "--printids");
- }
-
- @Test
- public void testInvalidCombination2() {
- exception.expect(IllegalArgumentException.class);
- exception.expectMessage("Field set option can not be used in combination with print ids or headers only options.");
- getParsedOptions("--headersonly", "--fieldset", "[header]");
- }
-
- @Test
public void testInvalidCombination3() {
exception.expect(IllegalArgumentException.class);
- exception.expectMessage("Field set option can not be used in combination with print ids or headers only options.");
+ exception.expectMessage("Field set option can not be used in combination with print ids option.");
getParsedOptions("--printids", "--fieldset", "[header]");
}
@@ -157,8 +143,9 @@ public class CommandLineOptionsTest {
@Test
public void testHeadersOnly() {
+ exception.expect(IllegalArgumentException.class);
+ exception.expectMessage("Headers only option has been removed.");
ClientParameters params = getParsedOptions("--headersonly");
- assertEquals("[header]", params.fieldSet);
}
@Test