hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rang...@apache.org
Subject svn commit: r656491 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/FSImage.java
Date Thu, 15 May 2008 02:38:09 GMT
Author: rangadi
Date: Wed May 14 19:38:09 2008
New Revision: 656491

URL: http://svn.apache.org/viewvc?rev=656491&view=rev
Log:
HADOOP-3391. Fix a findbugs warning introduced by HADOOP-3248 (rangadi)

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSImage.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=656491&r1=656490&r2=656491&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Wed May 14 19:38:09 2008
@@ -250,6 +250,8 @@
     HADOOP-3203. Fixes TaskTracker::localizeJob to pass correct file sizes
     for the jarfile and the jobfile. (Amareshwari Sriramadasu via ddas)
 
+    HADOOP-3391. Fix a findbugs warning introduced by HADOOP-3248 (rangadi)
+
 Release 0.17.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSImage.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSImage.java?rev=656491&r1=656490&r2=656491&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSImage.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSImage.java Wed May 14 19:38:09 2008
@@ -92,7 +92,6 @@
    */
   static private final FsPermission FILE_PERM = new FsPermission((short)0);
   static private final byte[] PATH_SEPARATOR = INode.string2Bytes(Path.SEPARATOR);
-  static private byte[] byteStore = null;
 
   /**
    */
@@ -843,11 +842,10 @@
       out.writeInt(namespaceID);
       out.writeInt(fsDir.rootDir.numItemsInTree() - 1);
       out.writeLong(fsNamesys.getGenerationStamp());
-      byteStore = new byte[4*FSConstants.MAX_PATH_LENGTH];
+      byte[] byteStore = new byte[4*FSConstants.MAX_PATH_LENGTH];
       ByteBuffer strbuf = ByteBuffer.wrap(byteStore);
       saveImage(strbuf, 0, fsDir.rootDir, out);
       fsNamesys.saveFilesUnderConstruction(out);
-      byteStore = null;
       strbuf = null;
     } finally {
       out.close();
@@ -941,7 +939,8 @@
       parentPrefix.put(PATH_SEPARATOR).put(child.getLocalNameBytes());
       newPrefixLength = parentPrefix.position();
       out.writeShort(newPrefixLength);
-      out.write(byteStore, 0, newPrefixLength);
+      out.write(parentPrefix.array(), parentPrefix.arrayOffset(),
+                newPrefixLength);
       if (!child.isDirectory()) {  // write file inode
         INodeFile fileINode = (INodeFile)child;
         out.writeShort(fileINode.getReplication());



Mime
View raw message