public class WriterImpl extends Object implements Writer, MemoryManager.Callback
| Modifier and Type | Method and Description |
|---|---|
void |
addRow(Object row)
Add a row to the ORC file.
|
void |
addUserMetadata(String name,
ByteBuffer value)
Add arbitrary meta-data to the ORC file.
|
void |
appendStripe(byte[] stripe,
int offset,
int length,
StripeInformation stripeInfo,
OrcProto.StripeStatistics stripeStatistics)
Fast stripe append to ORC file.
|
void |
appendUserMetadata(List<OrcProto.UserMetadataItem> userMetadata)
When fast stripe append is used for merging ORC stripes, after appending
the last stripe from a file, this interface must be used to merge any
user metadata.
|
boolean |
checkMemory(double newScale)
The writer needs to check its memory usage
|
void |
close()
Flush all of the buffers and close the file.
|
static CompressionCodec |
createCodec(CompressionKind kind) |
long |
getNumberOfRows()
Row count gets updated when flushing the stripes.
|
long |
getRawDataSize()
Raw data size will be compute when writing the file footer.
|
long |
writeIntermediateFooter()
Write an intermediate footer on the file such that if the file is
truncated to the returned offset, it would be a valid ORC file.
|
public static CompressionCodec createCodec(CompressionKind kind)
public boolean checkMemory(double newScale)
throws IOException
MemoryManager.CallbackcheckMemory in interface MemoryManager.CallbacknewScale - the current scale factor for memory allocationsIOExceptionpublic void addUserMetadata(String name, ByteBuffer value)
WriteraddUserMetadata in interface Writername - a key to label the data with.value - the contents of the metadata.public void addRow(Object row) throws IOException
WriteraddRow in interface Writerrow - the row to addIOExceptionpublic void close()
throws IOException
Writerclose in interface WriterIOExceptionpublic long getRawDataSize()
getRawDataSize in interface Writerpublic long getNumberOfRows()
getNumberOfRows in interface Writerpublic long writeIntermediateFooter()
throws IOException
WriterwriteIntermediateFooter in interface WriterIOExceptionpublic void appendStripe(byte[] stripe,
int offset,
int length,
StripeInformation stripeInfo,
OrcProto.StripeStatistics stripeStatistics)
throws IOException
WriterappendStripe in interface Writerstripe - - stripe as byte arrayoffset - - offset within byte arraylength - - length of stripe within byte arraystripeInfo - - stripe informationstripeStatistics - - stripe statistics (Protobuf objects can be
merged directly)IOExceptionpublic void appendUserMetadata(List<OrcProto.UserMetadataItem> userMetadata)
WriterappendUserMetadata in interface WriteruserMetadata - - user metadataCopyright © 2017 The Apache Software Foundation. All rights reserved.