Class TimestampOverflowException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
me.ahoo.cosid.CosIdException
me.ahoo.cosid.snowflake.exception.TimestampOverflowException
- All Implemented Interfaces:
Serializable
Exception thrown when timestamp exceeds maximum value.
Indicates that the timestamp portion of the ID has overflowed, meaning the generator has been in use for longer than the configured time range allows.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTimestampOverflowException(long epoch, long diffTimestamp, long maxTimestamp) Creates a new exception. -
Method Summary
Modifier and TypeMethodDescriptionlongGets the diff timestamp.longgetEpoch()Gets the epoch.longGets the max timestamp.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TimestampOverflowException
public TimestampOverflowException(long epoch, long diffTimestamp, long maxTimestamp) Creates a new exception.- Parameters:
epoch- the configured epochdiffTimestamp- the calculated timestamp differencemaxTimestamp- the maximum representable timestamp
-
-
Method Details
-
getEpoch
public long getEpoch()Gets the epoch.- Returns:
- the epoch
-
getDiffTimestamp
public long getDiffTimestamp()Gets the diff timestamp.- Returns:
- the diff timestamp
-
getMaxTimestamp
public long getMaxTimestamp()Gets the max timestamp.- Returns:
- the max timestamp
-