Package ai.vespa.feed.client
Interface FeedClient
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
public interface FeedClient extends java.io.Closeable
Asynchronous feed client accepting document operations as JSON. The payload should be the same as the HTTP payload required by the /document/v1 HTTP API, i.e.,{ "fields": { ... } }
- Author:
- bjorncs, jonmv
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
FeedClient.CircuitBreaker
Allows slowing down or halting completely operations against the configured endpoint on high failure rates.static class
FeedClient.OperationType
static interface
FeedClient.RetryStrategy
Controls what to retry, and how many times.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description FeedClient.CircuitBreaker.State
circuitBreakerState()
Current state of the circuit breaker.default void
close()
Initiates graceful shutdown.void
close(boolean graceful)
Shut down, and reject new operations.java.util.concurrent.CompletableFuture<Result>
put(DocumentId documentId, java.lang.String documentJson, OperationParameters params)
Send a document put with the given parameters, returning a future with the result of the operation.java.util.concurrent.CompletableFuture<Result>
remove(DocumentId documentId, OperationParameters params)
Send a document remove with the given parameters, returning a future with the result of the operation.OperationStats
stats()
Returns a snapshot of the stats for this feed client, such as requests made, and responses by status.java.util.concurrent.CompletableFuture<Result>
update(DocumentId documentId, java.lang.String updateJson, OperationParameters params)
Send a document update with the given parameters, returning a future with the result of the operation.
-
-
-
Method Detail
-
put
java.util.concurrent.CompletableFuture<Result> put(DocumentId documentId, java.lang.String documentJson, OperationParameters params)
Send a document put with the given parameters, returning a future with the result of the operation. Exceptional completion will use be an instance ofFeedException
or one of its sub-classes.
-
update
java.util.concurrent.CompletableFuture<Result> update(DocumentId documentId, java.lang.String updateJson, OperationParameters params)
Send a document update with the given parameters, returning a future with the result of the operation. Exceptional completion will use be an instance ofFeedException
or one of its sub-classes.
-
remove
java.util.concurrent.CompletableFuture<Result> remove(DocumentId documentId, OperationParameters params)
Send a document remove with the given parameters, returning a future with the result of the operation. Exceptional completion will use be an instance ofFeedException
or one of its sub-classes.
-
stats
OperationStats stats()
Returns a snapshot of the stats for this feed client, such as requests made, and responses by status.
-
circuitBreakerState
FeedClient.CircuitBreaker.State circuitBreakerState()
Current state of the circuit breaker.
-
close
void close(boolean graceful)
Shut down, and reject new operations. Operations in flight are allowed to complete normally if graceful.
-
close
default void close()
Initiates graceful shutdown. Seeclose(boolean)
.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-