Interface AsyncSession
- All Superinterfaces:
Session
- All Known Implementing Classes:
LocalAsyncSession
,MessageBusAsyncSession
A session for asynchronous access to a document repository. This class provides document repository writes and random access with high throughput.
All operations which are accepted by an async session will cause one or more
responses
to be returned within the timeout limit. When an operation fails,
the response will contain the argument which was submitted to the operation.
- Author:
- bratseth
-
Method Summary
Modifier and TypeMethodDescriptionget
(com.yahoo.document.DocumentId id) Gets a document.default Result
get
(com.yahoo.document.DocumentId id, DocumentOperationParameters parameters) Gets a document.double
Returns the current send window size of the session.put
(com.yahoo.document.Document document) Puts a document.default Result
put
(com.yahoo.document.DocumentPut documentPut) Puts a document, with optional conditions on the operation.default Result
put
(com.yahoo.document.DocumentPut documentPut, DocumentOperationParameters parameters) Puts a document, with optional conditions on the operation.remove
(com.yahoo.document.DocumentId id) Removes a document if it is present.default Result
remove
(com.yahoo.document.DocumentId id, DocumentOperationParameters parameters) Removes a document if it is present.default Result
remove
(com.yahoo.document.DocumentRemove remove, DocumentOperationParameters parameters) Removes a document if it is present.update
(com.yahoo.document.DocumentUpdate update) Updates a document.default Result
update
(com.yahoo.document.DocumentUpdate update, DocumentOperationParameters parameters) Updates a document.
-
Method Details
-
put
Puts a document. This method returns immediately.
If this result is a success, this call will cause one or more
DocumentResponse
objects to appear within the timeout time of this session. The response returned later will either be a success, or contain the document submitted here. If it was not a success, this method has no further effects.- Parameters:
document
- the Document to put- Returns:
- the synchronous result of this operation
-
put
Puts a document, with optional conditions on the operation. This method returns immediately.
If this result is a success, this call will cause one or more
DocumentResponse
objects to appear within the timeout time of this session. The response returned later will either be a success, or contain the document submitted here. If it was not a success, this method has no further effects.- Parameters:
documentPut
- the DocumentPut to perform- Returns:
- the synchronous result of this operation
-
put
default Result put(com.yahoo.document.DocumentPut documentPut, DocumentOperationParameters parameters) Puts a document, with optional conditions on the operation. This method returns immediately.
If this result is a success, this call will cause one or more
DocumentResponse
objects to appear within the timeout time of this session. The response returned later will either be a success, or contain the document submitted here. If it was not a success, this method has no further effects.- Parameters:
documentPut
- the DocumentPut to performparameters
- parameters for the operation- Returns:
- the synchronous result of this operation
-
get
Gets a document. This method returns immediately.
If this result is a success, this call will cause one or more
DocumentResponse
objects to appear within the timeout time of this session. The response returned later will contain the requested document if it is a success. If it was not a success, this method has no further effects.- Parameters:
id
- the id of the document to get- Returns:
- the synchronous result of this operation
- Throws:
UnsupportedOperationException
- if this access implementation does not support retrieving
-
get
Gets a document. This method returns immediately.
If this result is a success, this call will cause one or more
DocumentResponse
objects to appear within the timeout time of this session. The response returned later will contain the requested document if it is a success. If it was not a success, this method has no further effects.- Parameters:
id
- the id of the document to getparameters
- parameters for the operation- Returns:
- the synchronous result of this operation
- Throws:
UnsupportedOperationException
- if this access implementation does not support retrieving
-
remove
Removes a document if it is present. This method returns immediately.
If this result is a success, this call will cause one or more
RemoveResponse
objects to appear within the timeout time of this session. The response returned later will either be a success, or contain the document id submitted here. If it was not a success, this method has no further effects.- Parameters:
id
- the id of the document to remove- Returns:
- the synchronous result of this operation
- Throws:
UnsupportedOperationException
- if this access implementation does not support removal
-
remove
Removes a document if it is present. This method returns immediately.
If this result is a success, this call will cause one or more
DocumentIdResponse
objects to appear within the timeout time of this session. The response returned later will either be a success, or contain the document id submitted here. If it was not a success, this method has no further effects.- Parameters:
id
- the id of the document to removeparameters
- parameters for the operation- Returns:
- the synchronous result of this operation
- Throws:
UnsupportedOperationException
- if this access implementation does not support removal
-
remove
default Result remove(com.yahoo.document.DocumentRemove remove, DocumentOperationParameters parameters) Removes a document if it is present. This method returns immediately.
If this result is a success, this call will cause one or more
DocumentIdResponse
objects to appear within the timeout time of this session. The response returned later will either be a success, or contain the document id submitted here. If it was not a success, this method has no further effects.- Parameters:
remove
- the document remove operationparameters
- parameters for the operation- Returns:
- the synchronous result of this operation
- Throws:
UnsupportedOperationException
- if this access implementation does not support removal
-
update
Updates a document. This method returns immediately.
If this result is a success, this call will cause one or more
DocumentUpdateResponse
within the timeout time of this session. The returned response returned later will either be a success or contain the update submitted here. If it was not a success, this method has no further effects.- Parameters:
update
- the updates to perform- Returns:
- the synchronous result of this operation
- Throws:
UnsupportedOperationException
- if this access implementation does not support update
-
update
default Result update(com.yahoo.document.DocumentUpdate update, DocumentOperationParameters parameters) Updates a document. This method returns immediately.
If this result is a success, this call will cause one or more
DocumentUpdateResponse
within the timeout time of this session. The returned response returned later will either be a success or contain the update submitted here. If it was not a success, this method has no further effects.- Parameters:
update
- the updates to performparameters
- parameters for the operation- Returns:
- the synchronous result of this operation
- Throws:
UnsupportedOperationException
- if this access implementation does not support update
-
getCurrentWindowSize
double getCurrentWindowSize()Returns the current send window size of the session.- Returns:
- Returns the window size.
-