@Override public synchronized Instant getCommitTime() { if (commitTime==null) { //set commit time to current time commitTime = times.getTime(); } return commitTime; }
@Override public Timer getTimer() { return new Timer(this); }
@Override public String toString() { return name(); }
@Override protected void waitCondition() throws InterruptedException { if (lastInvocation!=null) times.sleepPast(lastInvocation.plus(CLEAN_SLEEP_TIME)); }
public static long getSchemaConvergenceTime(ChronoUnit u) { final long sec = 60L; long l = Temporals.timeUnit(u).convert(sec, TimeUnit.SECONDS); // Check that a narrowing cast to int will not overflow, in case a test decides to try it. Preconditions.checkState(Integer.MIN_VALUE <= l && Integer.MAX_VALUE >= l, "Schema convergence time %d is too large to express as an integer in %s", sec, u); return l; }
/** * Returns the start time of this marker if such has been defined or the current time if not * @return */ public synchronized Instant getStartTime(TimestampProvider times) { if (startTime==null) { startTime = times.getTime(); } return startTime; }
private TestMessage(StaticBuffer content) { this.time = times.getTime(); this.content = content; }
public long getDeletionTime(TimestampProvider times) { return times.getTime(t) & 0xFFFFFFFFFFFFFFFEL; // zero the LSB }
public long getAdditionTime(TimestampProvider times) { return (times.getTime(t) & 0xFFFFFFFFFFFFFFFEL) | 1L; // force the LSB to 1 }
public Timer stop() { Preconditions.checkState(null != start, "Timer stopped before it was started"); stop = times.getTime(); return this; }
public Timer start() { Preconditions.checkState(null == start, "Timer can only be started once"); start = times.getTime(); return this; }
public Duration elapsed() { if (null == start) { return Duration.ZERO; } final Instant stopTime = (null==stop? times.getTime() : stop); return Duration.between(start, stopTime); }
/** * ################################### * Message Serialization & Utility * ################################### */ private int getTimeSlice(Instant timestamp) { long value = times.getTime(timestamp) / TIMESLICE_INTERVAL; if (value>Integer.MAX_VALUE || value<0) throw new IllegalArgumentException("Timestamp overflow detected: " + timestamp); return (int)value; }
@Override protected void action() { lastInvocation = times.getTime(); txCache.cleanUp(); }
public Instant getAdditionTimeInstant(TimestampProvider times) { return times.getTime(getAdditionTime(times)); } }
public RowIterator(Token minimum, Token maximum, SliceQuery sliceQuery, int pageSize, StoreTransaction txh) throws BackendException { this.pageSize = pageSize; this.sliceQuery = sliceQuery; this.maximumToken = maximum; this.txh = txh; this.nowMillis = times.getTime().toEpochMilli(); this.keys = getRowsIterator(getKeySlice(minimum, maximum, sliceQuery, pageSize, nowMillis)); }