Class RetryCounter

java.lang.Object
com.linkedin.alpini.base.misc.RetryCounter

public class RetryCounter extends Object
A non-thread safe counter that should be used and increased in a single thread env when the increment is called
  • Constructor Details

    • RetryCounter

      public RetryCounter()
  • Method Details

    • getCurrentSecond

      public static long getCurrentSecond()
      Return current second starting based on System.nanoTime. It is good for a short period comparison.
      Returns:
    • increment

      public void increment(boolean isRetry)
    • getRetryCount

      public long getRetryCount()
    • getTotalCount

      public long getTotalCount()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getTimestamp

      public long getTimestamp()