public boolean shouldRetainLog() { return isDisabled() || System.currentTimeMillis() - logInitedTimeMillis < logRetentionMillis; } }
if(logRetentionContext != null && !logRetentionContext.shouldRetainLog()){ obsoleteRetentionLogFiles.addAll(candidates); candidates.clear();
private AggregatedLogFormat.LogRetentionContext getRetentionContext() { final long logRetentionSecs = conf.getLong(YarnConfiguration.LOG_AGGREGATION_RETAIN_SECONDS, YarnConfiguration.DEFAULT_LOG_AGGREGATION_RETAIN_SECONDS); return new AggregatedLogFormat.LogRetentionContext( recoveredLogInitedTime, logRetentionSecs * 1000); }