Interface CounterStateStore

  • All Superinterfaces:
    java.lang.AutoCloseable, StateStore

    public interface CounterStateStore
    extends StateStore
    The state store supports counters.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      long getCounter​(java.lang.String key)
      Retrieve the counter value for the key.
      java.util.concurrent.CompletableFuture<java.lang.Long> getCounterAsync​(java.lang.String key)
      Retrieve the counter value for the key, but don't wait for the operation to be completed
      void incrCounter​(java.lang.String key, long amount)
      Increment the builtin distributed counter referred by key.
      java.util.concurrent.CompletableFuture<java.lang.Void> incrCounterAsync​(java.lang.String key, long amount)
      Increment the builtin distributed counter referred by key but dont wait for the completion of the increment operation
    • Method Detail

      • incrCounter

        void incrCounter​(java.lang.String key,
                         long amount)
        Increment the builtin distributed counter referred by key.
        Parameters:
        key - The name of the key
        amount - The amount to be incremented
      • incrCounterAsync

        java.util.concurrent.CompletableFuture<java.lang.Void> incrCounterAsync​(java.lang.String key,
                                                                                long amount)
        Increment the builtin distributed counter referred by key but dont wait for the completion of the increment operation
        Parameters:
        key - The name of the key
        amount - The amount to be incremented
      • getCounter

        long getCounter​(java.lang.String key)
        Retrieve the counter value for the key.
        Parameters:
        key - name of the key
        Returns:
        the amount of the counter value for this key
      • getCounterAsync

        java.util.concurrent.CompletableFuture<java.lang.Long> getCounterAsync​(java.lang.String key)
        Retrieve the counter value for the key, but don't wait for the operation to be completed
        Parameters:
        key - name of the key
        Returns:
        the amount of the counter value for this key