Class AtomixAtomicCounter

  • All Implemented Interfaces:
    org.onosproject.store.service.AsyncAtomicCounter, org.onosproject.store.service.DistributedPrimitive

    public class AtomixAtomicCounter
    extends Object
    implements org.onosproject.store.service.AsyncAtomicCounter
    Atomix atomic counter.
    • Constructor Detail

      • AtomixAtomicCounter

        public AtomixAtomicCounter​(io.atomix.core.counter.AsyncAtomicCounter atomixCounter)
    • Method Detail

      • name

        public String name()
        Specified by:
        name in interface org.onosproject.store.service.DistributedPrimitive
      • incrementAndGet

        public CompletableFuture<Long> incrementAndGet()
        Specified by:
        incrementAndGet in interface org.onosproject.store.service.AsyncAtomicCounter
      • getAndIncrement

        public CompletableFuture<Long> getAndIncrement()
        Specified by:
        getAndIncrement in interface org.onosproject.store.service.AsyncAtomicCounter
      • getAndAdd

        public CompletableFuture<Long> getAndAdd​(long delta)
        Specified by:
        getAndAdd in interface org.onosproject.store.service.AsyncAtomicCounter
      • addAndGet

        public CompletableFuture<Long> addAndGet​(long delta)
        Specified by:
        addAndGet in interface org.onosproject.store.service.AsyncAtomicCounter
      • get

        public CompletableFuture<Long> get()
        Specified by:
        get in interface org.onosproject.store.service.AsyncAtomicCounter
      • set

        public CompletableFuture<Void> set​(long value)
        Specified by:
        set in interface org.onosproject.store.service.AsyncAtomicCounter
      • compareAndSet

        public CompletableFuture<Boolean> compareAndSet​(long expectedValue,
                                                        long updateValue)
        Specified by:
        compareAndSet in interface org.onosproject.store.service.AsyncAtomicCounter