public class SystemPluginLocator extends Object implements ConnectorLocator
System plugins are defined in the Drill core, reside on the default class
path, and are annotated with @SystemPlugin.
| Constructor and Description |
|---|
SystemPluginLocator(PluginRegistryContext context) |
| Modifier and Type | Method and Description |
|---|---|
StoragePlugins |
bootstrapPlugins()
When starting a new installation, called to load bootstrap
plugins (configurations) that come "out-of-the-box."
|
void |
close() |
Set<Class<? extends StoragePluginConfig>> |
configClasses()
Return the set of known storage plugin configuration classes for which
the user can create configs.
|
Class<? extends StoragePlugin> |
connectorClassFor(Class<? extends StoragePluginConfig> configClass)
Given a configuration class, return the corresponding connector
(plugin) class.
|
StoragePlugin |
create(String name,
StoragePluginConfig pluginConfig)
Create a connector instance given a named configuration.
|
StoragePlugin |
get(String name)
Retrieve an instance of the named connector with default configuration.
|
void |
init()
Dynamically loads system plugins annotated with
SystemPlugin. |
Collection<StoragePlugin> |
intrinsicPlugins()
Enumerate the intrinsic plugins.
|
void |
onUpgrade()
If
updatedPlugins() returned non-null, then the
registry will call this method after successful update of
the persistent store. |
boolean |
storable() |
StoragePlugins |
updatedPlugins()
Identify plugins to be added to an existing system, typically
on the first run after an upgrade.
|
public SystemPluginLocator(PluginRegistryContext context)
public void init()
SystemPlugin.
Will skip plugin initialization if no matching constructor, incorrect
class implementation, name absence are detected.init in interface ConnectorLocatorclasspathScan - classpath scan resultcontext - drillbit contextpublic StoragePlugins bootstrapPlugins() throws IOException
ConnectorLocatorbootstrapPlugins in interface ConnectorLocatornull if this locator
does not provide bootstrap pluginsIOExceptionpublic StoragePlugins updatedPlugins()
ConnectorLocatorTODO: The current mechanism depends on deleting a file after the first run, which is unreliable. It won't, for example, correctly handle a restored ZK. A better mechanism would store a version number in the persistent store, and pass that version number into this method.
updatedPlugins in interface ConnectorLocatorpublic void onUpgrade()
ConnectorLocatorupdatedPlugins() returned non-null, then the
registry will call this method after successful update of
the persistent store. This method can do any post-update
cleanup, such as deleting the file mentioned above.onUpgrade in interface ConnectorLocatorpublic StoragePlugin get(String name)
ConnectorLocatorget in interface ConnectorLocatorname - the name of a connector class (not the name of
a plugin (configuration)public Collection<StoragePlugin> intrinsicPlugins()
ConnectorLocatorintrinsicPlugins in interface ConnectorLocatorpublic StoragePlugin create(String name, StoragePluginConfig pluginConfig)
ConnectorLocatorcreate in interface ConnectorLocatorname - name of the storage plugin (configuration).pluginConfig - the deserialized Java configuration object.public Set<Class<? extends StoragePluginConfig>> configClasses()
ConnectorLocatorconfigClasses in interface ConnectorLocatorpublic boolean storable()
storable in interface ConnectorLocatorpublic Class<? extends StoragePlugin> connectorClassFor(Class<? extends StoragePluginConfig> configClass)
ConnectorLocatorconnectorClassFor in interface ConnectorLocatorpublic void close()
close in interface ConnectorLocatorCopyright © 2021 The Apache Software Foundation. All rights reserved.