summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandler.java
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@oath.com>2018-05-30 17:00:57 +0200
committerTor Brede Vekterli <vekterli@oath.com>2018-10-09 15:30:48 +0200
commitd5a6b5ebf36c89c12def0296c4497008e6372523 (patch)
tree4ab6e6e0293ebbe42bf51954e29144f09e5d9a91 /vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandler.java
parent242ca38ad85396eceaa5248aea34368dcabf556f (diff)
Support cross-document type visiting via /document/v1/ root
Requires `cluster` to be set since we don't have a document type to auto-infer the target cluster from. Can use `bucketSpace` parameter to explicitly state the target bucket space to visit (if not given, implicitly visits the 'default' space). Note: since we are not bound to a single document type, the field set used is `[all]`, not `doctype:[document]`. This means that this does _not_ have parity with non-root Document V1 visitor requests, though it _does_ have parity with legacy `/visit` and `vespa-visit`. To have same behavior for a single document type, use an explicit document `selection=mydoctype` parameter combined with a `fieldSet` parameter of `mydoctype:[document]`. This fixes #5794
Diffstat (limited to 'vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandler.java')
-rw-r--r--vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandler.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandler.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandler.java
index 35999df5a6b..775207d8629 100644
--- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandler.java
+++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandler.java
@@ -29,6 +29,7 @@ public interface OperationHandler {
public final Optional<Integer> wantedDocumentCount;
public final Optional<String> fieldSet;
public final Optional<Integer> concurrency;
+ public final Optional<String> bucketSpace;
/** @deprecated Use a VisitOptions.Builder instead */
@Deprecated
@@ -38,6 +39,7 @@ public interface OperationHandler {
this.wantedDocumentCount = wantedDocumentCount;
this.fieldSet = Optional.empty();
this.concurrency = Optional.empty();
+ this.bucketSpace = Optional.empty();
}
private VisitOptions(Builder builder) {
@@ -46,6 +48,7 @@ public interface OperationHandler {
this.wantedDocumentCount = Optional.ofNullable(builder.wantedDocumentCount);
this.fieldSet = Optional.ofNullable(builder.fieldSet);
this.concurrency = Optional.ofNullable(builder.concurrency);
+ this.bucketSpace = Optional.ofNullable(builder.bucketSpace);
}
public static class Builder {
@@ -54,6 +57,7 @@ public interface OperationHandler {
Integer wantedDocumentCount;
String fieldSet;
Integer concurrency;
+ String bucketSpace;
public Builder cluster(String cluster) {
this.cluster = cluster;
@@ -80,6 +84,11 @@ public interface OperationHandler {
return this;
}
+ public Builder bucketSpace(String bucketSpace) {
+ this.bucketSpace = bucketSpace;
+ return this;
+ }
+
public VisitOptions build() {
return new VisitOptions(this);
}