public class WriterImpl extends Object implements org.apache.orc.impl.WriterInternal, org.apache.orc.MemoryManager.Callback
This class is unsynchronized like most Stream objects, so from the creation of an OrcFile and all access to a single instance has to be from a single thread.
There are no known cases where these happen between different threads today.
Caveat: the MemoryManager is created during WriterOptions create, that has to be confined to a single thread as well.
NOTE: The file was copied and modified to support zstd-jni. This feature is only supported in ORC 2.0, but 2.0 only supports JDK17. We need to support JDK8.
| 构造器和说明 |
|---|
WriterImpl(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
OrcFile.WriterOptions opts) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addRowBatch(org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch batch) |
void |
addUserMetadata(String name,
ByteBuffer value) |
void |
appendStripe(byte[] stripe,
int offset,
int length,
org.apache.orc.StripeInformation stripeInfo,
org.apache.orc.OrcProto.StripeStatistics stripeStatistics) |
void |
appendStripe(byte[] stripe,
int offset,
int length,
org.apache.orc.StripeInformation stripeInfo,
org.apache.orc.StripeStatistics[] stripeStatistics) |
void |
appendUserMetadata(List<org.apache.orc.OrcProto.UserMetadataItem> userMetadata) |
boolean |
checkMemory(double newScale) |
void |
close() |
static org.apache.orc.CompressionCodec |
createCodec(CompressionKind kind) |
long |
estimateMemory() |
org.apache.orc.CompressionCodec |
getCompressionCodec() |
static int |
getEstimatedBufferSize(long stripeSize,
int numColumns,
int bs) |
long |
getNumberOfRows()
Row count gets updated when flushing the stripes.
|
long |
getRawDataSize()
Raw data size will be compute when writing the file footer.
|
org.apache.orc.TypeDescription |
getSchema() |
org.apache.orc.ColumnStatistics[] |
getStatistics() |
List<org.apache.orc.StripeInformation> |
getStripes() |
void |
increaseCompressionSize(int newSize) |
long |
writeIntermediateFooter() |
public WriterImpl(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
OrcFile.WriterOptions opts)
throws IOException
IOExceptionpublic static int getEstimatedBufferSize(long stripeSize,
int numColumns,
int bs)
public void increaseCompressionSize(int newSize)
increaseCompressionSize 在接口中 org.apache.orc.impl.WriterInternalpublic static org.apache.orc.CompressionCodec createCodec(CompressionKind kind)
public boolean checkMemory(double newScale)
throws IOException
checkMemory 在接口中 org.apache.orc.MemoryManager.CallbackIOExceptionpublic org.apache.orc.TypeDescription getSchema()
getSchema 在接口中 org.apache.orc.Writerpublic void addUserMetadata(String name, ByteBuffer value)
addUserMetadata 在接口中 org.apache.orc.Writerpublic void addRowBatch(org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch batch)
throws IOException
addRowBatch 在接口中 org.apache.orc.WriterIOExceptionpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在接口中 org.apache.orc.WriterIOExceptionpublic long getRawDataSize()
getRawDataSize 在接口中 org.apache.orc.Writerpublic long getNumberOfRows()
getNumberOfRows 在接口中 org.apache.orc.Writerpublic long writeIntermediateFooter()
throws IOException
writeIntermediateFooter 在接口中 org.apache.orc.WriterIOExceptionpublic void appendStripe(byte[] stripe,
int offset,
int length,
org.apache.orc.StripeInformation stripeInfo,
org.apache.orc.OrcProto.StripeStatistics stripeStatistics)
throws IOException
appendStripe 在接口中 org.apache.orc.WriterIOExceptionpublic void appendStripe(byte[] stripe,
int offset,
int length,
org.apache.orc.StripeInformation stripeInfo,
org.apache.orc.StripeStatistics[] stripeStatistics)
throws IOException
appendStripe 在接口中 org.apache.orc.WriterIOExceptionpublic void appendUserMetadata(List<org.apache.orc.OrcProto.UserMetadataItem> userMetadata)
appendUserMetadata 在接口中 org.apache.orc.Writerpublic org.apache.orc.ColumnStatistics[] getStatistics()
getStatistics 在接口中 org.apache.orc.Writerpublic List<org.apache.orc.StripeInformation> getStripes() throws IOException
getStripes 在接口中 org.apache.orc.WriterIOExceptionpublic org.apache.orc.CompressionCodec getCompressionCodec()
public long estimateMemory()
estimateMemory 在接口中 org.apache.orc.WriterCopyright © 2023–2024 The Apache Software Foundation. All rights reserved.