@Internal public class ResourceManager extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
protected Map<ResourceUri,URL> |
resourceInfos |
protected MutableURLClassLoader |
userClassLoader |
Constructor and Description |
---|
ResourceManager(ReadableConfig config,
MutableURLClassLoader userClassLoader) |
Modifier and Type | Method and Description |
---|---|
void |
addJarConfiguration(TableConfig tableConfig)
Adds the local jar resources to the given
TableConfig . |
protected void |
checkJarPath(Path path) |
void |
close() |
static ResourceManager |
createResourceManager(URL[] urls,
ClassLoader parent,
ReadableConfig config) |
Set<URL> |
getLocalJarResources()
Get the local jars' URL.
|
Map<ResourceUri,URL> |
getResources() |
protected URL |
getURLFromPath(Path path) |
URLClassLoader |
getUserClassLoader() |
void |
registerJarResources(List<ResourceUri> resourceUris)
Due to anyone of the resource in list maybe fail during register, so we should stage it
before actual register to guarantee transaction process.
|
protected final Map<ResourceUri,URL> resourceInfos
protected final MutableURLClassLoader userClassLoader
public ResourceManager(ReadableConfig config, MutableURLClassLoader userClassLoader)
public static ResourceManager createResourceManager(URL[] urls, ClassLoader parent, ReadableConfig config)
public void registerJarResources(List<ResourceUri> resourceUris) throws IOException
ResourceManager
.IOException
public URLClassLoader getUserClassLoader()
public Map<ResourceUri,URL> getResources()
public Set<URL> getLocalJarResources()
public void addJarConfiguration(TableConfig tableConfig)
TableConfig
. It implicitly considers the
TableConfig.getRootConfiguration()
and stores the merged result into TableConfig.getConfiguration()
.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
protected void checkJarPath(Path path) throws IOException
IOException
@VisibleForTesting protected URL getURLFromPath(Path path) throws IOException
IOException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.