You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2023/05/23 21:28:25 UTC
[accumulo] branch main updated (b90d479044 -> ecea31428c)
This is an automated email from the ASF dual-hosted git repository.
ctubbsii pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
from b90d479044 Merge branch '2.1'
add 969fc52f1c Pass config to ContextClassLoaderFactory (#3400)
new ecea31428c Merge branch '2.1'
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../accumulo/core/classloader/ClassLoaderUtil.java | 4 +++-
...ation.java => ContextClassLoaderEnvironment.java} | 20 +++++++++-----------
.../core/spi/common/ContextClassLoaderFactory.java | 11 ++++++++++-
.../apache/accumulo/core/util/ConfigurationImpl.java | 3 +++
4 files changed, 25 insertions(+), 13 deletions(-)
copy core/src/main/java/org/apache/accumulo/core/spi/common/{IteratorConfiguration.java => ContextClassLoaderEnvironment.java} (74%)
[accumulo] 01/01: Merge branch '2.1'
Posted by ct...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit ecea31428c7b941db61f5cffcff146e395eed32a
Merge: b90d479044 969fc52f1c
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Tue May 23 17:28:11 2023 -0400
Merge branch '2.1'
.../accumulo/core/classloader/ClassLoaderUtil.java | 4 ++-
.../spi/common/ContextClassLoaderEnvironment.java | 34 ++++++++++++++++++++++
.../core/spi/common/ContextClassLoaderFactory.java | 11 ++++++-
.../accumulo/core/util/ConfigurationImpl.java | 3 ++
4 files changed, 50 insertions(+), 2 deletions(-)
diff --cc core/src/main/java/org/apache/accumulo/core/classloader/ClassLoaderUtil.java
index 9a775faae0,3a5d0ebda3..61e9afd75b
--- a/core/src/main/java/org/apache/accumulo/core/classloader/ClassLoaderUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/classloader/ClassLoaderUtil.java
@@@ -44,9 -45,9 +45,9 @@@ public class ClassLoaderUtil
// load the default implementation
LOG.info("Using default {}, which is subject to change in a future release",
ContextClassLoaderFactory.class.getName());
- FACTORY = new DefaultContextClassLoaderFactory(conf);
+ FACTORY = new URLContextClassLoaderFactory();
} else {
- // load user's selected implementation
+ // load user's selected implementation and provide it with the service environment
try {
var factoryClass = Class.forName(factoryName).asSubclass(ContextClassLoaderFactory.class);
LOG.info("Creating {}: {}", ContextClassLoaderFactory.class.getName(), factoryName);
diff --cc core/src/main/java/org/apache/accumulo/core/spi/common/ContextClassLoaderFactory.java
index f890bb08ce,7f423f3ead..a742ad0a33
--- a/core/src/main/java/org/apache/accumulo/core/spi/common/ContextClassLoaderFactory.java
+++ b/core/src/main/java/org/apache/accumulo/core/spi/common/ContextClassLoaderFactory.java
@@@ -45,16 -47,22 +47,23 @@@ package org.apache.accumulo.core.spi.co
*/
public interface ContextClassLoaderFactory {
+ /**
+ * Pass the service environment to allow for additional class loader configuration
+ *
+ * @param env the class loader environment
+ */
+ default void init(ContextClassLoaderEnvironment env) {}
+
/**
- * Get the class loader for the given contextName. Callers should not cache the ClassLoader result
- * as it may change if/when the ClassLoader reloads. Implementations should throw a
- * RuntimeException of some type (such as IllegalArgumentException) if the provided contextName is
- * not supported or fails to be constructed.
+ * Get the class loader for the given context. Callers should not cache the ClassLoader result as
+ * it may change if/when the ClassLoader reloads. Implementations should throw a RuntimeException
+ * of some type (such as IllegalArgumentException) if the provided context is not supported or
+ * fails to be constructed.
*
- * @param contextName the name of the context that represents a class loader that is managed by
- * this factory (can be null)
- * @return the class loader for the given contextName
+ * @param context the name of the context that represents a class loader that is managed by this
+ * factory (can be null)
+ * @return the class loader for the given context
*/
- ClassLoader getClassLoader(String contextName);
+ ClassLoader getClassLoader(String context);
+
}