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

public abstract class ValuesWriter extends Object implements AutoCloseable
base class to implement an encoding for a given column
  • 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

      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.
      Specified by:
      close in interface AutoCloseable
    • 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()
      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
    • memUsageString

      public abstract String memUsageString(String prefix)