Interface BulkFuture<V>

  • Type Parameters:
    V -
    All Superinterfaces:
    java.util.concurrent.Future<V>
    All Known Implementing Classes:
    BulkGetFuture

    public interface BulkFuture<V>
    extends java.util.concurrent.Future<V>
    Additional flexibility for asyncGetBulk

    This interface is now returned from all asyncGetBulk methods. Unlike Future.get(long, TimeUnit), getSome(long, TimeUnit) does not throw CheckedOperationTimeoutException, thus allowing retrieval of partial results after timeout occurs. This behavior is especially useful in case of large multi gets.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.concurrent.Future<V> addListener​(BulkGetCompletionListener listener)
      Add a listener to the future, which will be executed once the operation completes.
      V getSome​(long timeout, java.util.concurrent.TimeUnit unit)
      Wait for the operation to complete and return results If operation could not complete within specified timeout, partial result is returned.
      OperationStatus getStatus()
      Gets the status of the operation upon completion.
      boolean isTimeout()  
      java.util.concurrent.Future<V> removeListener​(BulkGetCompletionListener listener)
      Remove a previously added listener from the future.
      • Methods inherited from interface java.util.concurrent.Future

        cancel, get, get, isCancelled, isDone
    • Method Detail

      • isTimeout

        boolean isTimeout()
        Returns:
        true if timeout was reached, false otherwise
      • getSome

        V getSome​(long timeout,
                  java.util.concurrent.TimeUnit unit)
           throws java.lang.InterruptedException,
                  java.util.concurrent.ExecutionException
        Wait for the operation to complete and return results If operation could not complete within specified timeout, partial result is returned. Otherwise, the behavior is identical to Future.get(long, TimeUnit)
        Parameters:
        timeout -
        unit -
        Returns:
        a partial get bulk result
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • getStatus

        OperationStatus getStatus()
        Gets the status of the operation upon completion.
        Returns:
        the operation status.
      • addListener

        java.util.concurrent.Future<V> addListener​(BulkGetCompletionListener listener)
        Add a listener to the future, which will be executed once the operation completes.
        Parameters:
        listener - the listener which will be executed.
        Returns:
        the current future to allow for object-chaining.
      • removeListener

        java.util.concurrent.Future<V> removeListener​(BulkGetCompletionListener listener)
        Remove a previously added listener from the future.
        Parameters:
        listener - the previously added listener.
        Returns:
        the current future to allow for object-chaining.