HDFS-14995. Use log variable directly instead of passing as argument in InvalidateBlocks#printBlockDeletionTime(). Contributed by Lisheng Sun.

This commit is contained in:
Surendra Singh Lilhore 2019-11-21 00:00:42 +05:30
parent be77231452
commit fd264b8265
1 changed files with 4 additions and 6 deletions

View File

@ -41,8 +41,6 @@ import org.apache.hadoop.hdfs.DFSUtil;
import com.google.common.annotations.VisibleForTesting;
import org.slf4j.Logger;
/**
* Keeps a Collection for every named machine containing blocks
* that have recently been invalidated and are thought to live
@ -72,17 +70,17 @@ class InvalidateBlocks {
this.blockInvalidateLimit = blockInvalidateLimit;
this.pendingPeriodInMs = pendingPeriodInMs;
this.blockIdManager = blockIdManager;
printBlockDeletionTime(BlockManager.LOG);
printBlockDeletionTime();
}
private void printBlockDeletionTime(final Logger log) {
log.info("{} is set to {}",
private void printBlockDeletionTime() {
BlockManager.LOG.info("{} is set to {}",
DFSConfigKeys.DFS_NAMENODE_STARTUP_DELAY_BLOCK_DELETION_SEC_KEY,
DFSUtil.durationToString(pendingPeriodInMs));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy MMM dd HH:mm:ss");
Calendar calendar = new GregorianCalendar();
calendar.add(Calendar.SECOND, (int) (this.pendingPeriodInMs / 1000));
log.info("The block deletion will start around {}",
BlockManager.LOG.info("The block deletion will start around {}",
sdf.format(calendar.getTime()));
}