Class BitPackingValuesWriter
java.lang.Object
org.apache.parquet.column.values.ValuesWriter
org.apache.parquet.column.values.bitpacking.BitPackingValuesWriter
- All Implemented Interfaces:
AutoCloseable
a column writer that packs the ints in the number of bits required based on the maximum size.
-
Constructor Summary
ConstructorsConstructorDescriptionBitPackingValuesWriter(int bound, int initialCapacity, int pageSize, org.apache.parquet.bytes.ByteBufferAllocator allocator) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Called to close the values writer.longlongused to decide if we want to work to the next pageorg.apache.parquet.bytes.BytesInputgetBytes()called after getBytes() and before reset()memUsageString(String prefix) voidreset()called after getBytes() to reset the current buffer and start writing the next pagevoidwriteInteger(int v) Methods inherited from class org.apache.parquet.column.values.ValuesWriter
resetDictionary, toDictPageAndClose, writeBoolean, writeByte, writeBytes, writeDouble, writeFloat, writeLong
-
Constructor Details
-
BitPackingValuesWriter
public BitPackingValuesWriter(int bound, int initialCapacity, int pageSize, org.apache.parquet.bytes.ByteBufferAllocator allocator) - Parameters:
bound- the maximum value stored by this columninitialCapacity- initial capacity for the writerpageSize- the page sizeallocator- a buffer allocator
-
-
Method Details
-
writeInteger
public void writeInteger(int v) - Overrides:
writeIntegerin classValuesWriter- Parameters:
v- the value to encode- See Also:
-
getBufferedSize
public long getBufferedSize()used to decide if we want to work to the next page- Specified by:
getBufferedSizein classValuesWriter- Returns:
- the size of the currently buffered data (in bytes)
- See Also:
-
getBytes
public org.apache.parquet.bytes.BytesInput getBytes()- Specified by:
getBytesin classValuesWriter- Returns:
- the bytes buffered so far to write to the current page
- See Also:
-
reset
public void reset()called after getBytes() to reset the current buffer and start writing the next page- Specified by:
resetin classValuesWriter- See Also:
-
close
public void close()Description copied from class:ValuesWriterCalled to close the values writer. Any output stream is closed and can no longer be used. All resources are released.- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classValuesWriter
-
getAllocatedSize
public long getAllocatedSize()- Specified by:
getAllocatedSizein classValuesWriter- Returns:
- the allocated size of the buffer
- See Also:
-
memUsageString
- Specified by:
memUsageStringin classValuesWriter
-
getEncoding
Description copied from class:ValuesWritercalled after getBytes() and before reset()- Specified by:
getEncodingin classValuesWriter- Returns:
- the encoding that was used to encode the bytes
-