Package org.apache.parquet.column.values
Class ValuesWriter
- java.lang.Object
-
- org.apache.parquet.column.values.ValuesWriter
-
- Direct Known Subclasses:
BitPackingValuesWriter,BooleanPlainValuesWriter,ByteBitPackingValuesWriter,ByteStreamSplitValuesWriter,DeltaBinaryPackingValuesWriter,DeltaByteArrayWriter,DeltaLengthByteArrayValuesWriter,DevNullValuesWriter,DictionaryValuesWriter,FallbackValuesWriter,FixedLenByteArrayPlainValuesWriter,PlainValuesWriter,RunLengthBitPackingHybridValuesWriter
public abstract class ValuesWriter extends Object
base class to implement an encoding for a given column
-
-
Constructor Summary
Constructors Constructor Description ValuesWriter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()Called to close the values writer.abstract longgetAllocatedSize()( >getBufferedSize())abstract longgetBufferedSize()used to decide if we want to work to the next pageabstract org.apache.parquet.bytes.BytesInputgetBytes()abstract EncodinggetEncoding()called after getBytes() and before reset()abstract StringmemUsageString(String prefix)abstract voidreset()called after getBytes() to reset the current buffer and start writing the next pagevoidresetDictionary()reset the dictionary when a new block startsDictionaryPagetoDictPageAndClose()Returns 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)
-
-
-
Method Detail
-
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
public abstract Encoding 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.
-
toDictPageAndClose
public DictionaryPage 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
public void writeBytes(Binary v)
- 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
-
-