Author: szetszwo
Date: Fri Nov 21 16:08:58 2008
New Revision: 719757

URL: http://svn.apache.org/viewvc?rev=719757&view=rev
Log:
HADOOP-4647. NamenodeFsck should close the DFSClient it has created. (szetszwo)

Modified:
    hadoop/core/branches/branch-0.18/CHANGES.txt
    
hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/NamenodeFsck.java
    
hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/TestFsck.java

Modified: hadoop/core/branches/branch-0.18/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/CHANGES.txt?rev=719757&r1=719756&r2=719757&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.18/CHANGES.txt Fri Nov 21 16:08:58 2008
@@ -31,6 +31,9 @@
     HADOOP-4703. Should not wait for proxy forever in lease recovering.
     (szetszwo)
 
+    HADOOP-4647. NamenodeFsck should close the DFSClient it has created.
+    (szetszwo)
+
 Release 0.18.2 - 2008-11-03
 
   BUG FIXES

Modified: 
hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/NamenodeFsck.java
URL: 
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/NamenodeFsck.java?rev=719757&r1=719756&r2=719757&view=diff
==============================================================================
--- 
hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/NamenodeFsck.java
 (original)
+++ 
hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/NamenodeFsck.java
 Fri Nov 21 16:08:58 2008
@@ -300,6 +300,7 @@
   private void lostFoundMove(DFSFileInfo file, LocatedBlocks blocks)
     throws IOException {
     DFSClient dfs = new DFSClient(conf);
+    try {
     if (!lfInited) {
       lostFoundInit(dfs);
     }
@@ -359,6 +360,9 @@
       e.printStackTrace();
       LOG.warn(errmsg + ": " + e.getMessage());
     }
+    } finally {
+      dfs.close();
+    }
   }
       
   /*

Modified: 
hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/TestFsck.java
URL: 
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/TestFsck.java?rev=719757&r1=719756&r2=719757&view=diff
==============================================================================
--- 
hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/TestFsck.java 
(original)
+++ 
hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/TestFsck.java 
Fri Nov 21 16:08:58 2008
@@ -67,6 +67,7 @@
     FileSystem fs = null;
     try {
       Configuration conf = new Configuration();
+      conf.setLong("dfs.blockreport.intervalMsec", 10000L);
       cluster = new MiniDFSCluster(conf, 4, true, null);
       fs = cluster.getFileSystem();
       util.createFiles(fs, "/srcdat");
@@ -102,6 +103,7 @@
     FileSystem fs = null;
     try {
       Configuration conf = new Configuration();
+      conf.setLong("dfs.blockreport.intervalMsec", 10000L);
       cluster = new MiniDFSCluster(conf, 4, true, null);
       fs = cluster.getFileSystem();
       util.createFiles(fs, "/srcdat");
@@ -122,7 +124,7 @@
     FileSystem fs = null;
     try {
       Configuration conf = new Configuration();
-      conf.set("dfs.blockreport.intervalMsec", Integer.toString(30));
+      conf.setLong("dfs.blockreport.intervalMsec", 10000L);
       cluster = new MiniDFSCluster(conf, 4, true, null);
       String topDir = "/srcdat";
       fs = cluster.getFileSystem();
@@ -179,6 +181,7 @@
     FileSystem fs = null;
     try {
       Configuration conf = new Configuration();
+      conf.setLong("dfs.blockreport.intervalMsec", 10000L);
       cluster = new MiniDFSCluster(conf, 4, true, null);
       String topDir = "/srcdat";
       String randomString = "HADOOP  ";


Reply via email to