Class BitPackingValuesWriter
- java.lang.Object
-
- org.apache.parquet.column.values.ValuesWriter
-
- org.apache.parquet.column.values.bitpacking.BitPackingValuesWriter
-
public class BitPackingValuesWriter extends ValuesWriter
a column writer that packs the ints in the number of bits required based on the maximum size.
-
-
Constructor Summary
Constructors Constructor Description BitPackingValuesWriter(int bound, int initialCapacity, int pageSize, org.apache.parquet.bytes.ByteBufferAllocator allocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Called to close the values writer.long
getAllocatedSize()
long
getBufferedSize()
used to decide if we want to work to the next pageorg.apache.parquet.bytes.BytesInput
getBytes()
Encoding
getEncoding()
called after getBytes() and before reset()String
memUsageString(String prefix)
void
reset()
called after getBytes() to reset the current buffer and start writing the next pagevoid
writeInteger(int v)
-
Methods inherited from class org.apache.parquet.column.values.ValuesWriter
resetDictionary, toDictPageAndClose, writeBoolean, writeByte, writeBytes, writeDouble, writeFloat, writeLong
-
-
-
-
Constructor Detail
-
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 Detail
-
writeInteger
public void writeInteger(int v)
- Overrides:
writeInteger
in classValuesWriter
- Parameters:
v
- the value to encode- See Also:
ValuesWriter.writeInteger(int)
-
getBufferedSize
public long getBufferedSize()
used to decide if we want to work to the next page- Specified by:
getBufferedSize
in classValuesWriter
- Returns:
- the size of the currently buffered data (in bytes)
- See Also:
ValuesWriter.getBufferedSize()
-
getBytes
public org.apache.parquet.bytes.BytesInput getBytes()
- Specified by:
getBytes
in classValuesWriter
- Returns:
- the bytes buffered so far to write to the current page
- See Also:
ValuesWriter.getBytes()
-
reset
public void reset()
called after getBytes() to reset the current buffer and start writing the next page- Specified by:
reset
in classValuesWriter
- See Also:
ValuesWriter.reset()
-
close
public void close()
Description copied from class:ValuesWriter
Called to close the values writer. Any output stream is closed and can no longer be used. All resources are released.- Overrides:
close
in classValuesWriter
-
getAllocatedSize
public long getAllocatedSize()
- Specified by:
getAllocatedSize
in classValuesWriter
- Returns:
- the allocated size of the buffer
- See Also:
ValuesWriter.getAllocatedSize()
-
memUsageString
public String memUsageString(String prefix)
- Specified by:
memUsageString
in classValuesWriter
-
getEncoding
public Encoding getEncoding()
Description copied from class:ValuesWriter
called after getBytes() and before reset()- Specified by:
getEncoding
in classValuesWriter
- Returns:
- the encoding that was used to encode the bytes
-
-