Package org.apache.drill.exec.store
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
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.
-
Field Summary
Fields inherited from interface org.apache.drill.exec.store.SchemaFactory
DEFAULT_WS_NAME
-
Method Summary
Modifier and TypeMethodDescriptionMethod returns a Jackson serializable object that extends a StoragePluginConfig.getFormatPlugin
(FormatPluginConfig config) Allows to get the format plugin for current storage plugin based on appropriate format plugin config usage.getName()
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.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 providerManager) 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 providerManager) Get the physical scan operator for the particular GroupScan (read) node.void
Lifecycle method allowing the plugin to perform operations when it has been disabled.void
Lifecycle method allowing the plugin to perform operations when it has been enabled.void
start()
Initialize the storage plugin.boolean
Indicates if Drill can insert to a table to this plugin.boolean
Indicates if Drill can read the table from this format.boolean
Indicates if Drill can write a table to this format (e.g.Methods inherited from interface java.lang.AutoCloseable
close
Methods inherited from interface org.apache.drill.exec.store.SchemaFactory
registerSchemas
-
Method Details
-
getName
String getName() -
start
Initialize the storage plugin. The storage plugin will not be used until this method is called.- Throws:
IOException
-
onEnabled
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
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
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 optionsproviderManager
- 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 optionsproviderManager
- manager for handling metadata providers- Returns:
- The physical scan operator for the particular GroupScan (read) node.
- Throws:
IOException
-
getFormatPlugin
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
-