public class Initialization extends Object
Constructor and Description |
---|
Initialization() |
Modifier and Type | Method and Description |
---|---|
static URLClassLoader |
getClassLoaderForExtension(File extension) |
static File[] |
getExtensionFilesToLoad(ExtensionsConfig config)
Find all the extension files that should be loaded by druid.
|
static <T> Collection<T> |
getFromExtensions(ExtensionsConfig config,
Class<T> serviceClass)
Look for implementations for the given class from both classpath and extensions directory, using
ServiceLoader . |
static File[] |
getHadoopDependencyFilesToLoad(List<String> hadoopDependencyCoordinates,
ExtensionsConfig extensionsConfig)
Find all the hadoop dependencies that should be loaded by druid
|
static <T> Collection<T> |
getLoadedImplementations(Class<T> clazz) |
static List<URL> |
getURLsForClasspath(String cp) |
static com.google.inject.Injector |
makeInjectorWithModules(com.google.inject.Injector baseInjector,
Iterable<? extends com.google.inject.Module> modules) |
public static <T> Collection<T> getLoadedImplementations(Class<T> clazz)
T
- the service typeclazz
- service classpublic static <T> Collection<T> getFromExtensions(ExtensionsConfig config, Class<T> serviceClass)
ServiceLoader
. A user should never put the same two extensions in classpath and extensions directory, if he/she
does that, the one that is in the classpath will be loaded, the other will be ignored.config
- Extensions configurationserviceClass
- The class to look the implementations of (e.g., DruidModule)public static File[] getExtensionFilesToLoad(ExtensionsConfig config)
config
- ExtensionsConfig configured by druid.extensions.xxxpublic static File[] getHadoopDependencyFilesToLoad(List<String> hadoopDependencyCoordinates, ExtensionsConfig extensionsConfig)
hadoopDependencyCoordinates
- e.g.["org.apache.hadoop:hadoop-client:2.3.0"]extensionsConfig
- ExtensionsConfig configured by druid.extensions.xxxpublic static URLClassLoader getClassLoaderForExtension(File extension) throws MalformedURLException
extension
- The File instance of the extension we want to loadMalformedURLException
public static com.google.inject.Injector makeInjectorWithModules(com.google.inject.Injector baseInjector, Iterable<? extends com.google.inject.Module> modules)
Copyright © 2011–2018. All rights reserved.