/** * Updates the last updated time. This should be called when references are added or removed. */protectedsynchronizedvoid touch() {
lastUsed = Time.currentTimeMillis();
LOG.debug("Setting {} ts to {}", blobKey, lastUsed);
}

privatevoid rotateIfNeeded() {
long nowMs = Time.currentTimeMillis();
if (nowMs >= lastRotationMs + timeoutMs) {
//Rotate once per timeout period that has passed since last time this was called.//This is necessary since this method may be called at arbitrary intervals.int rotationsToDo = (int)((nowMs - lastRotationMs) / timeoutMs);
for (int i = 0; i < rotationsToDo; i++) {
cachedGroups.rotate();
}
lastRotationMs = nowMs;
}
}

Javadoc

This class implements time simulation support. When time simulation is enabled, methods on this class will use fixed time.
When time simulation is disabled, methods will pass through to relevant java.lang.System/java.lang.Thread calls.
Methods using units higher than nanoseconds will pass through to System.currentTimeMillis(). Methods supporting nanoseconds will pass through to System.nanoTime().