浏览代码

HDFS-5276. Remove volatile from LightWeightHashSet. (Junping Du via llu)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1531224 13f79535-47bb-0310-9956-ffa450edef68
Luke Lu 11 年之前
父节点
当前提交
7d83886767

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

@@ -14,6 +14,8 @@ Release 2.3.0 - UNRELEASED
 
   IMPROVEMENTS
 
+    HDFS-5276. Remove volatile from LightWeightHashSet. (Junping Du via llu)
+
     HDFS-4657.  Limit the number of blocks logged by the NN after a block
     report to a configurable value.  (Aaron T. Myers via Colin Patrick
     McCabe)

+ 2 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/util/LightWeightHashSet.java

@@ -88,7 +88,7 @@ public class LightWeightHashSet<T> implements Collection<T> {
    *
    * @see ConcurrentModificationException
    */
-  protected volatile int modification = 0;
+  protected int modification = 0;
 
   private float maxLoadFactor;
   private float minLoadFactor;
@@ -634,4 +634,4 @@ public class LightWeightHashSet<T> implements Collection<T> {
   public boolean retainAll(Collection<?> c) {
     throw new UnsupportedOperationException("retainAll is not supported.");
   }
-}
+}