summaryrefslogtreecommitdiffstats
path: root/vespaclient-java
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-04-01 15:59:10 +0200
committerTor Brede Vekterli <vekterli@yahooinc.com>2022-04-01 15:59:10 +0200
commitdf755138e47d1ded561800978875e59094c4b1b4 (patch)
treeb6f6f7bc0259a15b5f11902e2d58c8c994e5a17e /vespaclient-java
parent14bb8f3c745f9b153e289ff62b38c911966ea32b (diff)
Deprecate DocumentAPI methods using explicit operation priority
This is functionality that made more sense when we had spinning drives and no async write scheduling in the backend. Going away on Vespa 8.
Diffstat (limited to 'vespaclient-java')
-rw-r--r--vespaclient-java/src/main/java/com/yahoo/vespaget/DocumentRetriever.java3
-rw-r--r--vespaclient-java/src/test/java/com/yahoo/vespafeeder/VespaFeederTestCase.java6
-rw-r--r--vespaclient-java/src/test/java/com/yahoo/vespaget/DocumentRetrieverTest.java3
3 files changed, 8 insertions, 4 deletions
diff --git a/vespaclient-java/src/main/java/com/yahoo/vespaget/DocumentRetriever.java b/vespaclient-java/src/main/java/com/yahoo/vespaget/DocumentRetriever.java
index 044e4d913c3..b9917533a62 100644
--- a/vespaclient-java/src/main/java/com/yahoo/vespaget/DocumentRetriever.java
+++ b/vespaclient-java/src/main/java/com/yahoo/vespaget/DocumentRetriever.java
@@ -141,9 +141,10 @@ public class DocumentRetriever {
return messageBusParams;
}
+ @SuppressWarnings("removal") // TODO: Remove on Vespa 8
private Message createDocumentRequest(String docid, LoadType loadType) {
GetDocumentMessage msg = new GetDocumentMessage(new DocumentId(docid), params.fieldSet);
- msg.setPriority(params.priority);
+ msg.setPriority(params.priority); // TODO: Remove on Vespa 8
msg.setRetryEnabled(!params.noRetry);
if (loadType != null) {
diff --git a/vespaclient-java/src/test/java/com/yahoo/vespafeeder/VespaFeederTestCase.java b/vespaclient-java/src/test/java/com/yahoo/vespafeeder/VespaFeederTestCase.java
index 950ecd799e8..7f529fb5b86 100644
--- a/vespaclient-java/src/test/java/com/yahoo/vespafeeder/VespaFeederTestCase.java
+++ b/vespaclient-java/src/test/java/com/yahoo/vespafeeder/VespaFeederTestCase.java
@@ -152,13 +152,14 @@ public class VespaFeederTestCase {
}
@Test
+ @SuppressWarnings("removal") // TODO: Remove on Vespa 8
public void feedFile() throws Exception {
FeedFixture f = new FeedFixture();
Arguments arguments = new Arguments("--file src/test/files/myfeed.xml --priority LOW_1".split(" "), f.sessionFactory);
new VespaFeeder(arguments, f.typeManager).parseFiles(System.in, f.printStream);
assertEquals(3, f.sessionFactory.messages.size());
- assertEquals(DocumentProtocol.Priority.LOW_1, ((PutDocumentMessage)f.sessionFactory.messages.get(0)).getPriority());
+ assertEquals(DocumentProtocol.Priority.LOW_1, ((PutDocumentMessage)f.sessionFactory.messages.get(0)).getPriority()); // TODO: Remove on Vespa 8
assertEquals("id:test:news::foo", ((PutDocumentMessage) f.sessionFactory.messages.get(0)).getDocumentPut().getDocument().getId().toString());
DocumentUpdate update = ((UpdateDocumentMessage) f.sessionFactory.messages.get(1)).getDocumentUpdate();
assertEquals("id:test:news::foo", update.getId().toString());
@@ -175,9 +176,10 @@ public class VespaFeederTestCase {
assertJsonFeedState(feedFixture);
}
+ @SuppressWarnings("removal") // TODO: Remove on Vespa 8
protected void assertJsonFeedState(FeedFixture feedFixture) {
assertEquals(3, feedFixture.sessionFactory.messages.size());
- assertEquals(DocumentProtocol.Priority.LOW_1, ((PutDocumentMessage)feedFixture.sessionFactory.messages.get(0)).getPriority());
+ assertEquals(DocumentProtocol.Priority.LOW_1, ((PutDocumentMessage)feedFixture.sessionFactory.messages.get(0)).getPriority()); // TODO: Remove on Vespa 8
assertEquals("id:test:news::foo", ((PutDocumentMessage) feedFixture.sessionFactory.messages.get(0)).getDocumentPut().getDocument().getId().toString());
DocumentUpdate update = ((UpdateDocumentMessage) feedFixture.sessionFactory.messages.get(1)).getDocumentUpdate();
assertEquals("id:test:news::foo", update.getId().toString());
diff --git a/vespaclient-java/src/test/java/com/yahoo/vespaget/DocumentRetrieverTest.java b/vespaclient-java/src/test/java/com/yahoo/vespaget/DocumentRetrieverTest.java
index 098319f24dc..8d7483c2196 100644
--- a/vespaclient-java/src/test/java/com/yahoo/vespaget/DocumentRetrieverTest.java
+++ b/vespaclient-java/src/test/java/com/yahoo/vespaget/DocumentRetrieverTest.java
@@ -134,6 +134,7 @@ public class DocumentRetrieverTest {
}
@Test
+ @SuppressWarnings("removal") // TODO: Remove on Vespa 8
public void testSendSingleMessage() throws DocumentRetrieverException {
ClientParameters params = createParameters()
.setDocumentIds(asIterator(DOC_ID_1))
@@ -156,7 +157,7 @@ public class DocumentRetrieverTest {
verify(mockedSession, times(1)).syncSend(argThat((ArgumentMatcher<GetDocumentMessage>) o ->
o.getPriority().equals(DocumentProtocol.Priority.HIGH_1) &&
!o.getRetryEnabled() &&
- o.getLoadType().equals(new LoadType(1, "loadtype", DocumentProtocol.Priority.HIGH_1))));
+ o.getLoadType().equals(new LoadType(1, "loadtype", DocumentProtocol.Priority.HIGH_1)))); // TODO: Remove on Vespa 8
assertContainsDocument(DOC_ID_1);
}