Package org.apache.orc.impl.writer
Class EncryptionTreeWriter
java.lang.Object
org.apache.orc.impl.writer.EncryptionTreeWriter
- All Implemented Interfaces:
TreeWriter
TreeWriter that handles column encryption.
We create a TreeWriter for each of the alternatives with an WriterContext
that creates encrypted streams.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.orc.impl.writer.TreeWriter
TreeWriter.Factory -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStripeStatistics(StripeStatistics[] stripeStatistics) During a stripe append, we need to handle the stripe statistics.voidCreate a row index entry at the current point in the stripe.longEstimate the memory currently used to buffer the stripe.voidFlush the TreeWriter streamvoidgetCurrentStatistics(ColumnStatistics[] output) Get the current file statistics for each column.longEstimate the memory used if the file was read into Hive's Writable types.voidprepareStripe(int stripeId) Set up for the next stripe.voidwriteBatch(org.apache.hadoop.hive.ql.exec.vector.ColumnVector vector, int offset, int length) Write a ColumnVector to the file.voidWrite the FileStatistics for each column in each encryption variant.voidwriteRootBatch(org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch batch, int offset, int length) Write a VectorizedRowBatch to the file.voidwriteStripe(int requiredIndexEntries) Write the stripe out to the file.
-
Method Details
-
writeRootBatch
public void writeRootBatch(org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch batch, int offset, int length) throws IOException Description copied from interface:TreeWriterWrite a VectorizedRowBatch to the file. This is called by the WriterImplV2 at the top level.- Specified by:
writeRootBatchin interfaceTreeWriter- Parameters:
batch- the list of all of the columnsoffset- the first row from the batch to writelength- the number of rows to write- Throws:
IOException
-
writeBatch
public void writeBatch(org.apache.hadoop.hive.ql.exec.vector.ColumnVector vector, int offset, int length) throws IOException Description copied from interface:TreeWriterWrite a ColumnVector to the file. This is called recursively by writeRootBatch.- Specified by:
writeBatchin interfaceTreeWriter- Parameters:
vector- the data to writeoffset- the first value offset to write.length- the number of values to write- Throws:
IOException
-
createRowIndexEntry
Description copied from interface:TreeWriterCreate a row index entry at the current point in the stripe.- Specified by:
createRowIndexEntryin interfaceTreeWriter- Throws:
IOException
-
flushStreams
Description copied from interface:TreeWriterFlush the TreeWriter stream- Specified by:
flushStreamsin interfaceTreeWriter- Throws:
IOException
-
writeStripe
Description copied from interface:TreeWriterWrite the stripe out to the file.- Specified by:
writeStripein interfaceTreeWriter- Parameters:
requiredIndexEntries- the number of index entries that are required. this is to check to make sure the row index is well formed.- Throws:
IOException
-
addStripeStatistics
Description copied from interface:TreeWriterDuring a stripe append, we need to handle the stripe statistics.- Specified by:
addStripeStatisticsin interfaceTreeWriter- Parameters:
stripeStatistics- the statistics for the new stripe across the encryption variants- Throws:
IOException
-
estimateMemory
public long estimateMemory()Description copied from interface:TreeWriterEstimate the memory currently used to buffer the stripe.- Specified by:
estimateMemoryin interfaceTreeWriter- Returns:
- the number of bytes
-
getRawDataSize
public long getRawDataSize()Description copied from interface:TreeWriterEstimate the memory used if the file was read into Hive's Writable types. This is used as an estimate for the query optimizer.- Specified by:
getRawDataSizein interfaceTreeWriter- Returns:
- the number of bytes
-
prepareStripe
public void prepareStripe(int stripeId) Description copied from interface:TreeWriterSet up for the next stripe.- Specified by:
prepareStripein interfaceTreeWriter- Parameters:
stripeId- the next stripe id
-
writeFileStatistics
Description copied from interface:TreeWriterWrite the FileStatistics for each column in each encryption variant.- Specified by:
writeFileStatisticsin interfaceTreeWriter- Throws:
IOException
-
getCurrentStatistics
Description copied from interface:TreeWriterGet the current file statistics for each column. If a column is encrypted, the encrypted variant statistics are used.- Specified by:
getCurrentStatisticsin interfaceTreeWriter- Parameters:
output- an array that is filled in with the results
-