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 he...@apache.org on 2021/02/02 05:52:32 UTC

[hadoop] branch branch-3.3 updated: HDFS-15792. Addendum: ClasscastException while loading FSImage. Contributed by Renukaprasad C.

This is an automated email from the ASF dual-hosted git repository.

hexiaoqiao pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new f97709b  HDFS-15792. Addendum: ClasscastException while loading FSImage. Contributed by Renukaprasad C.
f97709b is described below

commit f97709beaaadee45c8b5b4a5188e54f2ab562f81
Author: He Xiaoqiao <he...@apache.org>
AuthorDate: Tue Feb 2 13:50:48 2021 +0800

    HDFS-15792. Addendum: ClasscastException while loading FSImage. Contributed by Renukaprasad C.
---
 .../hadoop/hdfs/util/TestReferenceCountMap.java    | 29 +++++++++++-----------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/util/TestReferenceCountMap.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/util/TestReferenceCountMap.java
index a0019de..6444778 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/util/TestReferenceCountMap.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/util/TestReferenceCountMap.java
@@ -23,18 +23,17 @@ import org.junit.Assert;
 import org.junit.Test;
 
 /**
- * Verify ReferenceCount map in concurrent scenarios
- *
+ * Verify ReferenceCount map in concurrent scenarios.
  */
 public class TestReferenceCountMap {
   //Add these number of references in loop
   public static final int LOOP_COUNTER = 10000;
   //Use 2 global features
-  AclFeature aclFeature1 = new AclFeature(new int[]{1});
-  AclFeature aclFeature2 = new AclFeature(new int[]{2});
+  private AclFeature aclFeature1 = new AclFeature(new int[]{1});
+  private AclFeature aclFeature2 = new AclFeature(new int[]{2});
 
   @Test
-  public void testReferenceCountMap() throws Exception{
+  public void testReferenceCountMap() throws Exception {
     ReferenceCountMap<AclFeature> countMap = new ReferenceCountMap<>();
     countMap.put(aclFeature1);
     countMap.put(aclFeature2);
@@ -63,7 +62,7 @@ public class TestReferenceCountMap {
   }
 
   @Test
-  public void testRefCountMapConcurrently() throws Exception{
+  public void testRefCountMapConcurrently() throws Exception {
     ReferenceCountMap<AclFeature> countMap = new ReferenceCountMap<>();
 
     PutThread putThread1 = new PutThread(countMap);
@@ -74,8 +73,10 @@ public class TestReferenceCountMap {
 
     putThread1.join();
     putThread2.join();
-    Assert.assertEquals(2 * LOOP_COUNTER, countMap.getReferenceCount(aclFeature1));
-    Assert.assertEquals(2 * LOOP_COUNTER, countMap.getReferenceCount(aclFeature2));
+    Assert.assertEquals(2 * LOOP_COUNTER,
+        countMap.getReferenceCount(aclFeature1));
+    Assert.assertEquals(2 * LOOP_COUNTER,
+        countMap.getReferenceCount(aclFeature2));
 
     removeThread1.start();
     removeThread1.join();
@@ -83,9 +84,9 @@ public class TestReferenceCountMap {
     Assert.assertEquals(LOOP_COUNTER, countMap.getReferenceCount(aclFeature2));
   }
 
-  class PutThread extends Thread{
-    ReferenceCountMap<AclFeature> referenceCountMap;
-    public PutThread(ReferenceCountMap<AclFeature> referenceCountMap){
+  class PutThread extends Thread {
+    private ReferenceCountMap<AclFeature> referenceCountMap;
+    PutThread(ReferenceCountMap<AclFeature> referenceCountMap) {
       this.referenceCountMap = referenceCountMap;
     }
     @Override
@@ -97,9 +98,9 @@ public class TestReferenceCountMap {
     }
   };
 
-  class RemoveThread extends Thread{
-    ReferenceCountMap<AclFeature> referenceCountMap;
-    public RemoveThread(ReferenceCountMap<AclFeature> referenceCountMap){
+  class RemoveThread extends Thread {
+    private ReferenceCountMap<AclFeature> referenceCountMap;
+    RemoveThread(ReferenceCountMap<AclFeature> referenceCountMap) {
       this.referenceCountMap = referenceCountMap;
     }
     @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org