public class StrictJsonWriter extends Object
Constructor and Description |
---|
StrictJsonWriter(HiveEndPoint endPoint) |
StrictJsonWriter(HiveEndPoint endPoint,
HiveConf conf) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear bufferred writes.
|
void |
closeBatch()
Close the RecordUpdater.
|
void |
flush()
Flush records from buffer.
|
void |
newBatch(Long minTxnId,
Long maxTxnID)
Creates a new record updater for the new batch
|
void |
write(long transactionId,
byte[] record)
Writes using a hive RecordUpdater
|
public StrictJsonWriter(HiveEndPoint endPoint) throws ConnectionError, SerializationError, StreamingException
endPoint
- the end point to write toConnectionError
SerializationError
StreamingException
public StrictJsonWriter(HiveEndPoint endPoint, HiveConf conf) throws ConnectionError, SerializationError, StreamingException
endPoint
- the end point to write toconf
- a Hive conf object. Should be null if not using advanced Hive settings.ConnectionError
SerializationError
StreamingException
public void write(long transactionId, byte[] record) throws StreamingIOFailure, SerializationError
RecordWriter
transactionId
- the ID of the Txn in which the write occursrecord
- the record to be writtenStreamingIOFailure
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
Copyright © 2017 The Apache Software Foundation. All rights reserved.