Package com.yahoo.vespa.http.client
Class SyncFeedClient
- java.lang.Object
-
- com.yahoo.vespa.http.client.SyncFeedClient
-
- All Implemented Interfaces:
AutoCloseable
public class SyncFeedClient extends Object implements AutoCloseable
A utility wrapper of a FeedClient which feeds a list of documents and blocks until all responses are returned, before returning the results. Not multithread safe: A sync feed client instance can only be used by a single thread (but it can and should be reused for multiple subsequent synchronous calls).- Author:
- bratseth
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SyncFeedClient.SyncOperation
Holds the arguments to a single stream operationstatic class
SyncFeedClient.SyncResult
The result of a SyncFeedClient.stream call.
-
Constructor Summary
Constructors Constructor Description SyncFeedClient(SessionParams params)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
SyncFeedClient.SyncResult
stream(List<SyncFeedClient.SyncOperation> operations)
Calls FeedClient.stream for each entry in the list, blocks until all results are ready and returns them.
-
-
-
Constructor Detail
-
SyncFeedClient
public SyncFeedClient(SessionParams params)
-
-
Method Detail
-
stream
public SyncFeedClient.SyncResult stream(List<SyncFeedClient.SyncOperation> operations)
Calls FeedClient.stream for each entry in the list, blocks until all results are ready and returns them. This will block for at most the time it takes to feed these operations + clientTimeout given in the sessions params when creating this.- Parameters:
operations
- the Vespa write operations to stream- Returns:
- the result of feeding all these operations
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
-