public abstract class LoggingMonotonicTimestampGenerator extends AbstractMonotonicTimestampGenerator
onDrift(long, long) for more information).| Modifier | Constructor and Description |
|---|---|
protected |
LoggingMonotonicTimestampGenerator(long warningThreshold,
TimeUnit warningThresholdUnit,
long warningInterval,
TimeUnit warningIntervalUnit)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
onDrift(long currentTick,
long lastTimestamp)
Called when generated timestamps drift into the future compared to the underlying clock (in
other words, if
lastTimestamp >= currentTick). |
computeNextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnextprotected 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 warningThreshold.warningInterval - how often the warning will be logged if timestamps keep drifting above
the threshold.warningIntervalUnit - the unit for warningIntervalUnit.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
category com.datastax.driver.core.TimestampGenerator.
onDrift in class AbstractMonotonicTimestampGeneratorcurrentTick - the current clock tick.lastTimestamp - the last timestamp that was generated.Copyright © 2012–2020. All rights reserved.