public class AtomixCounter extends Object implements org.onosproject.store.service.AsyncAtomicCounter
AsyncAtomicCounter implementation backed by Atomix
DistributedLong.| Constructor and Description |
|---|
AtomixCounter(String name,
io.atomix.variables.DistributedLong distLong) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Long> |
addAndGet(long delta) |
CompletableFuture<Boolean> |
compareAndSet(long expectedValue,
long updateValue) |
CompletableFuture<Long> |
get() |
CompletableFuture<Long> |
getAndAdd(long delta) |
CompletableFuture<Long> |
getAndIncrement() |
CompletableFuture<Long> |
incrementAndGet() |
String |
name() |
CompletableFuture<Void> |
set(long value) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic AtomixCounter(String name, io.atomix.variables.DistributedLong distLong)
public String name()
name in interface org.onosproject.store.service.DistributedPrimitivepublic CompletableFuture<Long> incrementAndGet()
incrementAndGet in interface org.onosproject.store.service.AsyncAtomicCounterpublic CompletableFuture<Long> getAndIncrement()
getAndIncrement in interface org.onosproject.store.service.AsyncAtomicCounterpublic CompletableFuture<Long> getAndAdd(long delta)
getAndAdd in interface org.onosproject.store.service.AsyncAtomicCounterpublic CompletableFuture<Long> addAndGet(long delta)
addAndGet in interface org.onosproject.store.service.AsyncAtomicCounterpublic CompletableFuture<Long> get()
get in interface org.onosproject.store.service.AsyncAtomicCounterpublic CompletableFuture<Void> set(long value)
set in interface org.onosproject.store.service.AsyncAtomicCounterpublic CompletableFuture<Boolean> compareAndSet(long expectedValue, long updateValue)
compareAndSet in interface org.onosproject.store.service.AsyncAtomicCounterCopyright © 2016. All rights reserved.