接口 CounterStateStore
- 所有超级接口:
AutoCloseable,StateStore
The state store supports counters.
-
方法概要
修饰符和类型方法说明longgetCounter(String key) Retrieve the counter value for the key.getCounterAsync(String key) Retrieve the counter value for the key, but don't wait for the operation to be completed.voidincrCounter(String key, long amount) Increment the builtin distributed counter referred by key.incrCounterAsync(String key, long amount) Increment the builtin distributed counter referred by key but dont wait for the completion of the increment operation.
-
方法详细资料
-
incrCounter
Increment the builtin distributed counter referred by key.- 参数:
key- The name of the keyamount- The amount to be incremented
-
incrCounterAsync
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
Retrieve the counter value for the key.- 参数:
key- name of the key- 返回:
- the amount of the counter value for this key
-
getCounterAsync
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
-