Interface CounterDelegate


@Beta
public interface CounterDelegate
Gossip-based counter service.
  • Method Summary

    Modifier and Type Method Description
    long addAndGet​(long delta)
    Atomically adds the given value to the current value.
    void close()
    Closes the counter.
    long decrementAndGet()
    Atomically decrement by one and return the updated value.
    long get()
    Returns the counter value.
    long getAndAdd​(long delta)
    Atomically adds the given value to the current value.
    long getAndDecrement()
    Atomically decrement by one and return the previous value.
    long getAndIncrement()
    Atomically increment by one and return the previous value.
    long incrementAndGet()
    Atomically increment by one and return the updated value.
  • Method Details

    • incrementAndGet

      long incrementAndGet()
      Atomically increment by one and return the updated value.
      Returns:
      updated value
    • decrementAndGet

      long decrementAndGet()
      Atomically decrement by one and return the updated value.
      Returns:
      updated value
    • getAndIncrement

      long getAndIncrement()
      Atomically increment by one and return the previous value.
      Returns:
      previous value
    • getAndDecrement

      long getAndDecrement()
      Atomically decrement by one and return the previous value.
      Returns:
      previous value
    • getAndAdd

      long getAndAdd​(long delta)
      Atomically adds the given value to the current value.
      Parameters:
      delta - the value to add
      Returns:
      previous value
    • addAndGet

      long addAndGet​(long delta)
      Atomically adds the given value to the current value.
      Parameters:
      delta - the value to add
      Returns:
      updated value
    • get

      long get()
      Returns the counter value.
      Returns:
      the counter value
    • close

      void close()
      Closes the counter.