[ 
https://issues.apache.org/jira/browse/DRILL-7590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17045435#comment-17045435
 ] 

ASF GitHub Bot commented on DRILL-7590:
---------------------------------------

arina-ielchiieva commented on pull request #1988: DRILL-7590: Refactor plugin 
registry
URL: https://github.com/apache/drill/pull/1988#discussion_r384001819
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/SystemPluginLocator.java
 ##########
 @@ -0,0 +1,173 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.store;
+
+import static 
org.apache.drill.shaded.guava.com.google.common.base.Preconditions.checkNotNull;
+
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.drill.common.logical.StoragePluginConfig;
+import org.apache.drill.common.map.CaseInsensitiveMap;
+import org.apache.drill.common.scanner.persistence.AnnotatedClassDescriptor;
+import org.apache.drill.exec.planner.logical.StoragePlugins;
+import org.apache.drill.exec.server.DrillbitContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Locates system storage plugins. These are special in that they take
+ * no configuration: the configuration and connector names are the same so
+ * that the configuration name can be resolved directly to the connector.
+ * <p>
+ * System plugins are defined in the Drill core, reside on the default class
+ * path, and are annotated with {@code @SystemPlugin}.
+ */
+public class SystemPluginLocator implements ConnectorLocator {
+  private static final Logger logger = 
LoggerFactory.getLogger(SystemPluginLocator.class);
+
+  private final PluginRegistryContext context;
+  private final Map<String, StoragePlugin> plugins = 
CaseInsensitiveMap.newHashMap();
+
+  public SystemPluginLocator(PluginRegistryContext context) {
+    this.context = checkNotNull(context);
 
 Review comment:
   I think we can skip not null check, let's assume caller knows what he is 
doing and not going to pass null context.
 
----------------------------------------------------------------
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]


> Refactor plugin registry
> ------------------------
>
>                 Key: DRILL-7590
>                 URL: https://issues.apache.org/jira/browse/DRILL-7590
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.17.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Major
>             Fix For: 1.18.0
>
>
> The plugin registry connects configurations, stored in ZK, with 
> implementations, which are Java classes. The registry handles a large number 
> of tasks including:
> * Populating "bootstrap" plugin configurations and handling upgrades.
> * Reading from, and writing to, the persistent store in ZK.
> * Handling "normal" (configured) plugins and special system plugins (which 
> have no configuration.)
> * Handle format plugins which are always associated with the DFS storage 
> plugin.
> * And so on.
> The code has grown overly complex. As we look to add a new, cleaner plugin 
> mechanism, we will start by cleaning up what we have to allow the new 
> mechanism to be one of many.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to