Interface AsyncSession
-
- All Superinterfaces:
Session
- All Known Implementing Classes:
LocalAsyncSession
,MessageBusAsyncSession
public interface AsyncSession extends Session
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
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Result
get(com.yahoo.document.DocumentId id)
Gets a document.default Result
get(com.yahoo.document.DocumentId id, boolean headersOnly, DocumentProtocol.Priority priority)
Deprecated.the 'headersonly' flag has no effectdefault Result
get(com.yahoo.document.DocumentId id, DocumentOperationParameters parameters)
Gets a document.default Result
get(com.yahoo.document.DocumentId id, DocumentProtocol.Priority priority)
Gets a document.double
getCurrentWindowSize()
Returns the current send window size of the session.Result
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)
Puts a document, with optional conditions on the operation.default Result
put(com.yahoo.document.Document document, DocumentProtocol.Priority priority)
Puts a document.Result
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.DocumentId id, DocumentProtocol.Priority priority)
Removes a document if it is present.default Result
remove(com.yahoo.document.DocumentRemove remove, DocumentOperationParameters parameters)
Removes a document if it is present.Result
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)
Updates a document.
-
-
-
Method Detail
-
put
Result put(com.yahoo.document.Document document)
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
default Result put(com.yahoo.document.Document document, DocumentProtocol.Priority priority)
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 putpriority
- the priority with which to send the operation- Returns:
- the synchronous result of this operation
-
put
default Result put(com.yahoo.document.DocumentPut documentPut)
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, DocumentProtocol.Priority priority)
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 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
Result get(com.yahoo.document.DocumentId id)
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 default Result get(com.yahoo.document.DocumentId id, boolean headersOnly, DocumentProtocol.Priority priority)
Deprecated.the 'headersonly' flag has no effectGets 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
default Result get(com.yahoo.document.DocumentId id, DocumentProtocol.Priority priority)
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 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
default Result get(com.yahoo.document.DocumentId id, DocumentOperationParameters parameters)
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
Result remove(com.yahoo.document.DocumentId id)
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
default Result remove(com.yahoo.document.DocumentId id, DocumentProtocol.Priority priority)
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
default Result remove(com.yahoo.document.DocumentId id, 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:
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
Result update(com.yahoo.document.DocumentUpdate 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, DocumentProtocol.Priority priority)
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 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.
-
-