public class DruidStorageHandler extends DefaultHiveMetaHook implements HiveStorageHandler
Modifier and Type | Field and Description |
---|---|
protected static SessionState.LogHelper |
console |
protected static org.slf4j.Logger |
LOG |
static String |
SEGMENTS_DESCRIPTOR_DIR_NAME |
Constructor and Description |
---|
DruidStorageHandler() |
DruidStorageHandler(io.druid.metadata.SQLMetadataConnector connector,
io.druid.indexer.SQLMetadataStorageUpdaterJobHandler druidSqlMetadataStorageUpdaterJobHandler,
io.druid.metadata.MetadataStorageTablesConfig druidMetadataStorageTablesConfig,
com.metamx.http.client.HttpClient httpClient) |
Modifier and Type | Method and Description |
---|---|
void |
commitCreateTable(Table table)
Called after successfully adding a new table definition to the metastore
during CREATE TABLE.
|
void |
commitDropTable(Table table,
boolean deleteData)
Called after successfully removing a table definition from the metastore
during DROP TABLE.
|
void |
commitInsertTable(Table table,
boolean overwrite)
Called after successfully after INSERT [OVERWRITE] statement is executed.
|
void |
configureInputJobProperties(TableDesc tableDesc,
Map<String,String> jobProperties)
This method is called to allow the StorageHandlers the chance
to populate the JobContext.getConfiguration() with properties that
maybe be needed by the handler's bundled artifacts (ie InputFormat, SerDe, etc).
|
void |
configureJobConf(TableDesc tableDesc,
org.apache.hadoop.mapred.JobConf jobConf)
Called just before submitting MapReduce job.
|
void |
configureOutputJobProperties(TableDesc tableDesc,
Map<String,String> jobProperties)
This method is called to allow the StorageHandlers the chance
to populate the JobContext.getConfiguration() with properties that
maybe be needed by the handler's bundled artifacts (ie InputFormat, SerDe, etc).
|
void |
configureTableJobProperties(TableDesc tableDesc,
Map<String,String> jobProperties)
Deprecated use configureInputJobProperties/configureOutputJobProperties
methods instead.
|
protected void |
deleteSegment(io.druid.timeline.DataSegment segment) |
HiveAuthorizationProvider |
getAuthorizationProvider()
Returns the implementation specific authorization provider
|
org.apache.hadoop.conf.Configuration |
getConf() |
Class<? extends org.apache.hadoop.mapred.InputFormat> |
getInputFormatClass() |
HiveMetaHook |
getMetaHook() |
Class<? extends org.apache.hadoop.mapred.OutputFormat> |
getOutputFormatClass() |
Class<? extends AbstractSerDe> |
getSerDeClass() |
String |
getUniqueId() |
protected String |
makeStagingName() |
void |
preCreateTable(Table table)
Called before a new table definition is added to the metastore
during CREATE TABLE.
|
void |
preDropTable(Table table)
Called before a table definition is removed from the metastore
during DROP TABLE.
|
void |
preInsertTable(Table table,
boolean overwrite)
called before commit insert method is called
|
void |
rollbackCreateTable(Table table)
Called after failure adding a new table definition to the metastore
during CREATE TABLE.
|
void |
rollbackDropTable(Table table)
Called after failure removing a table definition from the metastore
during DROP TABLE.
|
void |
rollbackInsertTable(Table table,
boolean overwrite)
called in case pre commit or commit insert fail.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
String |
toString() |
protected static final org.slf4j.Logger LOG
protected static final SessionState.LogHelper console
public static final String SEGMENTS_DESCRIPTOR_DIR_NAME
public DruidStorageHandler()
public DruidStorageHandler(io.druid.metadata.SQLMetadataConnector connector, io.druid.indexer.SQLMetadataStorageUpdaterJobHandler druidSqlMetadataStorageUpdaterJobHandler, io.druid.metadata.MetadataStorageTablesConfig druidMetadataStorageTablesConfig, com.metamx.http.client.HttpClient httpClient)
public Class<? extends org.apache.hadoop.mapred.InputFormat> getInputFormatClass()
getInputFormatClass
in interface HiveStorageHandler
InputFormat
public Class<? extends org.apache.hadoop.mapred.OutputFormat> getOutputFormatClass()
getOutputFormatClass
in interface HiveStorageHandler
OutputFormat
public Class<? extends AbstractSerDe> getSerDeClass()
getSerDeClass
in interface HiveStorageHandler
AbstractSerDe
public HiveMetaHook getMetaHook()
getMetaHook
in interface HiveStorageHandler
public HiveAuthorizationProvider getAuthorizationProvider() throws HiveException
HiveStorageHandler
getAuthorizationProvider
in interface HiveStorageHandler
HiveException
public void configureInputJobProperties(TableDesc tableDesc, Map<String,String> jobProperties)
HiveStorageHandler
configureInputJobProperties
in interface HiveStorageHandler
tableDesc
- descriptor for the table being accessedjobProperties
- receives properties copied or transformed
from the table propertiespublic void preCreateTable(Table table) throws MetaException
HiveMetaHook
preCreateTable
in interface HiveMetaHook
table
- new table definitionMetaException
public void rollbackCreateTable(Table table) throws MetaException
HiveMetaHook
rollbackCreateTable
in interface HiveMetaHook
table
- new table definitionMetaException
public void commitCreateTable(Table table) throws MetaException
HiveMetaHook
commitCreateTable
in interface HiveMetaHook
table
- new table definitionMetaException
protected void deleteSegment(io.druid.timeline.DataSegment segment) throws io.druid.segment.loading.SegmentLoadingException
io.druid.segment.loading.SegmentLoadingException
public void preDropTable(Table table) throws MetaException
HiveMetaHook
preDropTable
in interface HiveMetaHook
table
- table definitionMetaException
public void rollbackDropTable(Table table) throws MetaException
HiveMetaHook
rollbackDropTable
in interface HiveMetaHook
table
- table definitionMetaException
public void commitDropTable(Table table, boolean deleteData) throws MetaException
HiveMetaHook
commitDropTable
in interface HiveMetaHook
table
- table definitiondeleteData
- whether to delete data as well; this should typically
be ignored in the case of an external tableMetaException
public void commitInsertTable(Table table, boolean overwrite) throws MetaException
DefaultHiveMetaHook
commitInsertTable
in class DefaultHiveMetaHook
table
- table definitionoverwrite
- true if it is INSERT OVERWRITEMetaException
public void preInsertTable(Table table, boolean overwrite) throws MetaException
DefaultHiveMetaHook
preInsertTable
in class DefaultHiveMetaHook
table
- table definitionoverwrite
- true if it is INSERT OVERWRITEMetaException
public void rollbackInsertTable(Table table, boolean overwrite) throws MetaException
DefaultHiveMetaHook
rollbackInsertTable
in class DefaultHiveMetaHook
table
- table definitionoverwrite
- true if it is INSERT OVERWRITEMetaException
public void configureOutputJobProperties(TableDesc tableDesc, Map<String,String> jobProperties)
HiveStorageHandler
configureOutputJobProperties
in interface HiveStorageHandler
tableDesc
- descriptor for the table being accessedjobProperties
- receives properties copied or transformed
from the table propertiespublic void configureTableJobProperties(TableDesc tableDesc, Map<String,String> jobProperties)
HiveStorageHandler
configureTableJobProperties
in interface HiveStorageHandler
tableDesc
- descriptor for the table being accessedjobProperties
- receives properties copied or transformed
from the table propertiespublic void configureJobConf(TableDesc tableDesc, org.apache.hadoop.mapred.JobConf jobConf)
HiveStorageHandler
configureJobConf
in interface HiveStorageHandler
tableDesc
- descriptor for the table being accessedpublic void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
public org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable
public String getUniqueId()
protected String makeStagingName()
Copyright © 2021 The Apache Software Foundation. All rights reserved.