public class StoragePluginRegistryImpl extends Object implements StoragePluginRegistry
| Modifier and Type | Class and Description |
|---|---|
class |
StoragePluginRegistryImpl.DrillSchemaFactory |
INFORMATION_SCHEMA_PLUGIN, PSTORE_NAME, STORAGE_PLUGIN_REGISTRY_IMPL, SYS_PLUGIN| Constructor and Description |
|---|
StoragePluginRegistryImpl(DrillbitContext context) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPlugin(String name,
StoragePlugin plugin)
Add a plugin to the registry using the provided name.
|
void |
close() |
StoragePlugin |
createOrUpdate(String name,
StoragePluginConfig config,
boolean persist)
Create a plugin by name and configuration.
|
void |
definePlugin(String name,
StoragePluginConfig config,
StoragePlugin plugin)
Add a plugin and configuration.
|
void |
deletePlugin(String name)
Delete a plugin by name
|
static Map<Object,Constructor<? extends StoragePlugin>> |
findAvailablePlugins(ScanResult classpathScan)
Get a list of all available storage plugin class constructors.
|
FormatPlugin |
getFormatPlugin(StoragePluginConfig storageConfig,
FormatPluginConfig formatConfig)
Get the Format plugin for the FileSystemPlugin associated with the provided storage config and format config.
|
StoragePlugin |
getPlugin(StoragePluginConfig config)
Get a plugin by configuration.
|
StoragePlugin |
getPlugin(String name)
Get a plugin by name.
|
SchemaFactory |
getSchemaFactory()
Get the Schema factory associated with this storage plugin registry.
|
PersistentStore<StoragePluginConfig> |
getStore()
Get the PStore for this StoragePluginRegistry.
|
void |
init()
Initialize the storage plugin registry.
|
Iterator<Map.Entry<String,StoragePlugin>> |
iterator() |
public StoragePluginRegistryImpl(DrillbitContext context)
public PersistentStore<StoragePluginConfig> getStore()
StoragePluginRegistrygetStore in interface StoragePluginRegistrypublic void init()
throws DrillbitStartupException
StoragePluginRegistryinit in interface StoragePluginRegistryDrillbitStartupExceptionpublic void definePlugin(String name, StoragePluginConfig config, StoragePlugin plugin)
name - plugin nameconfig - plugin configplugin - plugin implementationpublic void addPlugin(String name, StoragePlugin plugin)
StoragePluginRegistryaddPlugin in interface StoragePluginRegistrypublic void deletePlugin(String name)
StoragePluginRegistrydeletePlugin in interface StoragePluginRegistryname - The name of the storage plugin to delete.public StoragePlugin createOrUpdate(String name, StoragePluginConfig config, boolean persist) throws ExecutionSetupException
StoragePluginRegistrycreateOrUpdate in interface StoragePluginRegistryname - The name of the pluginconfig - The plugin configurationpersist - Whether to persist the plugin for later use or treat it as ephemeral.ExecutionSetupExceptionpublic StoragePlugin getPlugin(String name) throws ExecutionSetupException
StoragePluginRegistrygetPlugin in interface StoragePluginRegistryname - The name of the pluginExecutionSetupExceptionpublic StoragePlugin getPlugin(StoragePluginConfig config) throws ExecutionSetupException
StoragePluginRegistrygetPlugin in interface StoragePluginRegistryconfig - The configuration for the plugin.ExecutionSetupExceptionpublic FormatPlugin getFormatPlugin(StoragePluginConfig storageConfig, FormatPluginConfig formatConfig) throws ExecutionSetupException
StoragePluginRegistrygetFormatPlugin in interface StoragePluginRegistrystorageConfig - The storage config for the associated FileSystemPluginformatConfig - The format config for the associated FormatPluginExecutionSetupExceptionpublic Iterator<Map.Entry<String,StoragePlugin>> iterator()
iterator in interface Iterable<Map.Entry<String,StoragePlugin>>public SchemaFactory getSchemaFactory()
StoragePluginRegistrygetSchemaFactory in interface StoragePluginRegistrypublic void close()
throws Exception
close in interface AutoCloseableExceptionpublic static Map<Object,Constructor<? extends StoragePlugin>> findAvailablePlugins(ScanResult classpathScan)
classpathScan - A classpath scan to use.Copyright © 2017 The Apache Software Foundation. All rights reserved.