public abstract class AbstractRecordWriter extends Object implements RecordWriter
Modifier and Type | Field and Description |
---|---|
protected List<Integer> |
bucketIds |
int |
totalBuckets |
Modifier | Constructor and Description |
---|---|
protected |
AbstractRecordWriter(HiveEndPoint endPoint,
HiveConf conf)
Deprecated.
As of release 1.3/2.1. Replaced by
AbstractRecordWriter(HiveEndPoint, HiveConf, StreamingConnection) |
protected |
AbstractRecordWriter(HiveEndPoint endPoint2,
HiveConf conf,
StreamingConnection conn) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear bufferred writes.
|
void |
closeBatch()
Close the RecordUpdater.
|
abstract Object |
encode(byte[] record)
Encode a record as an Object that Hive can read with the ObjectInspector associated with the
serde returned by
getSerde() . |
void |
flush()
Flush records from buffer.
|
protected int |
getBucket(Object row) |
protected abstract ObjectInspector[] |
getBucketObjectInspectors() |
protected abstract StructField[] |
getBucketStructFields() |
protected static ObjectInspector[] |
getObjectInspectorsForBucketedCols(List<Integer> bucketIds,
StructObjectInspector recordObjInspector) |
protected abstract StructObjectInspector |
getRecordObjectInspector() |
abstract SerDe |
getSerde()
Get the SerDe for the Objects created by
encode(byte[]) . |
void |
newBatch(Long minTxnId,
Long maxTxnID)
Creates a new record updater for the new batch
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
write
protected AbstractRecordWriter(HiveEndPoint endPoint, HiveConf conf) throws ConnectionError, StreamingException
AbstractRecordWriter(HiveEndPoint, HiveConf, StreamingConnection)
ConnectionError
StreamingException
protected AbstractRecordWriter(HiveEndPoint endPoint2, HiveConf conf, StreamingConnection conn) throws StreamingException
StreamingException
public abstract SerDe getSerde() throws SerializationError
encode(byte[])
. This is public so that test
frameworks can use it.SerializationError
public abstract Object encode(byte[] record) throws SerializationError
getSerde()
. This is public so that test frameworks can use it.record
- record to be deserializedSerializationError
protected abstract ObjectInspector[] getBucketObjectInspectors()
protected abstract StructObjectInspector getRecordObjectInspector()
protected abstract StructField[] getBucketStructFields()
protected int getBucket(Object row) throws SerializationError
SerializationError
public void flush() throws StreamingIOFailure
RecordWriter
flush
in interface RecordWriter
StreamingIOFailure
public void clear() throws StreamingIOFailure
RecordWriter
clear
in interface RecordWriter
StreamingIOFailure
public void newBatch(Long minTxnId, Long maxTxnID) throws StreamingIOFailure, SerializationError
newBatch
in interface RecordWriter
minTxnId
- smallest Txnid in the batchmaxTxnID
- largest Txnid in the batchStreamingIOFailure
- if failed to create record updaterSerializationError
public void closeBatch() throws StreamingIOFailure
RecordWriter
closeBatch
in interface RecordWriter
StreamingIOFailure
protected static ObjectInspector[] getObjectInspectorsForBucketedCols(List<Integer> bucketIds, StructObjectInspector recordObjInspector) throws SerializationError
SerializationError
Copyright © 2016 The Apache Software Foundation. All rights reserved.