Class AbstractStoragePlugin

java.lang.Object
org.apache.drill.exec.store.AbstractStoragePlugin
All Implemented Interfaces:
AutoCloseable, SchemaFactory, StoragePlugin
Direct Known Subclasses:
CassandraStoragePlugin, DrillStoragePlugin, DruidStoragePlugin, ElasticsearchStoragePlugin, FileSystemPlugin, GoogleSheetsStoragePlugin, HBaseStoragePlugin, HiveStoragePlugin, HttpStoragePlugin, InfoSchemaStoragePlugin, JdbcStoragePlugin, KafkaStoragePlugin, KuduStoragePlugin, MockStorageEngine, MongoStoragePlugin, OpenTSDBStoragePlugin, PhoenixStoragePlugin, SplunkStoragePlugin, SystemTablePlugin

public abstract class AbstractStoragePlugin extends Object implements StoragePlugin
Abstract class for StorePlugin implementations. See StoragePlugin for description of the interface intent and its methods.
  • Field Details

  • Constructor Details

  • Method Details

    • supportsRead

      public boolean supportsRead()
      Description copied from interface: StoragePlugin
      Indicates if Drill can read the table from this format.
      Specified by:
      supportsRead in interface StoragePlugin
    • supportsWrite

      public boolean supportsWrite()
      Description copied from interface: StoragePlugin
      Indicates if Drill can write a table to this format (e.g. as JSON, csv, etc.).
      Specified by:
      supportsWrite in interface StoragePlugin
    • supportsInsert

      public boolean supportsInsert()
      Description copied from interface: StoragePlugin
      Indicates if Drill can insert to a table to this plugin.
      Specified by:
      supportsInsert in interface StoragePlugin
    • getPhysicalScan

      public AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection, SessionOptionManager options) throws IOException
      Description copied from interface: StoragePlugin
      Get the physical scan operator for the particular GroupScan (read) node.
      Specified by:
      getPhysicalScan in interface StoragePlugin
      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

      public AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection, SessionOptionManager options, MetadataProviderManager metadataProviderManager) throws IOException
      Description copied from interface: StoragePlugin
      Get the physical scan operator for the particular GroupScan (read) node.
      Specified by:
      getPhysicalScan in interface StoragePlugin
      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
      metadataProviderManager - manager for handling metadata providers
      Returns:
      The physical scan operator for the particular GroupScan (read) node.
      Throws:
      IOException
    • getPhysicalScan

      public AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection) throws IOException
      Description copied from interface: StoragePlugin
      Get the physical scan operator for the particular GroupScan (read) node.
      Specified by:
      getPhysicalScan in interface StoragePlugin
      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

      public AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection, List<SchemaPath> columns, SessionOptionManager options) throws IOException
      Description copied from interface: StoragePlugin
      Get the physical scan operator for the particular GroupScan (read) node.
      Specified by:
      getPhysicalScan in interface StoragePlugin
      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

      public AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection, List<SchemaPath> columns, SessionOptionManager options, MetadataProviderManager metadataProviderManager) throws IOException
      Description copied from interface: StoragePlugin
      Get the physical scan operator for the particular GroupScan (read) node.
      Specified by:
      getPhysicalScan in interface StoragePlugin
      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
      metadataProviderManager - manager for handling metadata providers
      Returns:
      The physical scan operator for the particular GroupScan (read) node.
      Throws:
      IOException
    • getPhysicalScan

      public AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection, List<SchemaPath> columns) throws IOException
      Description copied from interface: StoragePlugin
      Get the physical scan operator for the particular GroupScan (read) node.
      Specified by:
      getPhysicalScan in interface StoragePlugin
      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
    • start

      public void start() throws IOException
      Description copied from interface: StoragePlugin
      Initialize the storage plugin. The storage plugin will not be used until this method is called.
      Specified by:
      start in interface StoragePlugin
      Throws:
      IOException
    • onEnabled

      public void onEnabled() throws Exception
      Description copied from interface: StoragePlugin
      Lifecycle method allowing the plugin to perform operations when it has been enabled.
      Specified by:
      onEnabled in interface StoragePlugin
      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

      public void onDisabled() throws Exception
      Description copied from interface: StoragePlugin
      Lifecycle method allowing the plugin to perform operations when it has been disabled.
      Specified by:
      onDisabled in interface StoragePlugin
      Throws:
      Exception - in the event of an error. The exception will be propagated but the disabling of the plugin will _not_ be rolled back.
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • getFormatPlugin

      public FormatPlugin getFormatPlugin(FormatPluginConfig config)
      Description copied from interface: StoragePlugin
      Allows to get the format plugin for current storage plugin based on appropriate format plugin config usage.
      Specified by:
      getFormatPlugin in interface StoragePlugin
      Parameters:
      config - format plugin config
      Returns:
      format plugin instance
    • getName

      public String getName()
      Specified by:
      getName in interface StoragePlugin
    • getContext

      public DrillbitContext getContext()
    • toString

      public String toString()
      Overrides:
      toString in class Object