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

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

Github user julienledem commented on a diff in the pull request:

    https://github.com/apache/drill/pull/246#discussion_r44204801
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FormatCreator.java 
---
    @@ -92,10 +118,39 @@
               logger.warn("Failure initializing storage config named '{}' of 
type '{}'.", e.getKey(), e.getValue().getClass().getName(), e1);
             }
           }
    -
         }
    +    this.configuredPlugins = Collections.unmodifiableMap(plugins);
    +  }
    +
    +  /**
    +   * @param name the name of the formatplugin instance in the drill config
    +   * @return The configured FormatPlugin for this name
    +   */
    +  FormatPlugin getFormatPluginByName(String name) {
    +    return configuredPlugins.get(name);
    +  }
     
    -    return plugins;
    +  /**
    +   * @return all the format plugins from the Drill config
    +   */
    +  Collection<FormatPlugin> getConfiguredFormatPlugins() {
    +    return configuredPlugins.values();
       }
     
    +  /**
    +   * Instantiate a new format plugin instance from the provided config 
object
    +   * @param fpconfig the conf for the plugin
    +   * @return the newly created instance of a FormatPlugin based on 
provided config
    +   */
    +  FormatPlugin newFormatPlugin(FormatPluginConfig fpconfig) {
    +    Constructor<?> c = configConstructors.get(fpconfig.getClass());
    +    if (c == null) {
    +      throw new RuntimeException("Unable to find constructor for storage 
config of type " + fpconfig.getClass().getName());
    +    }
    +    try {
    +      return (FormatPlugin) c.newInstance(null, context, fsConf, 
storageConfig, fpconfig);
    +    } catch (InstantiationException | IllegalAccessException | 
IllegalArgumentException | InvocationTargetException e1) {
    +      throw new RuntimeException("Failure initializing storage config of 
type " + fpconfig.getClass().getName(), e1);
    --- End diff --
    
    todo: exception


> Select with options
> -------------------
>
>                 Key: DRILL-4047
>                 URL: https://issues.apache.org/jira/browse/DRILL-4047
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Execution - Relational Operators
>            Reporter: Julien Le Dem
>            Assignee: Julien Le Dem
>
> Add a mechanism to pass parameters down to the StoragePlugin when writing a 
> Select statement.
> Some discussion here:
> http://mail-archives.apache.org/mod_mbox/drill-dev/201510.mbox/%3CCAO%2Bvc4AcGK3%2B3QYvQV1-xPPdpG3Tc%2BfG%3D0xDGEUPrhd6ktHv5Q%40mail.gmail.com%3E
> http://mail-archives.apache.org/mod_mbox/drill-dev/201511.mbox/%3ccao+vc4clzylvjevisfjqtcyxb-zsmfy4bqrm-jhbidwzgqf...@mail.gmail.com%3E



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to