Explorar el Código

HDFS-554. Use System.arraycopy in BlockInfo.ensureCapacity. (harsh)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1226239 13f79535-47bb-0310-9956-ffa450edef68
Harsh J hace 13 años
padre
commit
8e8203f3c5

+ 2 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -131,6 +131,8 @@ Trunk (unreleased changes)
     HDFS-2476. More CPU efficient data structure for under-replicated,
     over-replicated, and invalidated blocks. (Tomasz Nykiel via todd)
 
+    HDFS-554. Use System.arraycopy in BlockInfo.ensureCapacity. (harsh)
+
   BUG FIXES
     HDFS-2299. TestOfflineEditsViewer is failing on trunk. (Uma Maheswara Rao G
                via atm)

+ 1 - 3
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockInfo.java

@@ -173,9 +173,7 @@ public class BlockInfo extends Block implements LightWeightGSet.LinkedElement {
      * happen only when replication is manually increased by the user. */
     Object[] old = triplets;
     triplets = new Object[(last+num)*3];
-    for(int i=0; i < last*3; i++) {
-      triplets[i] = old[i];
-    }
+    System.arraycopy(old, 0, triplets, 0, last*3);
     return last;
   }