org.apache.hcatalog.rcfile
Class RCFileOutputDriver

java.lang.Object
  extended by org.apache.hcatalog.mapreduce.HCatOutputStorageDriver
      extended by org.apache.hcatalog.rcfile.RCFileOutputDriver

public class RCFileOutputDriver
extends HCatOutputStorageDriver

The storage driver for writing RCFile data through HCatOutputFormat.


Constructor Summary
RCFileOutputDriver()
           
 
Method Summary
 org.apache.hadoop.io.Writable convertValue(HCatRecord value)
          Convert the given HCatRecord value to the actual value type.
 org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector createStructObjectInspector()
           
 org.apache.hadoop.io.WritableComparable<?> generateKey(HCatRecord value)
          Generate the key for the underlying outputformat.
 org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector getObjectInspector(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo type)
           
 org.apache.hadoop.mapreduce.OutputFormat<? super org.apache.hadoop.io.WritableComparable<?>,? super org.apache.hadoop.io.Writable> getOutputFormat()
          Returns the OutputFormat to use with this Storage Driver.
 void initialize(org.apache.hadoop.mapreduce.JobContext context, java.util.Properties hcatProperties)
          Initialize the storage driver with specified properties, default implementation does nothing.
 void setOutputPath(org.apache.hadoop.mapreduce.JobContext jobContext, java.lang.String location)
          Set the data location for the output.
 void setPartitionValues(org.apache.hadoop.mapreduce.JobContext jobContext, java.util.Map<java.lang.String,java.lang.String> partitionValues)
          Sets the partition key values for the partition being written.
 void setSchema(org.apache.hadoop.mapreduce.JobContext jobContext, HCatSchema schema)
          Set the schema for the data being written out.
 
Methods inherited from class org.apache.hcatalog.mapreduce.HCatOutputStorageDriver
abortOutputCommitterJob, cleanupOutputCommitterJob, getOutputLocation, getWorkFilePath, setupOutputCommitterJob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RCFileOutputDriver

public RCFileOutputDriver()
Method Detail

convertValue

public org.apache.hadoop.io.Writable convertValue(HCatRecord value)
                                           throws java.io.IOException
Description copied from class: HCatOutputStorageDriver
Convert the given HCatRecord value to the actual value type.

Specified by:
convertValue in class HCatOutputStorageDriver
Parameters:
value - the HCatRecord value to convert
Returns:
a value instance
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

generateKey

public org.apache.hadoop.io.WritableComparable<?> generateKey(HCatRecord value)
                                                       throws java.io.IOException
Description copied from class: HCatOutputStorageDriver
Generate the key for the underlying outputformat. The value given to HCatOutputFormat is passed as the argument. The key given to HCatOutputFormat is ignored..

Specified by:
generateKey in class HCatOutputStorageDriver
Parameters:
value - the value given to HCatOutputFormat
Returns:
a key instance
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

getOutputFormat

public org.apache.hadoop.mapreduce.OutputFormat<? super org.apache.hadoop.io.WritableComparable<?>,? super org.apache.hadoop.io.Writable> getOutputFormat()
                                                                                                                                                   throws java.io.IOException
Description copied from class: HCatOutputStorageDriver
Returns the OutputFormat to use with this Storage Driver.

Specified by:
getOutputFormat in class HCatOutputStorageDriver
Returns:
the OutputFormat instance
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

setOutputPath

public void setOutputPath(org.apache.hadoop.mapreduce.JobContext jobContext,
                          java.lang.String location)
                   throws java.io.IOException
Description copied from class: HCatOutputStorageDriver
Set the data location for the output.

Specified by:
setOutputPath in class HCatOutputStorageDriver
Parameters:
jobContext - the job context object
location - the data location
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

setPartitionValues

public void setPartitionValues(org.apache.hadoop.mapreduce.JobContext jobContext,
                               java.util.Map<java.lang.String,java.lang.String> partitionValues)
                        throws java.io.IOException
Description copied from class: HCatOutputStorageDriver
Sets the partition key values for the partition being written.

Specified by:
setPartitionValues in class HCatOutputStorageDriver
Parameters:
jobContext - the job context object
partitionValues - the partition values
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

setSchema

public void setSchema(org.apache.hadoop.mapreduce.JobContext jobContext,
                      HCatSchema schema)
               throws java.io.IOException
Description copied from class: HCatOutputStorageDriver
Set the schema for the data being written out.

Specified by:
setSchema in class HCatOutputStorageDriver
Parameters:
jobContext - the job context object
schema - the data schema
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

initialize

public void initialize(org.apache.hadoop.mapreduce.JobContext context,
                       java.util.Properties hcatProperties)
                throws java.io.IOException
Description copied from class: HCatOutputStorageDriver
Initialize the storage driver with specified properties, default implementation does nothing.

Overrides:
initialize in class HCatOutputStorageDriver
Parameters:
context - the job context object
hcatProperties - the properties for the storage driver
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

createStructObjectInspector

public org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector createStructObjectInspector()
                                                                                                throws java.io.IOException
Throws:
java.io.IOException

getObjectInspector

public org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector getObjectInspector(org.apache.hadoop.hive.serde2.typeinfo.TypeInfo type)
                                                                                 throws java.io.IOException
Throws:
java.io.IOException