Interface RBucketAsync<V>

    • Method Detail

      • sizeAsync

        RFuture<Long> sizeAsync()
        Returns size of object in bytes
        Returns:
        object size
      • getAsync

        RFuture<V> getAsync()
        Retrieves element stored in the holder.
        Returns:
        element
      • getAndDeleteAsync

        RFuture<V> getAndDeleteAsync()
        Retrieves element in the holder and removes it.
        Returns:
        element
      • trySetAsync

        RFuture<Boolean> trySetAsync​(V value)
        Tries to set element atomically into empty holder.
        Parameters:
        value - - value to set
        Returns:
        true if successful, or false if element was already set
      • trySetAsync

        RFuture<Boolean> trySetAsync​(V value,
                                     long timeToLive,
                                     TimeUnit timeUnit)
        Tries to set element atomically into empty holder with defined timeToLive interval.
        Parameters:
        value - - value to set
        timeToLive - - time to live interval
        timeUnit - - unit of time to live interval
        Returns:
        true if successful, or false if element was already set
      • compareAndSetAsync

        RFuture<Boolean> compareAndSetAsync​(V expect,
                                            V update)
        Atomically sets the value to the given updated value only if serialized state of the current value equals to serialized state of the expected value.
        Parameters:
        expect - the expected value
        update - the new value
        Returns:
        true if successful; or false if the actual value was not equal to the expected value.
      • getAndSetAsync

        RFuture<V> getAndSetAsync​(V newValue)
        Retrieves current element in the holder and replaces it with newValue.
        Parameters:
        newValue - - value to set
        Returns:
        previous value
      • setAsync

        RFuture<Void> setAsync​(V value)
        Stores element into the holder.
        Parameters:
        value - - value to set
        Returns:
        void
      • setAsync

        RFuture<Void> setAsync​(V value,
                               long timeToLive,
                               TimeUnit timeUnit)
        Stores element into the holder with defined timeToLive interval.
        Parameters:
        value - - value to set
        timeToLive - - time to live interval
        timeUnit - - unit of time to live interval
        Returns:
        void