Package org.apache.parquet.column.values
Class ValuesWriter
java.lang.Object
org.apache.parquet.column.values.ValuesWriter
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
BitPackingValuesWriter,BooleanPlainValuesWriter,ByteBitPackingValuesWriter,ByteStreamSplitValuesWriter,DeltaBinaryPackingValuesWriter,DeltaByteArrayWriter,DeltaLengthByteArrayValuesWriter,DevNullValuesWriter,DictionaryValuesWriter,FallbackValuesWriter,FixedLenByteArrayPlainValuesWriter,PlainValuesWriter,RunLengthBitPackingHybridValuesWriter
base class to implement an encoding for a given column
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Called to close the values writer.abstract long( >getBufferedSize())abstract longused to decide if we want to work to the next pageabstract org.apache.parquet.bytes.BytesInputgetBytes()abstract Encodingcalled after getBytes() and before reset()abstract StringmemUsageString(String prefix) abstract voidreset()called after getBytes() to reset the current buffer and start writing the next pagevoidreset the dictionary when a new block startsReturns the dictionary generated by this writer if one was created.voidwriteBoolean(boolean v) voidwriteByte(int value) voidwriteBytes(Binary v) voidwriteDouble(double v) voidwriteFloat(float v) voidwriteInteger(int v) voidwriteLong(long v)
-
Constructor Details
-
ValuesWriter
public ValuesWriter()
-
-
Method Details
-
getBufferedSize
public abstract long getBufferedSize()used to decide if we want to work to the next page- Returns:
- the size of the currently buffered data (in bytes)
-
getBytes
public abstract org.apache.parquet.bytes.BytesInput getBytes()- Returns:
- the bytes buffered so far to write to the current page
-
getEncoding
called after getBytes() and before reset()- Returns:
- the encoding that was used to encode the bytes
-
reset
public abstract void reset()called after getBytes() to reset the current buffer and start writing the next page -
close
public void close()Called to close the values writer. Any output stream is closed and can no longer be used. All resources are released.- Specified by:
closein interfaceAutoCloseable
-
toDictPageAndClose
Returns the dictionary generated by this writer if one was created. As part of this operation the dictionary is closed and will not have any new values written into it.- Returns:
- the dictionary page or null if not dictionary based
-
resetDictionary
public void resetDictionary()reset the dictionary when a new block starts -
getAllocatedSize
public abstract long getAllocatedSize()( >getBufferedSize())- Returns:
- the allocated size of the buffer
-
writeByte
public void writeByte(int value) - Parameters:
value- the value to encode
-
writeBoolean
public void writeBoolean(boolean v) - Parameters:
v- the value to encode
-
writeBytes
- Parameters:
v- the value to encode
-
writeInteger
public void writeInteger(int v) - Parameters:
v- the value to encode
-
writeLong
public void writeLong(long v) - Parameters:
v- the value to encode
-
writeDouble
public void writeDouble(double v) - Parameters:
v- the value to encode
-
writeFloat
public void writeFloat(float v) - Parameters:
v- the value to encode
-
memUsageString
-