Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,13 @@ private static ReloadingClassLoader createDynamicClassloader(final ClassLoader p

ReloadingClassLoader wrapper = () -> parent;

if (dynamicCPath == null || dynamicCPath.equals("")) {
if (dynamicCPath == null || dynamicCPath.isBlank()) {
return wrapper;
}

log.warn("'{}' is deprecated but was set to '{}' ", DYNAMIC_CLASSPATH_PROPERTY_NAME,
dynamicCPath);

// TODO monitor time for lib/ext was 1 sec... should this be configurable? - ACCUMULO-1301
return new AccumuloReloadingVFSClassLoader(dynamicCPath, generateVfs(), wrapper, 1000, true);
}
Expand All @@ -204,15 +207,25 @@ private static ClassLoader getClassLoader_Internal() throws IOException {
synchronized (lock) {
if (loader == null) {

FileSystemManager vfs = generateVfs();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main thing this PR is doing is avoiding always calling this.


// Set up the 2nd tier class loader
if (parent == null) {
parent = AccumuloClassLoader.getClassLoader();
}

FileObject[] vfsCP = resolve(vfs, AccumuloClassLoader
.getAccumuloProperty(VFS_CLASSLOADER_SYSTEM_CLASSPATH_PROPERTY, ""));
var sysClasspath = AccumuloClassLoader
.getAccumuloProperty(VFS_CLASSLOADER_SYSTEM_CLASSPATH_PROPERTY, "");

if (sysClasspath.isBlank()) {
localLoader = createDynamicClassloader(parent);
loader = localLoader;
return localLoader.getClassLoader();
}

log.warn("'{}' is deprecated but was set to '{}' ",
VFS_CLASSLOADER_SYSTEM_CLASSPATH_PROPERTY, sysClasspath);

FileSystemManager vfs = generateVfs();
FileObject[] vfsCP = resolve(vfs, sysClasspath);

if (vfsCP.length == 0) {
localLoader = createDynamicClassloader(parent);
Expand Down