Class FallbackValuesWriter<I extends ValuesWriter & RequiresFallback,F extends ValuesWriter>
- java.lang.Object
-
- org.apache.parquet.column.values.ValuesWriter
-
- org.apache.parquet.column.values.fallback.FallbackValuesWriter<I,F>
-
public class FallbackValuesWriter<I extends ValuesWriter & RequiresFallback,F extends ValuesWriter> extends ValuesWriter
-
-
Field Summary
Fields Modifier and Type Field Description FfallBackWriterfallbackIinitialWriterwriter to start with
-
Constructor Summary
Constructors Constructor Description FallbackValuesWriter(I initialWriter, F fallBackWriter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Called to close the values writer.longgetAllocatedSize()longgetBufferedSize()used to decide if we want to work to the next pageorg.apache.parquet.bytes.BytesInputgetBytes()EncodinggetEncoding()called after getBytes() and before reset()StringmemUsageString(String prefix)static <I extends ValuesWriter & RequiresFallback,F extends ValuesWriter>
FallbackValuesWriter<I,F>of(I initialWriter, F fallBackWriter)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.voidwriteByte(int value)voidwriteBytes(Binary v)voidwriteDouble(double v)voidwriteFloat(float v)voidwriteInteger(int v)voidwriteLong(long v)-
Methods inherited from class org.apache.parquet.column.values.ValuesWriter
writeBoolean
-
-
-
-
Field Detail
-
initialWriter
public final I extends ValuesWriter & RequiresFallback initialWriter
writer to start with
-
fallBackWriter
public final F extends ValuesWriter fallBackWriter
fallback
-
-
Method Detail
-
of
public static <I extends ValuesWriter & RequiresFallback,F extends ValuesWriter> FallbackValuesWriter<I,F> of(I initialWriter, F fallBackWriter)
-
getBufferedSize
public long getBufferedSize()
Description copied from class:ValuesWriterused 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)
-
getBytes
public org.apache.parquet.bytes.BytesInput getBytes()
- Specified by:
getBytesin classValuesWriter- Returns:
- the bytes buffered so far to write to the current page
-
getEncoding
public Encoding 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
-
reset
public void reset()
Description copied from class:ValuesWritercalled after getBytes() to reset the current buffer and start writing the next page- Specified by:
resetin classValuesWriter
-
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.- Overrides:
closein classValuesWriter
-
toDictPageAndClose
public DictionaryPage toDictPageAndClose()
Description copied from class:ValuesWriterReturns 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.- Overrides:
toDictPageAndClosein classValuesWriter- Returns:
- the dictionary page or null if not dictionary based
-
resetDictionary
public void resetDictionary()
Description copied from class:ValuesWriterreset the dictionary when a new block starts- Overrides:
resetDictionaryin classValuesWriter
-
getAllocatedSize
public long getAllocatedSize()
Description copied from class:ValuesWriter- Specified by:
getAllocatedSizein classValuesWriter- Returns:
- the allocated size of the buffer
-
memUsageString
public String memUsageString(String prefix)
- Specified by:
memUsageStringin classValuesWriter
-
writeByte
public void writeByte(int value)
- Overrides:
writeBytein classValuesWriter- Parameters:
value- the value to encode
-
writeBytes
public void writeBytes(Binary v)
- Overrides:
writeBytesin classValuesWriter- Parameters:
v- the value to encode
-
writeInteger
public void writeInteger(int v)
- Overrides:
writeIntegerin classValuesWriter- Parameters:
v- the value to encode
-
writeLong
public void writeLong(long v)
- Overrides:
writeLongin classValuesWriter- Parameters:
v- the value to encode
-
writeFloat
public void writeFloat(float v)
- Overrides:
writeFloatin classValuesWriter- Parameters:
v- the value to encode
-
writeDouble
public void writeDouble(double v)
- Overrides:
writeDoublein classValuesWriter- Parameters:
v- the value to encode
-
-