Pārlūkot izejas kodu

HDFS-463. CreateEditLog utility broken after HDFS-396 (URI for
FSImage). (Suresh Srinivas via rangadi)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/trunk@794953 13f79535-47bb-0310-9956-ffa450edef68

Raghu Angadi 16 gadi atpakaļ
vecāks
revīzija
1cc275771e

+ 3 - 0
CHANGES.txt

@@ -83,6 +83,9 @@ Trunk (unreleased changes)
     HDFS-445. pread() does not pick up changes to block locations. 
     (Kan Zhang via rangadi) 
 
+    HDFS-463. CreateEditLog utility broken after HDFS-396 (URI for
+    FSImage). (Suresh Srinivas via rangadi)
+
 Release 0.20.1 - Unreleased
 
   IMPROVEMENTS

+ 2 - 9
src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/CreateEditsLog.java

@@ -54,7 +54,7 @@ import org.apache.hadoop.hdfs.server.namenode.BlocksMap.BlockInfo;
 public class CreateEditsLog {
   static final String BASE_PATH = "/createdViaInjectingInEditsLog";
   static final String EDITS_DIR = "/tmp/EditsLogOut";
-  static String edits_dir = "file:// " + EDITS_DIR; // process as URI
+  static String edits_dir = EDITS_DIR;
   static final public long BLOCK_GENERATION_STAMP =
     GenerationStamp.FIRST_VALID_STAMP;
   
@@ -198,16 +198,9 @@ public class CreateEditsLog {
       }
     }
     
-    FSImage fsImage = null;
-    try {
-      fsImage = new FSImage(new URI(edits_dir));
-    } catch (URISyntaxException use) {
-      throw new IOException("Error while processing URI: " + edits_dir + 
-          ". The full error message was: " + use.getMessage());
-    }
+    FSImage fsImage = new FSImage(editsLogDir.getAbsoluteFile().toURI());
     FileNameGenerator nameGenerator = new FileNameGenerator(BASE_PATH, 100);
 
-
     FSEditLog editLog = fsImage.getEditLog();
     editLog.createEditLogFile(fsImage.getFsEditName());
     editLog.open();