From ae1c931095db32d3b661b20604e19a0b9ffd68ab Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Fri, 7 Jun 2013 17:39:18 +0000 Subject: [PATCH] HDFS-4880. Merge 1490746 fron trunk git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1490748 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hadoop/hdfs/server/namenode/FSEditLogLoader.java | 1 + .../apache/hadoop/hdfs/server/namenode/FSImageFormat.java | 8 ++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 584c5984fc2..5cef345c174 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -154,6 +154,9 @@ Release 2.1.0-beta - UNRELEASED HDFS-4234. Use generic code for choosing datanode in Balancer. (szetszwo) + HDFS-4880. Print the image and edits file loaded by the namenode in the + logs. (Arpit Agarwal via suresh) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java index 8c20897605d..959d8b1c336 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java @@ -96,6 +96,7 @@ public class FSEditLogLoader { fsNamesys.writeLock(); try { long startTime = now(); + FSImage.LOG.info("Start loading edits file " + edits.getName()); long numEdits = loadEditRecords(edits, false, expectedStartingTxId, recovery); FSImage.LOG.info("Edits file " + edits.getName() diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormat.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormat.java index 8cea71365c0..1421ba21ffe 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormat.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormat.java @@ -325,8 +325,8 @@ public class FSImageFormat { imgDigest = new MD5Hash(digester.digest()); loaded = true; - LOG.info("Image file of size " + curFile.length() + " loaded in " - + (now() - startTime)/1000 + " seconds."); + LOG.info("Image file " + curFile + " of size " + curFile.length() + + " bytes loaded in " + (now() - startTime)/1000 + " seconds."); } /** Update the root node's attributes */ @@ -872,8 +872,8 @@ public class FSImageFormat { // set md5 of the saved image savedDigest = new MD5Hash(digester.digest()); - LOG.info("Image file of size " + newFile.length() + " saved in " - + (now() - startTime)/1000 + " seconds."); + LOG.info("Image file " + newFile + " of size " + newFile.length() + + " bytes saved in " + (now() - startTime)/1000 + " seconds."); } /**