Package org.apache.drill.exec.store
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
Abstract class for StorePlugin implementations.
See StoragePlugin for description of the interface intent and its methods.
-
Field Summary
FieldsFields inherited from interface org.apache.drill.exec.store.SchemaFactory
DEFAULT_WS_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractStoragePlugin(DrillbitContext inContext, String inName) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getFormatPlugin(FormatPluginConfig config) Allows to get the format plugin for current storage plugin based on appropriate format plugin config usage.getName()getPhysicalScan(String userName, JSONOptions selection) Get the physical scan operator for the particular GroupScan (read) node.getPhysicalScan(String userName, JSONOptions selection, List<SchemaPath> columns) Get the physical scan operator for the particular GroupScan (read) node.getPhysicalScan(String userName, JSONOptions selection, List<SchemaPath> columns, SessionOptionManager options) Get the physical scan operator for the particular GroupScan (read) node.getPhysicalScan(String userName, JSONOptions selection, List<SchemaPath> columns, SessionOptionManager options, MetadataProviderManager metadataProviderManager) Get the physical scan operator for the particular GroupScan (read) node.getPhysicalScan(String userName, JSONOptions selection, SessionOptionManager options) Get the physical scan operator for the particular GroupScan (read) node.getPhysicalScan(String userName, JSONOptions selection, SessionOptionManager options, MetadataProviderManager metadataProviderManager) Get the physical scan operator for the particular GroupScan (read) node.voidLifecycle method allowing the plugin to perform operations when it has been disabled.voidLifecycle method allowing the plugin to perform operations when it has been enabled.voidstart()Initialize the storage plugin.booleanIndicates if Drill can insert to a table to this plugin.booleanIndicates if Drill can read the table from this format.booleanIndicates if Drill can write a table to this format (e.g.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.drill.exec.store.SchemaFactory
registerSchemasMethods inherited from interface org.apache.drill.exec.store.StoragePlugin
getConfig, getOptimizerRules
-
Field Details
-
context
-
-
Constructor Details
-
AbstractStoragePlugin
-
-
Method Details
-
supportsRead
public boolean supportsRead()Description copied from interface:StoragePluginIndicates if Drill can read the table from this format.- Specified by:
supportsReadin interfaceStoragePlugin
-
supportsWrite
public boolean supportsWrite()Description copied from interface:StoragePluginIndicates if Drill can write a table to this format (e.g. as JSON, csv, etc.).- Specified by:
supportsWritein interfaceStoragePlugin
-
supportsInsert
public boolean supportsInsert()Description copied from interface:StoragePluginIndicates if Drill can insert to a table to this plugin.- Specified by:
supportsInsertin interfaceStoragePlugin
-
getPhysicalScan
public AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection, SessionOptionManager options) throws IOException Description copied from interface:StoragePluginGet the physical scan operator for the particular GroupScan (read) node.- Specified by:
getPhysicalScanin interfaceStoragePlugin- 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:StoragePluginGet the physical scan operator for the particular GroupScan (read) node.- Specified by:
getPhysicalScanin interfaceStoragePlugin- Parameters:
userName- User whom to impersonate when reading the contents as part of Scan.selection- The configured storage engine specific selection.options- (optional) session optionsmetadataProviderManager- manager for handling metadata providers- Returns:
- The physical scan operator for the particular GroupScan (read) node.
- Throws:
IOException
-
getPhysicalScan
Description copied from interface:StoragePluginGet the physical scan operator for the particular GroupScan (read) node.- Specified by:
getPhysicalScanin interfaceStoragePlugin- 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:StoragePluginGet the physical scan operator for the particular GroupScan (read) node.- Specified by:
getPhysicalScanin interfaceStoragePlugin- 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:StoragePluginGet the physical scan operator for the particular GroupScan (read) node.- Specified by:
getPhysicalScanin interfaceStoragePlugin- 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 optionsmetadataProviderManager- 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:StoragePluginGet the physical scan operator for the particular GroupScan (read) node.- Specified by:
getPhysicalScanin interfaceStoragePlugin- 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
Description copied from interface:StoragePluginInitialize the storage plugin. The storage plugin will not be used until this method is called.- Specified by:
startin interfaceStoragePlugin- Throws:
IOException
-
onEnabled
Description copied from interface:StoragePluginLifecycle method allowing the plugin to perform operations when it has been enabled.- Specified by:
onEnabledin interfaceStoragePlugin- 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
Description copied from interface:StoragePluginLifecycle method allowing the plugin to perform operations when it has been disabled.- Specified by:
onDisabledin interfaceStoragePlugin- 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
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getFormatPlugin
Description copied from interface:StoragePluginAllows to get the format plugin for current storage plugin based on appropriate format plugin config usage.- Specified by:
getFormatPluginin interfaceStoragePlugin- Parameters:
config- format plugin config- Returns:
- format plugin instance
-
getName
- Specified by:
getNamein interfaceStoragePlugin
-
getContext
-
toString
-