aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/Cluster.java
diff options
context:
space:
mode:
Diffstat (limited to 'vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/Cluster.java')
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/Cluster.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/Cluster.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/Cluster.java
new file mode 100644
index 00000000000..ee9188fdc2b
--- /dev/null
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/Cluster.java
@@ -0,0 +1,25 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package ai.vespa.feed.client.impl;
+
+import ai.vespa.feed.client.HttpResponse;
+import ai.vespa.feed.client.OperationStats;
+
+import java.io.Closeable;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * Allows dispatch of HTTP requests to a remote Vespa cluster.
+ *
+ * @author jonmv
+ */
+interface Cluster extends Closeable {
+
+ /** Dispatch the request to the cluster, causing the response vessel to complete at a later time. May not throw! */
+ void dispatch(HttpRequest request, CompletableFuture<HttpResponse> vessel);
+
+ @Override
+ default void close() { }
+
+ default OperationStats stats() { throw new UnsupportedOperationException("Benchmarking has been disabled"); }
+
+}