hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r566774 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/FSNamesystem.java src/java/org/apache/hadoop/dfs/PendingReplicationBlocks.java src/java/org/apache/hadoop/dfs/ReplicationTargetChooser.java
Date Thu, 16 Aug 2007 16:58:12 GMT
Author: cutting
Date: Thu Aug 16 09:58:10 2007
New Revision: 566774

URL: http://svn.apache.org/viewvc?view=rev&rev=566774
Log:
HADOOP-1693.  Remove un-needed log fields.  Contributed by Konstantin.

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/PendingReplicationBlocks.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/ReplicationTargetChooser.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=566774&r1=566773&r2=566774
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Thu Aug 16 09:58:10 2007
@@ -47,6 +47,9 @@
     HADOOP-1595.  dfsshell can wait for a file to achieve its intended
     replication target. (Tsz Wo (Nicholas), SZE via dhruba)
 
+    HADOOP-1693.  Remove un-needed log fields in DFS replication classes,
+    since the log may be accessed statically. (Konstantin Shvachko via cutting)
+
 
 Release 0.14.0 - 2007-08-17
 

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=566774&r1=566773&r2=566774
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java Thu Aug 16 09:58:10
2007
@@ -217,7 +217,7 @@
     this.dir.loadFSImage(getNamespaceDirs(conf), startOpt);
     this.safeMode = new SafeModeInfo(conf);
     setBlockTotal();
-    pendingReplications = new PendingReplicationBlocks(LOG);
+    pendingReplications = new PendingReplicationBlocks();
     this.hbthread = new Daemon(new HeartbeatMonitor());
     this.lmthread = new Daemon(new LeaseMonitor());
     this.replthread = new Daemon(new ReplicationMonitor());
@@ -277,10 +277,9 @@
   private void setConfigurationParameters(Configuration conf) 
                                           throws IOException {
     this.replicator = new ReplicationTargetChooser(
-                                                   conf.getBoolean("dfs.replication.considerLoad",
true),
-                                                   this,
-                                                   clusterMap,
-                                                   LOG);
+                         conf.getBoolean("dfs.replication.considerLoad", true),
+                         this,
+                         clusterMap);
     this.defaultReplication = conf.getInt("dfs.replication", 3);
     this.maxReplication = conf.getInt("dfs.replication.max", 512);
     this.minReplication = conf.getInt("dfs.replication.min", 1);

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/PendingReplicationBlocks.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/PendingReplicationBlocks.java?view=diff&rev=566774&r1=566773&r2=566774
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/PendingReplicationBlocks.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/PendingReplicationBlocks.java Thu Aug
16 09:58:10 2007
@@ -17,7 +17,6 @@
  */
 package org.apache.hadoop.dfs;
 
-import org.apache.commons.logging.*;
 import org.apache.hadoop.util.*;
 import java.io.*;
 import java.util.*;
@@ -35,7 +34,6 @@
  *
  ***************************************************/
 class PendingReplicationBlocks {
-  private Log LOG = null;
   private Map<Block, PendingBlockInfo> pendingReplications;
   private ArrayList<Block> timedOutItems;
   Daemon timerThread = null;
@@ -53,8 +51,7 @@
     init();
   }
 
-  PendingReplicationBlocks(Log log) {
-    this.LOG = log;
+  PendingReplicationBlocks() {
     init();
   }
 
@@ -184,10 +181,8 @@
           pendingReplicationCheck();
           Thread.sleep(period);
         } catch (InterruptedException ie) {
-          if (LOG != null) {
-            LOG.warn("PendingReplicationMonitor thread received exception. " 
-                     + ie);
-          }
+          FSNamesystem.LOG.warn(
+                "PendingReplicationMonitor thread received exception. " + ie);
         }
       }
     }
@@ -207,9 +202,8 @@
             synchronized (timedOutItems) {
               timedOutItems.add(block);
             }
-            if (LOG != null) {
-              LOG.warn("PendingReplicationMonitor timed out block " + block);
-            }
+            FSNamesystem.LOG.warn(
+                "PendingReplicationMonitor timed out block " + block);
             iter.remove();
           }
         }

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/ReplicationTargetChooser.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/ReplicationTargetChooser.java?view=diff&rev=566774&r1=566773&r2=566774
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/ReplicationTargetChooser.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/ReplicationTargetChooser.java Thu Aug
16 09:58:10 2007
@@ -33,15 +33,13 @@
 class ReplicationTargetChooser {
   private final boolean considerLoad; 
   private NetworkTopology clusterMap;
-  private Log logr;
   private FSNamesystem fs;
     
   ReplicationTargetChooser(boolean considerLoad,  FSNamesystem fs,
-                           NetworkTopology clusterMap, Log logr) {
+                           NetworkTopology clusterMap) {
     this.considerLoad = considerLoad;
     this.fs = fs;
     this.clusterMap = clusterMap;
-    this.logr = logr;
   }
     
   private static class NotEnoughReplicasException extends Exception {
@@ -175,7 +173,7 @@
                      blocksize, maxNodesPerRack, results);
       }
     } catch (NotEnoughReplicasException e) {
-      logr.warn("Not able to place enough replicas, still in need of "
+      FSNamesystem.LOG.warn("Not able to place enough replicas, still in need of "
                + numOfReplicas);
     }
     return writer;
@@ -386,7 +384,7 @@
                                long blockSize, int maxTargetPerLoc,
                                boolean considerLoad,
                                List<DatanodeDescriptor> results) {
-      
+    Log logr = FSNamesystem.LOG;
     // check if the node is (being) decommissed
     if (node.isDecommissionInProgress() || node.isDecommissioned()) {
       logr.debug("Node "+node.getPath()+



Mime
View raw message