summaryrefslogtreecommitdiffstats
path: root/vespa-feed-client
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2021-06-18 16:02:25 +0200
committerJon Marius Venstad <venstad@gmail.com>2021-06-21 09:33:03 +0200
commit43717db157aa47dbeae47d5d4ab8ab6256cf051c (patch)
tree27941d541a02afb92b4976b0407bc16867896965 /vespa-feed-client
parent5d17f472e3d4bae2afdba93a8e30f79999d292b2 (diff)
Update abi spec
Diffstat (limited to 'vespa-feed-client')
-rw-r--r--vespa-feed-client/abi-spec.json36
-rw-r--r--vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java4
2 files changed, 38 insertions, 2 deletions
diff --git a/vespa-feed-client/abi-spec.json b/vespa-feed-client/abi-spec.json
index ecac167cd8e..b4355cb0970 100644
--- a/vespa-feed-client/abi-spec.json
+++ b/vespa-feed-client/abi-spec.json
@@ -102,6 +102,22 @@
],
"fields": []
},
+ "ai.vespa.feed.client.FeedClient$Throttler": {
+ "superClass": "java.lang.Object",
+ "interfaces": [],
+ "attributes": [
+ "public",
+ "interface",
+ "abstract"
+ ],
+ "methods": [
+ "public abstract void sent(long, java.util.concurrent.CompletableFuture)",
+ "public abstract void success()",
+ "public abstract void throttled(long)",
+ "public abstract long targetInflight()"
+ ],
+ "fields": []
+ },
"ai.vespa.feed.client.FeedClient": {
"superClass": "java.lang.Object",
"interfaces": [
@@ -331,5 +347,25 @@
"public void <init>(ai.vespa.feed.client.DocumentId, java.lang.Throwable)"
],
"fields": []
+ },
+ "ai.vespa.feed.client.StaticThrottler": {
+ "superClass": "java.lang.Object",
+ "interfaces": [
+ "ai.vespa.feed.client.FeedClient$Throttler"
+ ],
+ "attributes": [
+ "public"
+ ],
+ "methods": [
+ "public void <init>(ai.vespa.feed.client.FeedClientBuilder)",
+ "public void sent(long, java.util.concurrent.CompletableFuture)",
+ "public void success()",
+ "public void throttled(long)",
+ "public long targetInflight()"
+ ],
+ "fields": [
+ "protected final long maxInflight",
+ "protected final long minInflight"
+ ]
}
} \ No newline at end of file
diff --git a/vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java b/vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java
index d3005227184..fe62db9e0bb 100644
--- a/vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java
+++ b/vespa-feed-client/src/test/java/ai/vespa/feed/client/HttpRequestStrategyTest.java
@@ -84,7 +84,7 @@ class HttpRequestStrategyTest {
HttpRequest request = new HttpRequest("POST", "/", null, null);
// Runtime exception is not retried.
- cluster.expect((__, vessel) -> vessel.completeExceptionally(new RuntimeException("boom")));
+ cluster.expect((__, vessel) -> vessel.completeExceptionally(new FeedException("boom")));
ExecutionException expected = assertThrows(ExecutionException.class,
() -> strategy.enqueue(id1, request).get());
assertEquals("boom", expected.getCause().getMessage());
@@ -94,7 +94,7 @@ class HttpRequestStrategyTest {
cluster.expect((__, vessel) -> vessel.completeExceptionally(new IOException("retry me")));
expected = assertThrows(ExecutionException.class,
() -> strategy.enqueue(id1, request).get());
- assertEquals("retry me", expected.getCause().getMessage());
+ assertEquals("retry me", expected.getCause().getCause().getMessage());
assertEquals(3, strategy.stats().requests());
// Successful response is returned