Class ReCounter

  • All Implemented Interfaces:
    Counter

    @Immutable
    @Loggable(1)
    public final class ReCounter
    extends Object
    implements Counter
    Retriable counter.
    Since:
    0.5
    • Constructor Detail

      • ReCounter

        public ReCounter​(Counter orgn)
        Ctor.
        Parameters:
        orgn - Original object
    • Method Detail

      • name

        @RetryOnFailure(verbose=false,
                        attempts=20,
                        delay=20L,
                        unit=SECONDS)
        public String name()
        Description copied from interface: Counter
        Its name.
        Specified by:
        name in interface Counter
        Returns:
        Name of this lock
      • set

        @RetryOnFailure(verbose=false,
                        attempts=20,
                        delay=20L,
                        unit=SECONDS)
        public void set​(long value)
                 throws IOException
        Description copied from interface: Counter
        Set specific value.
        Specified by:
        set in interface Counter
        Parameters:
        value - Value to set
        Throws:
        IOException - If some I/O problem
      • incrementAndGet

        @RetryOnFailure(verbose=false,
                        attempts=20,
                        delay=20L,
                        unit=SECONDS)
        public long incrementAndGet​(long delta)
                             throws IOException
        Description copied from interface: Counter
        Add value to it.
        Specified by:
        incrementAndGet in interface Counter
        Parameters:
        delta - Delta to add (can be zero or negative)
        Returns:
        New value
        Throws:
        IOException - If some I/O problem