You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by cd...@apache.org on 2008/08/07 01:37:27 UTC

svn commit: r683448 - in /hadoop/core/trunk: CHANGES.txt src/test/org/apache/hadoop/hdfs/CreateEditsLog.java

Author: cdouglas
Date: Wed Aug  6 16:37:26 2008
New Revision: 683448

URL: http://svn.apache.org/viewvc?rev=683448&view=rev
Log:
HADOOP-3846. Fix unit test CreateEditsLog to generate paths correctly. Contributed by Lohit Vjayarenu

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/CreateEditsLog.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=683448&r1=683447&r2=683448&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Wed Aug  6 16:37:26 2008
@@ -227,6 +227,9 @@
     HADOOP-3805. Improve fuse-dfs write performance.
     (Pete Wyckoff via zshao)
 
+    HADOOP-3846. Fix unit test CreateEditsLog to generate paths correctly. 
+    (Lohit Vjayarenu via cdouglas)
+
 Release 0.18.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/CreateEditsLog.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/CreateEditsLog.java?rev=683448&r1=683447&r2=683448&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/CreateEditsLog.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/CreateEditsLog.java Wed Aug  6 16:37:26 2008
@@ -36,15 +36,15 @@
  * 
  * CreateEditsLog
  *   Synopsis: CreateEditsLog -f numFiles StartingBlockId numBlocksPerFile
- *        [-d editsLogDirectory]
+ *        [-r replicafactor] [-d editsLogDirectory]
  *             Default replication factor is 1
  *             Default edits log directory is /tmp/EditsLogOut
  *   
- *   Create an name node's fsimage edits log in /tmp/EditsLogOut.
+ *   Create a name node's edits log in /tmp/EditsLogOut.
  *   The file /tmp/EditsLogOut/current/edits can be copied to a name node's
- *   fsimage directory and the name node can be started off it.
+ *   dfs.name.dir/current direcotry and the name node can be started as usual.
  *   
- *   The file are created in /createdViaInjectingInEditsLog
+ *   The files are created in /createdViaInjectingInEditsLog
  *   The file names contain the starting and ending blockIds; hence once can 
  *   create multiple edits logs using this command using non overlapping 
  *   block ids and feed the files to a single name node.
@@ -87,9 +87,12 @@
 
         INodeFileUnderConstruction inode = new INodeFileUnderConstruction(
                       null, replication, 0, blockSize, blocks, p, "", "", null);
-        String path = iF + "_B" + blocks[0].getBlockId() + 
+        // Append path to filename with information about blockIDs 
+        String path = "_" + iF + "_B" + blocks[0].getBlockId() + 
                       "_to_B" + blocks[blocksPerFile-1].getBlockId() + "_";
-        String filePath = nameGenerator.getNextFileName(path);
+        String filePath = nameGenerator.getNextFileName("");
+        filePath = filePath + path;
+        // Log the new sub directory in edits
         if ((iF % nameGenerator.getFilesPerDirectory())  == 0) {
           String currentDir = nameGenerator.getCurrentDir();
           dirInode = new INodeDirectory(p, 0L);