Package com.yahoo.vespa.http.client
Interface Session
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
SessionImpl
@Deprecated public interface Session extends AutoCloseable
Deprecated.use either FeedClient or SyncFeedClient // TODO: Remove on Vespa 8A Session is an entity used to feed operations (like documents, removes or updates) to one Vespa cluster or several clusters in parallel. Current implementations are fail-fast, i.e. all feeding errors are propagated to the user as quickly as possible and with as much detail as possible. Implementations of this interface are required to be thread safe. ASessionFactory
is provided to instantiate Sessions.- Author:
- Einar M R Rosenvinge
- See Also:
SessionFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
close()
Deprecated.Closes this Session.String
getStatsAsJson()
Deprecated.Returns stats about the cluster.BlockingQueue<Result>
results()
Deprecated.ReturnsResult
s for all operations enqueued bystream(CharSequence)
.OutputStream
stream(CharSequence documentId)
Deprecated.Returns an OutputStream that can be used to write ONE operation, identified by the given document ID.
-
-
-
Method Detail
-
stream
OutputStream stream(CharSequence documentId)
Deprecated.Returns an OutputStream that can be used to write ONE operation, identified by the given document ID. The data format must match theFeedParams.DataFormat
given when this Session was instantiated. Note that most data formats include the document ID in the actual buffer, which must match the document ID given as a parameter to this method. It is (as always) important to close the OutputStream returned - nothing is written to the wire until this is done. Note also that the Session holds a certain, dynamically determined maximum number of document operations in memory. When this threshold is reached,OutputStream.close()
will block.- Parameters:
documentId
- the unique ID identifying this operation in the system- Returns:
- an OutputStream to write the operation payload into
-
results
BlockingQueue<Result> results()
Deprecated.ReturnsResult
s for all operations enqueued bystream(CharSequence)
. Note that the order of results is non-deterministic, with one exception - results for one document ID are returned in the order they were enqueued. In all other cases Results may appear out-of-order.- Returns:
- a blocking queue for retrieving results
- See Also:
Result
-
close
void close()
Deprecated.Closes this Session. All resources are freed, persistent connections are closed and internal threads are stopped.- Specified by:
close
in interfaceAutoCloseable
- Throws:
RuntimeException
- in cases where underlying resources throw on shutdown/close
-
getStatsAsJson
String getStatsAsJson()
Deprecated.Returns stats about the cluster.- Returns:
- JSON string with information about cluster.
-
-