Interface AsyncKeyValueService

  • All Superinterfaces:
    java.lang.AutoCloseable
    All Known Subinterfaces:
    KeyValueService

    public interface AsyncKeyValueService
    extends java.lang.AutoCloseable
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void close()  
      com.google.common.util.concurrent.ListenableFuture<java.util.Map<Cell,​Value>> getAsync​(TableReference tableRef, java.util.Map<Cell,​java.lang.Long> timestampByCell)
      Asynchronously gets values from the key-value store when the store allows it.
      default boolean isValid()
      Denotes whether the AsyncKeyValueService is currently capable of handling requests.
    • Method Detail

      • getAsync

        @Idempotent
        com.google.common.util.concurrent.ListenableFuture<java.util.Map<Cell,​Value>> getAsync​(TableReference tableRef,
                                                                                                     java.util.Map<Cell,​java.lang.Long> timestampByCell)
        Asynchronously gets values from the key-value store when the store allows it. In other cases it just wraps the result in an immediate future.
        Parameters:
        tableRef - the name of the table to retrieve values from.
        timestampByCell - specifies, for each row, the maximum timestamp (exclusive) at which to retrieve that row's value.
        Returns:
        listenable future containing map of retrieved values. Values which do not exist (either because they were deleted or never created in the first place) are simply not returned.
      • close

        void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • isValid

        default boolean isValid()
        Denotes whether the AsyncKeyValueService is currently capable of handling requests. Reasons for an AsyncKeyValueService to be invalid include e.g being closed, in the process of being refreshed, or incorrectly configured. Use this value to shortcircuit async requests. However, it is not guaranteed that a getAsync(com.palantir.atlasdb.keyvalue.api.TableReference, java.util.Map<com.palantir.atlasdb.keyvalue.api.Cell, java.lang.Long>) call will not fail even after isValid has returned true - the AsyncKeyValueService may transition to invalid between the `isValid` call and a `getAsync` call.
        Returns:
        true iff the AsyncKeyValueService is currently capable of handling requests at the instant this method was called, otherwise false.