/** * 3 possibilities * - If maxLastModifiedInterval <= 0 then return 0 which is interpreted as current by delete call * (For testing purposes only) * - If oldest checkpoint creation date > 0 then reference time is the earliest of that and the parameter * maxModificationReferenceTime * - Else the parameter maxModificationReferenceTime is used as the reference time * * @param maxModificationReferenceTime typically the mark phase start time (could be 0 for tests) * @return max modified time of blobs to be considered for deletion */ private long getMaxModifiedTime(long maxModificationReferenceTime) { if (maxLastModifiedInterval <= 0) { return 0; } long oldestCheckpoint = -1; if (checkpointMbean != null) { oldestCheckpoint = checkpointMbean.getOldestCheckpointCreationDate().getTime(); LOG.debug("Oldest checkpoint data retrieved {} ", oldestCheckpoint); } LOG.debug("maxModificationReferenceTime {} ", maxModificationReferenceTime); maxModificationReferenceTime = maxModificationReferenceTime <= 0 ? System.currentTimeMillis() : maxModificationReferenceTime; long calculatedReferenceTime = (oldestCheckpoint <= 0 ? maxModificationReferenceTime : Math.min(maxModificationReferenceTime, oldestCheckpoint)); LOG.debug("Calculated reference time {} ", calculatedReferenceTime); return (calculatedReferenceTime - maxLastModifiedInterval); }
/** * 3 possibilities * - If maxLastModifiedInterval <= 0 then return 0 which is interpreted as current by delete call * (For testing purposes only) * - If oldest checkpoint creation date > 0 then reference time is the earliest of that and the parameter * maxModificationReferenceTime * - Else the parameter maxModificationReferenceTime is used as the reference time * * @param maxModificationReferenceTime typically the mark phase start time (could be 0 for tests) * @return max modified time of blobs to be considered for deletion */ private long getMaxModifiedTime(long maxModificationReferenceTime) { if (maxLastModifiedInterval <= 0) { return 0; } long oldestCheckpoint = -1; if (checkpointMbean != null) { oldestCheckpoint = checkpointMbean.getOldestCheckpointCreationDate().getTime(); LOG.debug("Oldest checkpoint data retrieved {} ", oldestCheckpoint); } LOG.debug("maxModificationReferenceTime {} ", maxModificationReferenceTime); maxModificationReferenceTime = maxModificationReferenceTime <= 0 ? System.currentTimeMillis() : maxModificationReferenceTime; long calculatedReferenceTime = (oldestCheckpoint <= 0 ? maxModificationReferenceTime : Math.min(maxModificationReferenceTime, oldestCheckpoint)); LOG.debug("Calculated reference time {} ", calculatedReferenceTime); return (calculatedReferenceTime - maxLastModifiedInterval); }
/** * 3 possibilities * - If maxLastModifiedInterval <= 0 then return 0 which is interpreted as current by delete call * (For testing purposes only) * - If oldest checkpoint creation date > 0 then reference time is the earliest of that and the parameter * maxModificationReferenceTime * - Else the parameter maxModificationReferenceTime is used as the reference time * * @param maxModificationReferenceTime typically the mark phase start time (could be 0 for tests) * @return max modified time of blobs to be considered for deletion */ private long getMaxModifiedTime(long maxModificationReferenceTime) { if (maxLastModifiedInterval <= 0) { return 0; } long oldestCheckpoint = -1; if (checkpointMbean != null) { oldestCheckpoint = checkpointMbean.getOldestCheckpointCreationDate().getTime(); LOG.debug("Oldest checkpoint data retrieved {} ", oldestCheckpoint); } LOG.debug("maxModificationReferenceTime {} ", maxModificationReferenceTime); maxModificationReferenceTime = maxModificationReferenceTime <= 0 ? System.currentTimeMillis() : maxModificationReferenceTime; long calculatedReferenceTime = (oldestCheckpoint <= 0 ? maxModificationReferenceTime : Math.min(maxModificationReferenceTime, oldestCheckpoint)); LOG.debug("Calculated reference time {} ", calculatedReferenceTime); return (calculatedReferenceTime - maxLastModifiedInterval); }