@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class HCatWriter extends Object
DataTransferFactory
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
protected WriterContext |
info |
protected StateProvider |
sp |
protected WriteEntity |
we |
Modifier | Constructor and Description |
---|---|
protected |
HCatWriter(org.apache.hadoop.conf.Configuration config,
StateProvider sp)
This constructor will be used at slave nodes.
|
protected |
HCatWriter(WriteEntity we,
Map<String,String> config)
This constructor will be used at master node
|
Modifier and Type | Method and Description |
---|---|
abstract void |
abort(WriterContext context)
This method should be called at master node.
|
abstract void |
commit(WriterContext context)
This method should be called at master node.
|
abstract WriterContext |
prepareWrite()
External system should invoke this method exactly once from a master node.
|
abstract void |
write(Iterator<HCatRecord> recordItr)
This method should be used at slave needs to perform writes.
|
protected org.apache.hadoop.conf.Configuration conf
protected WriteEntity we
protected WriterContext info
protected StateProvider sp
protected HCatWriter(WriteEntity we, Map<String,String> config)
we
- WriteEntity defines where in storage records should be written to.config
- Any configuration which external system wants to communicate to
HCatalog for performing writes.protected HCatWriter(org.apache.hadoop.conf.Configuration config, StateProvider sp)
config
- public abstract WriterContext prepareWrite() throws HCatException
WriterContext
This should be serialized and sent to slave
nodes to construct HCatWriter there.HCatException
public abstract void write(Iterator<HCatRecord> recordItr) throws HCatException
recordItr
- Iterator
records to be written into HCatalog.{@link
- HCatException}HCatException
public abstract void commit(WriterContext context) throws HCatException
{@link
- HCatException}HCatException
public abstract void abort(WriterContext context) throws HCatException
{@link
- HCatException} *HCatException
Copyright © 2017 The Apache Software Foundation. All rights reserved.