arina-ielchiieva commented on a change in pull request #1988: DRILL-7590:
Refactor plugin registry
URL: https://github.com/apache/drill/pull/1988#discussion_r383965816
##########
File path:
exec/java-exec/src/test/java/org/apache/drill/test/ClusterFixture.java
##########
@@ -472,11 +460,14 @@ private Exception safeClose(AutoCloseable item,
Exception ex) {
return ex;
}
- public void defineStoragePlugin(Function<DrillbitContext, StoragePlugin>
pluginFactory) {
- for (Drillbit drillbit : drillbits()) {
- StoragePluginRegistryImpl registry = (StoragePluginRegistryImpl)
drillbit.getContext().getStorage();
- StoragePlugin plugin = pluginFactory.apply(drillbit.getContext());
- registry.addPluginToPersistentStoreIfAbsent(plugin.getName(),
plugin.getConfig(), plugin);
+ public void defineStoragePlugin(String name, StoragePluginConfig config) {
+ try {
+ for (Drillbit drillbit : drillbits()) {
+ StoragePluginRegistryImpl registry = (StoragePluginRegistryImpl)
drillbit.getContext().getStorage();
+ registry.put(name, config);
+ }
+ } catch (ExecutionSetupException e) {
+ throw new IllegalStateException("Plugin definition failed", e);
Review comment:
Please include plugin name into error message.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services