public abstract class TreeWriterBase extends Object implements TreeWriter
TreeWriter.Factory
Modifier and Type | Field and Description |
---|---|
protected BloomFilter |
bloomFilter |
protected OrcProto.BloomFilter.Builder |
bloomFilterEntry |
protected BloomFilterUtf8 |
bloomFilterUtf8 |
protected boolean |
createBloomFilter |
protected ColumnStatisticsImpl |
fileStatistics |
protected int |
id |
protected ColumnStatisticsImpl |
indexStatistics |
protected BitFieldWriter |
isPresent |
protected org.apache.orc.impl.writer.TreeWriterBase.RowIndexPositionRecorder |
rowIndexPosition |
protected ColumnStatisticsImpl |
stripeColStatistics |
Modifier and Type | Method and Description |
---|---|
void |
createRowIndexEntry()
Create a row index entry with the previous location and the current
index statistics.
|
long |
estimateMemory()
Estimate how much memory the writer is consuming excluding the streams.
|
void |
flushStreams()
Flush the TreeWriter stream
|
protected OrcProto.RowIndex.Builder |
getRowIndex() |
protected OrcProto.RowIndexEntry.Builder |
getRowIndexEntry() |
protected ColumnStatisticsImpl |
getStripeStatistics() |
void |
updateFileStatistics(OrcProto.StripeStatistics stats)
During a stripe append, we need to update the file statistics.
|
void |
writeBatch(ColumnVector vector,
int offset,
int length)
Write the values from the given vector from offset for length elements.
|
void |
writeFileStatistics(OrcProto.Footer.Builder footer)
Add the file statistics to the file footer.
|
void |
writeRootBatch(VectorizedRowBatch batch,
int offset,
int length)
Handle the top level object write.
|
void |
writeStripe(OrcProto.StripeFooter.Builder builder,
OrcProto.StripeStatistics.Builder stats,
int requiredIndexEntries)
Write the stripe out to the file.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRawDataSize
protected final int id
protected final BitFieldWriter isPresent
protected final ColumnStatisticsImpl indexStatistics
protected final ColumnStatisticsImpl stripeColStatistics
protected final ColumnStatisticsImpl fileStatistics
protected final org.apache.orc.impl.writer.TreeWriterBase.RowIndexPositionRecorder rowIndexPosition
protected final BloomFilter bloomFilter
protected final BloomFilterUtf8 bloomFilterUtf8
protected final boolean createBloomFilter
protected final OrcProto.BloomFilter.Builder bloomFilterEntry
protected OrcProto.RowIndex.Builder getRowIndex()
protected ColumnStatisticsImpl getStripeStatistics()
protected OrcProto.RowIndexEntry.Builder getRowIndexEntry()
public void writeRootBatch(VectorizedRowBatch batch, int offset, int length) throws IOException
writeRootBatch
in interface TreeWriter
batch
- the batch to write fromoffset
- the row to start onlength
- the number of rows to writeIOException
public void writeBatch(ColumnVector vector, int offset, int length) throws IOException
writeBatch
in interface TreeWriter
vector
- the vector to write fromoffset
- the first value from the vector to writelength
- the number of values from the vector to writeIOException
public void flushStreams() throws IOException
TreeWriter
flushStreams
in interface TreeWriter
IOException
public void writeStripe(OrcProto.StripeFooter.Builder builder, OrcProto.StripeStatistics.Builder stats, int requiredIndexEntries) throws IOException
TreeWriter
writeStripe
in interface TreeWriter
builder
- the stripe footer that contains the information about the
layout of the stripe. The TreeWriterBase is required to update
the footer with its information.stats
- the stripe statistics informationrequiredIndexEntries
- the number of index entries that are
required. this is to check to make sure the
row index is well formed.IOException
public void createRowIndexEntry() throws IOException
createRowIndexEntry
in interface TreeWriter
IOException
public void updateFileStatistics(OrcProto.StripeStatistics stats)
TreeWriter
updateFileStatistics
in interface TreeWriter
stats
- the statistics for the new stripepublic long estimateMemory()
estimateMemory
in interface TreeWriter
public void writeFileStatistics(OrcProto.Footer.Builder footer)
TreeWriter
writeFileStatistics
in interface TreeWriter
footer
- the file footer builderCopyright © 2013–2018 The Apache Software Foundation. All rights reserved.