Package com.linkedin.alpini.base.misc
Class RetryCounter
- java.lang.Object
-
- com.linkedin.alpini.base.misc.RetryCounter
-
public class RetryCounter extends java.lang.Object
A non-thread safe counter that should be used and increased in a single thread env when the increment is called
-
-
Constructor Summary
Constructors Constructor Description RetryCounter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static long
getCurrentSecond()
Return current second starting based on System.nanoTime.long
getRetryCount()
long
getTimestamp()
long
getTotalCount()
void
increment(boolean isRetry)
java.lang.String
toString()
-
-
-
Method Detail
-
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 java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getTimestamp
public long getTimestamp()
-
-