hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject [29/50] [abbrv] hbase git commit: HBASE-13713: See about dropping ClassLoaderBase#getClassLoadingLock
Date Thu, 21 May 2015 16:43:12 GMT
HBASE-13713: See about dropping ClassLoaderBase#getClassLoadingLock

Signed-off-by: stack <stack@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/ed5ac65f
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ed5ac65f
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ed5ac65f

Branch: refs/heads/hbase-12439
Commit: ed5ac65f22c06947dfda56ac163502ca2af45998
Parents: 74e5b26
Author: Lars Francke <lars.francke@gmail.com>
Authored: Tue May 19 21:58:09 2015 +0200
Committer: stack <stack@apache.org>
Committed: Tue May 19 15:52:27 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/util/ClassLoaderBase.java      | 30 ++------------------
 1 file changed, 2 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ed5ac65f/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassLoaderBase.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassLoaderBase.java
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassLoaderBase.java
index 262864a..6e5aaa6 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassLoaderBase.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassLoaderBase.java
@@ -19,26 +19,16 @@ package org.apache.hadoop.hbase.util;
 
 import java.net.URL;
 import java.net.URLClassLoader;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
 
 import com.google.common.base.Preconditions;
+import org.apache.hadoop.hbase.classification.InterfaceAudience;
 
 /**
- * Base class loader that defines couple shared constants used
- * by sub-classes. It also defined method getClassLoadingLock for parallel
- * class loading and JDK 1.6 support. This method (getClassLoadingLock)
- * is similar to the same method in the base class Java ClassLoader
- * introduced in JDK 1.7, but not in JDK 1.6.
+ * Base class loader that defines couple shared constants used by sub-classes.
  */
 @InterfaceAudience.Private
 public class ClassLoaderBase extends URLClassLoader {
 
-  // Maps class name to the corresponding lock object
-  private final ConcurrentHashMap<String, Object> parallelLockMap
-    = new ConcurrentHashMap<String, Object>();
-
   protected static final String DEFAULT_LOCAL_DIR = "/tmp/hbase-local-dir";
   protected static final String LOCAL_DIR_KEY = "hbase.local.dir";
 
@@ -59,20 +49,4 @@ public class ClassLoaderBase extends URLClassLoader {
     this.parent = parent;
   }
 
-  /**
-   * Returns the lock object for class loading operations.
-   */
-  protected Object getClassLoadingLock(String className) {
-    Object lock = parallelLockMap.get(className);
-    if (lock != null) {
-      return lock;
-    }
-
-    Object newLock = new Object();
-    lock = parallelLockMap.putIfAbsent(className, newLock);
-    if (lock == null) {
-      lock = newLock;
-    }
-    return lock;
-  }
 }


Mime
View raw message