diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2018-11-13 09:47:17 +0000 |
---|---|---|
committer | gjoranv <gv@oath.com> | 2019-01-21 15:09:26 +0100 |
commit | 230010bee4489cd90ec12c3014a4dd8991ca7eaf (patch) | |
tree | 9a7958533c71b5464c45960824ed81d3e906d2b5 /documentapi | |
parent | c8ae51ef7981fb3003b2816b056f127e8e3df97c (diff) |
ignore headersonly flag
* methods taking the flag are now deprecated, added new variants not taking the flag
Diffstat (limited to 'documentapi')
4 files changed, 35 insertions, 3 deletions
diff --git a/documentapi/src/main/java/com/yahoo/documentapi/AsyncSession.java b/documentapi/src/main/java/com/yahoo/documentapi/AsyncSession.java index 2e78a023910..6aa62a0ba8b 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/AsyncSession.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/AsyncSession.java @@ -71,10 +71,28 @@ public interface AsyncSession extends Session { * @param priority The priority with which to perform this operation. * @return the synchronous result of this operation * @throws UnsupportedOperationException if this access implementation does not support retrieving + * @deprecated the 'headersonly' flag has no effect */ + @Deprecated Result get(DocumentId id, boolean headersOnly, DocumentProtocol.Priority priority); /** + * <p>Gets a document. This method returns immediately.</p> + * + * <p>If this result is a success, this + * call will cause one or more {@link DocumentResponse} objects to appear within the timeout time of this session. + * The response returned later will contain the requested document if it is a success. + * If it was not a success, this method has no further effects.</p> + * + * @param id the id of the document to get + * @param priority The priority with which to perform this operation. + * @return the synchronous result of this operation + * @throws UnsupportedOperationException if this access implementation does not support retrieving + */ + Result get(DocumentId id, DocumentProtocol.Priority priority); + + + /** * <p>Removes a document if it is present. This method returns immediately.</p> * * <p>If this result is a success, this diff --git a/documentapi/src/main/java/com/yahoo/documentapi/VisitorParameters.java b/documentapi/src/main/java/com/yahoo/documentapi/VisitorParameters.java index 0cf8e05c8ed..45a2046157d 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/VisitorParameters.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/VisitorParameters.java @@ -140,7 +140,7 @@ public class VisitorParameters extends Parameters { public boolean getVisitRemoves() { return visitRemoves; } - public boolean getVisitHeadersOnly() { return "[header]".equals(fieldSet); } + public boolean getVisitHeadersOnly() { return false; } /** @return The field set to use. */ public String fieldSet() { return fieldSet; } @@ -231,7 +231,9 @@ public class VisitorParameters extends Parameters { public void setVisitRemoves(boolean visitRemoves) { this.visitRemoves = visitRemoves; } - public void setVisitHeadersOnly(boolean headersOnly) { this.fieldSet = headersOnly ? "[header]" : "[all]"; } + /** The 'headersonly' option is removed in Vespa 7 */ + @Deprecated + public void setVisitHeadersOnly(boolean headersOnly) { } /** Set field set to use. */ public void fieldSet(String fieldSet) { this.fieldSet = fieldSet; } diff --git a/documentapi/src/main/java/com/yahoo/documentapi/local/LocalAsyncSession.java b/documentapi/src/main/java/com/yahoo/documentapi/local/LocalAsyncSession.java index 4e331071be7..cb02617d5e1 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/local/LocalAsyncSession.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/local/LocalAsyncSession.java @@ -74,7 +74,13 @@ public class LocalAsyncSession implements AsyncSession { } @Override + @Deprecated public Result get(DocumentId id, boolean headersOnly, DocumentProtocol.Priority pri) { + return get(id, pri); + } + + @Override + public Result get(DocumentId id, DocumentProtocol.Priority pri) { long req = getNextRequestId(); try { addResponse(new DocumentResponse(req, syncSession.get(id))); diff --git a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java index 8a6fa85c68b..08a66cbac96 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java @@ -86,8 +86,14 @@ public class MessageBusAsyncSession implements MessageBusSession, AsyncSession { } @Override + @Deprecated public Result get(DocumentId id, boolean headersOnly, DocumentProtocol.Priority pri) { - GetDocumentMessage msg = new GetDocumentMessage(id, headersOnly ? "[header]" : "[all]"); + return get(id, pri); + } + + @Override + public Result get(DocumentId id, DocumentProtocol.Priority pri) { + GetDocumentMessage msg = new GetDocumentMessage(id, "[all]"); msg.setPriority(pri); return send(msg); } |