public class HiveTableOutputFormat extends HadoopOutputFormatCommonBase<Row> implements InitializeOnMaster, FinalizeOnMaster
credentials
Constructor and Description |
---|
HiveTableOutputFormat(org.apache.hadoop.mapred.JobConf jobConf,
ObjectPath tablePath,
CatalogTable table,
HiveTablePartition hiveTablePartition,
Properties tableProperties,
boolean overwrite) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Method that marks the end of the life-cycle of parallel output instance.
|
void |
configure(Configuration parameters)
Configures this output format.
|
void |
finalizeGlobal(int parallelism)
The method is invoked on the master (JobManager) after all (parallel) instances of an OutputFormat finished.
|
void |
initializeGlobal(int parallelism)
The method is invoked on the master (JobManager) before the distributed program execution starts.
|
void |
open(int taskNumber,
int numTasks)
Opens a parallel instance of the output format to store the result of its parallel instance.
|
void |
writeRecord(Row record)
Adds a record to the output.
|
read, write
getRuntimeContext, setRuntimeContext
public HiveTableOutputFormat(org.apache.hadoop.mapred.JobConf jobConf, ObjectPath tablePath, CatalogTable table, HiveTablePartition hiveTablePartition, Properties tableProperties, boolean overwrite)
public void finalizeGlobal(int parallelism) throws IOException
FinalizeOnMaster
finalizeGlobal
in interface FinalizeOnMaster
parallelism
- The parallelism with which the format or functions was run.IOException
- The finalization may throw exceptions, which may cause the job to abort.public void initializeGlobal(int parallelism) throws IOException
InitializeOnMaster
initializeGlobal
in interface InitializeOnMaster
parallelism
- The parallelism with which the format or functions will be run.IOException
- The initialization may throw exceptions, which may cause the job to abort.public void configure(Configuration parameters)
OutputFormat
This method is always called first on a newly instantiated output format.
configure
in interface OutputFormat<Row>
parameters
- The configuration with all parameters.public void open(int taskNumber, int numTasks) throws IOException
OutputFormat
When this method is called, the output format it guaranteed to be configured.
open
in interface OutputFormat<Row>
taskNumber
- The number of the parallel instance.numTasks
- The number of parallel tasks.IOException
- Thrown, if the output could not be opened due to an I/O problem.public void writeRecord(Row record) throws IOException
OutputFormat
When this method is called, the output format it guaranteed to be opened.
writeRecord
in interface OutputFormat<Row>
record
- The records to add to the output.IOException
- Thrown, if the records could not be added to to an I/O problem.public void close() throws IOException
OutputFormat
When this method is called, the output format it guaranteed to be opened.
close
in interface OutputFormat<Row>
IOException
- Thrown, if the input could not be closed properly.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.