Fixed AtomicCounter database command names
Change-Id: I90a698b7692834042e318ad21a7ba862b076315f
Showing
2 changed files
with
3 additions
and
11 deletions
... | @@ -98,10 +98,7 @@ public interface DatabaseState<K, V> { | ... | @@ -98,10 +98,7 @@ public interface DatabaseState<K, V> { |
98 | Result<Boolean> replace(String tableName, K key, long oldVersion, V newValue); | 98 | Result<Boolean> replace(String tableName, K key, long oldVersion, V newValue); |
99 | 99 | ||
100 | @Command | 100 | @Command |
101 | - Long counterIncrementAndGet(String counterName); | 101 | + Long counterAddAndGet(String counterName, long delta); |
102 | - | ||
103 | - @Command | ||
104 | - Long counterGetAndIncrement(String counterName); | ||
105 | 102 | ||
106 | @Command | 103 | @Command |
107 | Long counterGetAndAdd(String counterName, long delta); | 104 | Long counterGetAndAdd(String counterName, long delta); | ... | ... |
... | @@ -225,13 +225,8 @@ public class DefaultDatabaseState implements DatabaseState<String, byte[]> { | ... | @@ -225,13 +225,8 @@ public class DefaultDatabaseState implements DatabaseState<String, byte[]> { |
225 | } | 225 | } |
226 | 226 | ||
227 | @Override | 227 | @Override |
228 | - public Long counterIncrementAndGet(String counterName) { | 228 | + public Long counterAddAndGet(String counterName, long delta) { |
229 | - return getCounter(counterName).incrementAndGet(); | 229 | + return getCounter(counterName).addAndGet(delta); |
230 | - } | ||
231 | - | ||
232 | - @Override | ||
233 | - public Long counterGetAndIncrement(String counterName) { | ||
234 | - return getCounter(counterName).getAndIncrement(); | ||
235 | } | 230 | } |
236 | 231 | ||
237 | @Override | 232 | @Override | ... | ... |
-
Please register or login to post a comment