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, boolean headersOnly, DocumentProtocol.Priority priority) Deprecated, for removal: This API element is subject to removal in a future version.The 'headersonly' flag has no effect.default Result
get
(com.yahoo.document.DocumentId id, DocumentOperationParameters parameters) Gets a document.default Result
get
(com.yahoo.document.DocumentId id, DocumentProtocol.Priority priority) Deprecated, for removal: This API element is subject to removal in a future version.specifying explicit operation priority is deprecateddouble
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.default Result
put
(com.yahoo.document.DocumentPut documentPut, DocumentProtocol.Priority priority) Deprecated, for removal: This API element is subject to removal in a future version.specifying explicit operation priority is deprecateddefault Result
put
(com.yahoo.document.Document document, DocumentProtocol.Priority priority) Deprecated, for removal: This API element is subject to removal in a future version.specifying explicit operation priority is deprecatedremove
(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.DocumentId id, DocumentProtocol.Priority priority) Deprecated, for removal: This API element is subject to removal in a future version.specifying explicit operation priority is deprecated.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.default Result
update
(com.yahoo.document.DocumentUpdate update, DocumentProtocol.Priority priority) Deprecated, for removal: This API element is subject to removal in a future version.specifying explicit operation priority is deprecated
-
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
@Deprecated(forRemoval=true) default Result put(com.yahoo.document.Document document, DocumentProtocol.Priority priority) Deprecated, for removal: This API element is subject to removal in a future version.specifying explicit operation priority is deprecatedPuts 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 putpriority
- the priority with which to send the operation- 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
@Deprecated(forRemoval=true) default Result put(com.yahoo.document.DocumentPut documentPut, DocumentProtocol.Priority priority) Deprecated, for removal: This API element is subject to removal in a future version.specifying explicit operation priority is deprecatedPuts 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 performpriority
- the priority with which to send the operation- 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
@Deprecated(forRemoval=true) default Result get(com.yahoo.document.DocumentId id, boolean headersOnly, DocumentProtocol.Priority priority) Deprecated, for removal: This API element is subject to removal in a future version.The 'headersonly' flag has no effect. Specifying explicit operation priority is deprecatedGets 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 getpriority
- The priority with which to perform this operation.- Returns:
- the synchronous result of this operation
- Throws:
UnsupportedOperationException
- if this access implementation does not support retrieving
-
get
@Deprecated(forRemoval=true) default Result get(com.yahoo.document.DocumentId id, DocumentProtocol.Priority priority) Deprecated, for removal: This API element is subject to removal in a future version.specifying explicit operation priority is deprecatedGets 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 getpriority
- The priority with which to perform this operation.- 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
@Deprecated(forRemoval=true) default Result remove(com.yahoo.document.DocumentId id, DocumentProtocol.Priority priority) Deprecated, for removal: This API element is subject to removal in a future version.specifying explicit operation priority is deprecated. Use methods without priority parameter.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 apprear 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 removepriority
- The priority with which to perform this operation.- 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
@Deprecated(forRemoval=true) default Result update(com.yahoo.document.DocumentUpdate update, DocumentProtocol.Priority priority) Deprecated, for removal: This API element is subject to removal in a future version.specifying explicit operation priority is deprecatedUpdates 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 performpriority
- The priority with which to perform this operation.- 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.
-