aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/Cluster.java
blob: 8ca22cdae09cde6a06c6dea161675a7bdc089960 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright Vespa.ai. 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"); }

}