hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r547416 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/FSNamesystem.java src/java/org/apache/hadoop/dfs/NameNode.java
Date Thu, 14 Jun 2007 21:39:16 GMT
Author: cutting
Date: Thu Jun 14 14:39:16 2007
New Revision: 547416

URL: http://svn.apache.org/viewvc?view=rev&rev=547416
Log:
HADOOP-1139.  Log HDFS block transitions at INFO level.  Contributed by Dhruba.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=547416&r1=547415&r2=547416
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Thu Jun 14 14:39:16 2007
@@ -117,6 +117,9 @@
  37. HADOOP-1467.  Remove redundant counters from WordCount example.
      (Owen O'Malley via tomwhite)
 
+ 38. HADOOP-1139.  Log HDFS block transitions at INFO level, to better
+     enable diagnosis of problems.  (Dhruba Borthakur via tomwhite)
+
 
 Release 0.13.0 - 2007-06-08
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java?view=diff&rev=547416&r1=547415&r2=547416
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java Thu Jun 14 14:39:16
2007
@@ -938,9 +938,9 @@
     FileUnderConstruction v = pendingCreates.get(src);
     v.getBlocks().add(b);
     pendingCreateBlocks.add(b);
-    NameNode.stateChangeLog.debug("BLOCK* NameSystem.allocateBlock: "
-                                  +src+ ". "+b.getBlockName()+
-                                  " is created and added to pendingCreates and pendingCreateBlocks");
     
+    NameNode.stateChangeLog.info("BLOCK* NameSystem.allocateBlock: "
+                                 +src+ ". "+b.getBlockName()+
+                                 " is created and added to pendingCreates and pendingCreateBlocks");
     
     return b;
   }
 
@@ -1033,7 +1033,7 @@
     if (count > 1) {
       addToInvalidates(blk, dn);
       removeStoredBlock(blk, getDatanode(dn));
-      NameNode.stateChangeLog.info("BLOCK* NameSystem.invalidateBlocks: "
+      NameNode.stateChangeLog.debug("BLOCK* NameSystem.invalidateBlocks: "
                                    + blk.getBlockName() + " on " 
                                    + dn.getName() + " listed for deletion.");
     } else {
@@ -1084,7 +1084,7 @@
                blocksMap.nodeIterator(b); it.hasNext();) {
           DatanodeDescriptor node = it.next();
           addToInvalidates(b, node);
-          NameNode.stateChangeLog.debug("BLOCK* NameSystem.delete: "
+          NameNode.stateChangeLog.info("BLOCK* NameSystem.delete: "
                                         + b.getBlockName() + " is added to invalidSet of
" 
                                         + node.getName());
         }
@@ -2064,14 +2064,12 @@
     if (added) {
       curReplicaDelta = 1;
       // 
-      // Hairong: I would prefer to set the level of next logrecord
-      // to be debug.
-      // But at startup time, because too many new blocks come in
-      // they simply take up all the space in the log file 
-      // So I set the level to be trace
+      // At startup time, because too many new blocks come in
+      // they take up lots of space in the log file. 
+      // So, we log only when namenode is out of safemode.
       //
-      if (NameNode.stateChangeLog.isTraceEnabled()) {
-        NameNode.stateChangeLog.trace("BLOCK* NameSystem.addStoredBlock: "
+      if (!isInSafeMode()) {
+        NameNode.stateChangeLog.info("BLOCK* NameSystem.addStoredBlock: "
                                       +"blockMap updated: "+node.getName()+" is added to
"+block.getBlockName());
       }
     } else {
@@ -2429,15 +2427,15 @@
       recentInvalidateSets.put(nodeID.getStorageID(), invalidateSet);
     }
         
-    if (NameNode.stateChangeLog.isDebugEnabled()) {
+    if (NameNode.stateChangeLog.isInfoEnabled()) {
       StringBuffer blockList = new StringBuffer();
       for (int i = 0; i < sendBlock.size(); i++) {
         blockList.append(' ');
         Block block = sendBlock.get(i);
         blockList.append(block.getBlockName());
       }
-      NameNode.stateChangeLog.debug("BLOCK* NameSystem.blockToInvalidate: "
-                                    +"ask "+nodeID.getName()+" to delete " + blockList);
+      NameNode.stateChangeLog.info("BLOCK* NameSystem.blockToInvalidate: "
+                                   +"ask "+nodeID.getName()+" to delete " + blockList);
     }
     return sendBlock.toArray(new Block[sendBlock.size()]);
   }

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java?view=diff&rev=547416&r1=547415&r2=547416
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java Thu Jun 14 14:39:16 2007
@@ -361,7 +361,7 @@
    * check the blocks are actually corrupt. 
    */
   public void reportBadBlocks(LocatedBlock[] blocks) throws IOException {
-    stateChangeLog.debug("*DIR* NameNode.reportBadBlocks");
+    stateChangeLog.info("*DIR* NameNode.reportBadBlocks");
     for (int i = 0; i < blocks.length; i++) {
       Block blk = blocks[i].getBlock();
       DatanodeInfo[] nodes = blocks[i].getLocations();



Mime
View raw message