Interface CounterStateStore
- All Superinterfaces:
AutoCloseable
,StateStore
The state store supports counters.
-
Method Summary
Modifier and TypeMethodDescriptionlong
getCounter
(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.void
incrCounter
(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.
-
Method Details
-
incrCounter
Increment the builtin distributed counter referred by key.- Parameters:
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.- Parameters:
key
- The name of the keyamount
- The amount to be incremented
-
getCounter
Retrieve the counter value for the key.- Parameters:
key
- name of the key- Returns:
- 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.- Parameters:
key
- name of the key- Returns:
- the amount of the counter value for this key
-