org.apache.hadoop.hive.ql.metadata
Class DefaultStorageHandler

java.lang.Object
  extended by org.apache.hadoop.hive.ql.metadata.DefaultStorageHandler
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, HiveStorageHandler

public class DefaultStorageHandler
extends Object
implements HiveStorageHandler

DefaultStorageHandler is an implementation of HiveStorageHandler which supplies the standard defaults for all options. This can be useful either as the base class for custom storage handlers, or as a mock in tests (providing something which appears to be a non-native table with respect to metadata even though its behavior is otherwise identical to a native table).


Constructor Summary
DefaultStorageHandler()
           
 
Method Summary
 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.
 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 SerDe> getSerDeClass()
           
 void setConf(org.apache.hadoop.conf.Configuration conf)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultStorageHandler

public DefaultStorageHandler()
Method Detail

getInputFormatClass

public Class<? extends org.apache.hadoop.mapred.InputFormat> getInputFormatClass()
Specified by:
getInputFormatClass in interface HiveStorageHandler
Returns:
Class providing an implementation of InputFormat

getOutputFormatClass

public Class<? extends org.apache.hadoop.mapred.OutputFormat> getOutputFormatClass()
Specified by:
getOutputFormatClass in interface HiveStorageHandler
Returns:
Class providing an implementation of OutputFormat

getSerDeClass

public Class<? extends SerDe> getSerDeClass()
Specified by:
getSerDeClass in interface HiveStorageHandler
Returns:
Class providing an implementation of SerDe

getMetaHook

public HiveMetaHook getMetaHook()
Specified by:
getMetaHook in interface HiveStorageHandler
Returns:
metadata hook implementation, or null if this storage handler does not need any metadata notifications

getAuthorizationProvider

public HiveAuthorizationProvider getAuthorizationProvider()
                                                   throws HiveException
Description copied from interface: HiveStorageHandler
Returns the implementation specific authorization provider

Specified by:
getAuthorizationProvider in interface HiveStorageHandler
Returns:
authorization provider
Throws:
HiveException

configureInputJobProperties

public void configureInputJobProperties(TableDesc tableDesc,
                                        Map<String,String> jobProperties)
Description copied from interface: HiveStorageHandler
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). Key value pairs passed into jobProperties are guaranteed to be set in the job's configuration object. User's can retrieve "context" information from tableDesc. User's should avoid mutating tableDesc and only make changes in jobProperties. This method is expected to be idempotent such that a job called with the same tableDesc values should return the same key-value pairs in jobProperties. Any external state set by this method should remain the same if this method is called again. It is up to the user to determine how best guarantee this invariant. This method in particular is to create a configuration for input.

Specified by:
configureInputJobProperties in interface HiveStorageHandler
Parameters:
tableDesc - descriptor for the table being accessed
jobProperties - receives properties copied or transformed from the table properties

configureOutputJobProperties

public void configureOutputJobProperties(TableDesc tableDesc,
                                         Map<String,String> jobProperties)
Description copied from interface: HiveStorageHandler
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). Key value pairs passed into jobProperties are guaranteed to be set in the job's configuration object. User's can retrieve "context" information from tableDesc. User's should avoid mutating tableDesc and only make changes in jobProperties. This method is expected to be idempotent such that a job called with the same tableDesc values should return the same key-value pairs in jobProperties. Any external state set by this method should remain the same if this method is called again. It is up to the user to determine how best guarantee this invariant. This method in particular is to create a configuration for output.

Specified by:
configureOutputJobProperties in interface HiveStorageHandler
Parameters:
tableDesc - descriptor for the table being accessed
jobProperties - receives properties copied or transformed from the table properties

configureTableJobProperties

public void configureTableJobProperties(TableDesc tableDesc,
                                        Map<String,String> jobProperties)
Description copied from interface: HiveStorageHandler
Deprecated use configureInputJobProperties/configureOutputJobProperties methods instead. Configures properties for a job based on the definition of the source or target table it accesses.

Specified by:
configureTableJobProperties in interface HiveStorageHandler
Parameters:
tableDesc - descriptor for the table being accessed
jobProperties - receives properties copied or transformed from the table properties

configureJobConf

public void configureJobConf(TableDesc tableDesc,
                             org.apache.hadoop.mapred.JobConf jobConf)
Description copied from interface: HiveStorageHandler
Called just before submitting MapReduce job.

Specified by:
configureJobConf in interface HiveStorageHandler
Parameters:
tableDesc - descriptor for the table being accessed

getConf

public org.apache.hadoop.conf.Configuration getConf()
Specified by:
getConf in interface org.apache.hadoop.conf.Configurable

setConf

public void setConf(org.apache.hadoop.conf.Configuration conf)
Specified by:
setConf in interface org.apache.hadoop.conf.Configurable


Copyright © 2014 The Apache Software Foundation. All rights reserved.