public abstract class LoggingMonotonicTimestampGenerator extends AbstractMonotonicTimestampGenerator
onDrift(long, long)for more information).
|Modifier||Constructor and Description|
Creates a new instance.
|Modifier and Type||Method and Description|
Called when generated timestamps drift into the future compared to the underlying clock (in other words, if
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected LoggingMonotonicTimestampGenerator(long warningThreshold, TimeUnit warningThresholdUnit, long warningInterval, TimeUnit warningIntervalUnit)
warningThreshold- how far in the future timestamps are allowed to drift before a warning is logged.
warningThresholdUnit- the unit for
warningInterval- how often the warning will be logged if timestamps keep drifting above the threshold.
warningIntervalUnit- the unit for
protected void onDrift(long currentTick, long lastTimestamp)
lastTimestamp >= currentTick).
This could happen if timestamps are requested faster than the clock granularity, or on a clock skew (for example because of a leap second).
This implementation logs a warning at regular intervals when timestamps drift more than a
specified threshold in the future. These messages are emitted at
WARN level in the
currentTick- the current clock tick.
lastTimestamp- the last timestamp that was generated.
Copyright © 2012–2018. All rights reserved.