public class PluginBootstrapLoaderImpl extends Object implements PluginBootstrapLoader
The files are given via indirections in the config system to allow easier testing when "non-stock" configurations.
bootstrap-storage-plugins.json
).
The core plugins share a single file in the exec module which has a list of storage plugins used as default on fresh start up. Then we have contrib module where some plugins and formats reside. We want them to be included in default plugins as well during fresh start up which is done by reading each bootstrap file in the classpath.
bootstrap-storage-plugins.json
loaded via this process. However, format
plugins are defined inside storage plugins. This presents a problem when
the format is defined outside of the core (such as in the contrib module). In
this case, when new format was added, the developer had to modify the
bootstrap-storage-plugins.json
in exec module to ensure that the new format
was included.
The bootstrap-format-plugins.json
solves this problem: it allows non-core
modules to include formats during bootstrap. The file must still indicate which
plugin (config) to modify, and must list the same format for each supported file
system plugin such as dfs
and . Despite this limitation, the additional
file makes the non-core format plugins independent of the core files.
The resulting bootstrap process is to 1) gather the storage plugins, and 2) merge any format bootstrap into these plugins.
If the system is new, configurations from the upgrade file replace (override) values from the bootstrap file. The net effect, bootstrap plus upgrades, are written into the persistent store.
If the system is upgraded, then the current technique uses a highly unreliable system: an upgrade file exists. Any upgrades are applied on top of the user's stored values. The upgrade file is then deleted to avoid applying the same upgrades multiple times. Not idea, but it is what it is for now.
ExecConstants.BOOTSTRAP_STORAGE_PLUGINS_FILE
(drill.exec.storage.bootstrap.storage
)bootstrap-storage-plugins.json
.ExecConstants.UPGRADE_STORAGE_PLUGINS_FILE
(drill.exec.storage.upgrade.storage
)storage-plugins-override.conf
. Unlike th bootstrap
file, only one upgrade file can appear in the class path.
The upgrade file is optional.Constructor and Description |
---|
PluginBootstrapLoaderImpl(PluginRegistryContext context) |
Modifier and Type | Method and Description |
---|---|
StoragePlugins |
bootstrapPlugins()
Drill has detected that this is a new installation.
|
protected StoragePlugins |
loadBootstrapPlugins(Map<String,URL> pluginURLMap) |
void |
onUpgrade()
Drill successfully applied the plugin upgrades from
PluginBootstrapLoader.updatedPlugins() . |
StoragePlugins |
updatedPlugins()
Get the new storage plugins from the
ConfigConstants#STORAGE_PLUGINS_OVERRIDE_CONF file if it exists,
null otherwise |
public PluginBootstrapLoaderImpl(PluginRegistryContext context)
public StoragePlugins bootstrapPlugins() throws IOException
PluginBootstrapLoader
bootstrapPlugins
in interface PluginBootstrapLoader
IOException
protected StoragePlugins loadBootstrapPlugins(Map<String,URL> pluginURLMap) throws IOException
IOException
public StoragePlugins updatedPlugins()
ConfigConstants#STORAGE_PLUGINS_OVERRIDE_CONF
file if it exists,
null otherwiseupdatedPlugins
in interface PluginBootstrapLoader
public void onUpgrade()
PluginBootstrapLoader
PluginBootstrapLoader.updatedPlugins()
. Use this event to mark this
version as having been upgraded. (Again, this is crude and
may not actually work. See DRILL-7613.)onUpgrade
in interface PluginBootstrapLoader
Copyright © 1970 The Apache Software Foundation. All rights reserved.