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>
All Implemented Interfaces:
AutoCloseable

public class FallbackValuesWriter<I extends ValuesWriter & RequiresFallback,F extends ValuesWriter> extends ValuesWriter
  • Field Details

  • Constructor Details

    • FallbackValuesWriter

      public FallbackValuesWriter(I initialWriter, F fallBackWriter)
  • Method Details

    • 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: ValuesWriter
      used to decide if we want to work to the next page
      Specified by:
      getBufferedSize in class ValuesWriter
      Returns:
      the size of the currently buffered data (in bytes)
    • getBytes

      public org.apache.parquet.bytes.BytesInput getBytes()
      Specified by:
      getBytes in class ValuesWriter
      Returns:
      the bytes buffered so far to write to the current page
    • getEncoding

      public Encoding getEncoding()
      Description copied from class: ValuesWriter
      called after getBytes() and before reset()
      Specified by:
      getEncoding in class ValuesWriter
      Returns:
      the encoding that was used to encode the bytes
    • reset

      public void reset()
      Description copied from class: ValuesWriter
      called after getBytes() to reset the current buffer and start writing the next page
      Specified by:
      reset in class ValuesWriter
    • 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.
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class ValuesWriter
    • toDictPageAndClose

      public DictionaryPage toDictPageAndClose()
      Description copied from class: ValuesWriter
      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.
      Overrides:
      toDictPageAndClose in class ValuesWriter
      Returns:
      the dictionary page or null if not dictionary based
    • resetDictionary

      public void resetDictionary()
      Description copied from class: ValuesWriter
      reset the dictionary when a new block starts
      Overrides:
      resetDictionary in class ValuesWriter
    • getAllocatedSize

      public long getAllocatedSize()
      Description copied from class: ValuesWriter
      Specified by:
      getAllocatedSize in class ValuesWriter
      Returns:
      the allocated size of the buffer
    • memUsageString

      public String memUsageString(String prefix)
      Specified by:
      memUsageString in class ValuesWriter
    • writeByte

      public void writeByte(int value)
      Overrides:
      writeByte in class ValuesWriter
      Parameters:
      value - the value to encode
    • writeBytes

      public void writeBytes(Binary v)
      Overrides:
      writeBytes in class ValuesWriter
      Parameters:
      v - the value to encode
    • writeInteger

      public void writeInteger(int v)
      Overrides:
      writeInteger in class ValuesWriter
      Parameters:
      v - the value to encode
    • writeLong

      public void writeLong(long v)
      Overrides:
      writeLong in class ValuesWriter
      Parameters:
      v - the value to encode
    • writeFloat

      public void writeFloat(float v)
      Overrides:
      writeFloat in class ValuesWriter
      Parameters:
      v - the value to encode
    • writeDouble

      public void writeDouble(double v)
      Overrides:
      writeDouble in class ValuesWriter
      Parameters:
      v - the value to encode