소스 검색

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

Surendra Singh Lilhore 5 년 전
부모
커밋
fd264b8265

+ 4 - 6
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java

@@ -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()));
   }