Interface StoragePlugin

All Superinterfaces:
AutoCloseable, SchemaFactory
All Known Implementing Classes:
AbstractStoragePlugin, CassandraStoragePlugin, DrillStoragePlugin, DruidStoragePlugin, ElasticsearchStoragePlugin, FileSystemPlugin, GoogleSheetsStoragePlugin, HBaseStoragePlugin, HiveStoragePlugin, HttpStoragePlugin, InfoSchemaStoragePlugin, JdbcStoragePlugin, KafkaStoragePlugin, KuduStoragePlugin, MockBreakageStorage, MockStorageEngine, MongoStoragePlugin, OpenTSDBStoragePlugin, PhoenixStoragePlugin, SplunkStoragePlugin, SystemTablePlugin

public interface StoragePlugin extends SchemaFactory, AutoCloseable
Interface for all implementations of the storage plugins. Different implementations of the storage formats will implement methods that indicate if Drill can write or read its tables from that format, if there are optimizer rules specific for the format, getting a storage config. etc.
  • Method Details

    • getName

      String getName()
    • start

      void start() throws IOException
      Initialize the storage plugin. The storage plugin will not be used until this method is called.
      Throws:
      IOException
    • onEnabled

      void onEnabled() throws Exception
      Lifecycle method allowing the plugin to perform operations when it has been enabled.
      Throws:
      Exception - in the event of an error. The exception will be propagated but the enabling of the plugin will _not_ be rolled back.
    • onDisabled

      void onDisabled() throws Exception
      Lifecycle method allowing the plugin to perform operations when it has been disabled.
      Throws:
      Exception - in the event of an error. The exception will be propagated but the disabling of the plugin will _not_ be rolled back.
    • supportsRead

      boolean supportsRead()
      Indicates if Drill can read the table from this format.
    • supportsWrite

      boolean supportsWrite()
      Indicates if Drill can write a table to this format (e.g. as JSON, csv, etc.).
    • supportsInsert

      boolean supportsInsert()
      Indicates if Drill can insert to a table to this plugin.
    • getConfig

      StoragePluginConfig getConfig()
      Method returns a Jackson serializable object that extends a StoragePluginConfig.
      Returns:
      an extension of StoragePluginConfig
    • getOptimizerRules

      default Set<? extends org.apache.calcite.plan.RelOptRule> getOptimizerRules(OptimizerRulesContext optimizerContext, PlannerPhase phase)
      An implementation of this method will return one or more specialized rules that Drill query optimizer can leverage in physical space. Otherwise, it should return an empty set.
      Returns:
      an empty set or a set of plugin specific physical optimizer rules.
    • getPhysicalScan

      AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection) throws IOException
      Get the physical scan operator for the particular GroupScan (read) node.
      Parameters:
      userName - User whom to impersonate when when reading the contents as part of Scan.
      selection - The configured storage engine specific selection.
      Returns:
      The physical scan operator for the particular GroupScan (read) node.
      Throws:
      IOException
    • getPhysicalScan

      AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection, SessionOptionManager options) throws IOException
      Get the physical scan operator for the particular GroupScan (read) node.
      Parameters:
      userName - User whom to impersonate when reading the contents as part of Scan.
      selection - The configured storage engine specific selection.
      options - (optional) session options
      Returns:
      The physical scan operator for the particular GroupScan (read) node.
      Throws:
      IOException
    • getPhysicalScan

      AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection, SessionOptionManager options, MetadataProviderManager providerManager) throws IOException
      Get the physical scan operator for the particular GroupScan (read) node.
      Parameters:
      userName - User whom to impersonate when reading the contents as part of Scan.
      selection - The configured storage engine specific selection.
      options - (optional) session options
      providerManager - manager for handling metadata providers
      Returns:
      The physical scan operator for the particular GroupScan (read) node.
      Throws:
      IOException
    • getPhysicalScan

      AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection, List<SchemaPath> columns) throws IOException
      Get the physical scan operator for the particular GroupScan (read) node.
      Parameters:
      userName - User whom to impersonate when reading the contents as part of Scan.
      selection - The configured storage engine specific selection.
      columns - (optional) The list of column names to scan from the data source.
      Returns:
      The physical scan operator for the particular GroupScan (read) node.
      Throws:
      IOException
    • getPhysicalScan

      AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection, List<SchemaPath> columns, SessionOptionManager options) throws IOException
      Get the physical scan operator for the particular GroupScan (read) node.
      Parameters:
      userName - User whom to impersonate when reading the contents as part of Scan.
      selection - The configured storage engine specific selection.
      columns - (optional) The list of column names to scan from the data source.
      options - (optional) session options
      Returns:
      The physical scan operator for the particular GroupScan (read) node.
      Throws:
      IOException
    • getPhysicalScan

      AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection, List<SchemaPath> columns, SessionOptionManager options, MetadataProviderManager providerManager) throws IOException
      Get the physical scan operator for the particular GroupScan (read) node.
      Parameters:
      userName - User whom to impersonate when reading the contents as part of Scan.
      selection - The configured storage engine specific selection.
      columns - (optional) The list of column names to scan from the data source.
      options - (optional) session options
      providerManager - manager for handling metadata providers
      Returns:
      The physical scan operator for the particular GroupScan (read) node.
      Throws:
      IOException
    • getFormatPlugin

      FormatPlugin getFormatPlugin(FormatPluginConfig config)
      Allows to get the format plugin for current storage plugin based on appropriate format plugin config usage.
      Parameters:
      config - format plugin config
      Returns:
      format plugin instance