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 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 put
        priority - 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 perform
        priority - 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 perform
        parameters - 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 effect

        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
        priority - 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 get
        priority - 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 get
        parameters - 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 remove
        priority - 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 remove
        parameters - 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 operation
        parameters - 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 perform
        priority - 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 perform
        parameters - 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.