Package com.linkedin.alpini.base.misc
Class RetryCounter
- java.lang.Object
-
- com.linkedin.alpini.base.misc.RetryCounter
-
public class RetryCounter extends java.lang.ObjectA 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 longgetCurrentSecond()Return current second starting based on System.nanoTime.longgetRetryCount()longgetTimestamp()longgetTotalCount()voidincrement(boolean isRetry)java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
getTimestamp
public long getTimestamp()
-
-