Interface RequiresFallback

All Known Implementing Classes:
DictionaryValuesWriter, DictionaryValuesWriter.PlainBinaryDictionaryValuesWriter, DictionaryValuesWriter.PlainDoubleDictionaryValuesWriter, DictionaryValuesWriter.PlainFixedLenArrayDictionaryValuesWriter, DictionaryValuesWriter.PlainFloatDictionaryValuesWriter, DictionaryValuesWriter.PlainIntegerDictionaryValuesWriter, DictionaryValuesWriter.PlainLongDictionaryValuesWriter

public interface RequiresFallback
Used to add extra behavior to a ValuesWriter that requires fallback
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    When falling back to a different encoding we must re-encode all the values seen so far
    boolean
    isCompressionSatisfying(long rawSize, long encodedSize)
    Before writing the first page we will verify if the encoding is worth it.
    boolean
    In the case of a dictionary based encoding we will fallback if the dictionary becomes too big
  • Method Details

    • shouldFallBack

      boolean shouldFallBack()
      In the case of a dictionary based encoding we will fallback if the dictionary becomes too big
      Returns:
      true to notify the parent that we should fallback to another encoding
    • isCompressionSatisfying

      boolean isCompressionSatisfying(long rawSize, long encodedSize)
      Before writing the first page we will verify if the encoding is worth it. and fall back if a simpler encoding would be better in that case
      Parameters:
      rawSize - the size if encoded with plain
      encodedSize - the size as encoded by the current encoding
      Returns:
      true if we keep this encoding
    • fallBackAllValuesTo

      void fallBackAllValuesTo(ValuesWriter writer)
      When falling back to a different encoding we must re-encode all the values seen so far
      Parameters:
      writer - the new encoder to write the current values to