接口 CounterStateStore
-
- 所有超级接口:
java.lang.AutoCloseable,StateStore
public interface CounterStateStore extends StateStore
The state store supports counters.
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 longgetCounter(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 completedvoidincrCounter(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
-
-
-
方法详细资料
-
incrCounter
void incrCounter(java.lang.String key, long amount)Increment the builtin distributed counter referred by key.- 参数:
key- The name of the keyamount- 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- 参数:
key- The name of the keyamount- The amount to be incremented
-
getCounter
long getCounter(java.lang.String key)
Retrieve the counter value for the key.- 参数:
key- name of the key- 返回:
- 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- 参数:
key- name of the key- 返回:
- the amount of the counter value for this key
-
-