Class FrameReaderUtils

java.lang.Object
org.apache.druid.frame.read.FrameReaderUtils

public class FrameReaderUtils extends Object
Utility methods used by various entities that read data from Frame objects.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    compareByteArraysUnsigned(byte[] array1, int position1, int length1, byte[] array2, int position2, int length2)
    Compares two byte arrays using unsigned byte ordering.
    static int
    compareComplexTypes(byte[] array1, int position1, byte[] array2, int position2, ColumnType columnType, ComplexMetricSerde complexMetricSerde)
     
    static int
    compareComplexTypes(org.apache.datasketches.memory.Memory memory, long position1, byte[] array, int position2, ColumnType columnType, ComplexMetricSerde complexMetricSerde)
     
    static int
    compareComplexTypes(org.apache.datasketches.memory.Memory memory1, long position1, org.apache.datasketches.memory.Memory memory2, long position2, ColumnType columnType, ComplexMetricSerde complexMetricSerde)
     
    static int
    compareMemoryToByteArrayUnsigned(org.apache.datasketches.memory.Memory memory, long position1, long length1, byte[] array, int position2, int length2)
    Compares Memory with a byte array using unsigned byte ordering.
    static int
    compareMemoryUnsigned(org.apache.datasketches.memory.Memory memory1, long position1, int length1, org.apache.datasketches.memory.Memory memory2, long position2, int length2)
    Compares two Memory ranges using unsigned byte ordering.
    static Supplier<MemoryRange<org.apache.datasketches.memory.Memory>>
    makeRowMemorySupplier(ColumnSelectorFactory columnSelectorFactory, FrameType expectedFrameType, RowSignature expectedSignature)
    Returns a direct row memory supplier if mayBeAbleToSelectRowMemory(org.apache.druid.segment.ColumnSelectorFactory), otherwise returns null.
    static ByteBuffer
    readByteBuffer(org.apache.datasketches.memory.Memory memory, long dataStart, int dataLength)
    Returns a ByteBuffer containing data from the provided Memory.
    static long
    readComparableLong(org.apache.datasketches.memory.Memory memory, long position, int length)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FrameReaderUtils

      public FrameReaderUtils()
  • Method Details

    • readByteBuffer

      public static ByteBuffer readByteBuffer(org.apache.datasketches.memory.Memory memory, long dataStart, int dataLength)
      Returns a ByteBuffer containing data from the provided Memory. The ByteBuffer is always newly created, so it is OK to change its position, limit, etc. However, it may point directly to the backing memory of the Memory object, so it is not OK to write to its contents.
    • makeRowMemorySupplier

      @Nullable public static Supplier<MemoryRange<org.apache.datasketches.memory.Memory>> makeRowMemorySupplier(ColumnSelectorFactory columnSelectorFactory, FrameType expectedFrameType, RowSignature expectedSignature)
      Returns a direct row memory supplier if mayBeAbleToSelectRowMemory(org.apache.druid.segment.ColumnSelectorFactory), otherwise returns null. Note that even if the returned supplier is nonnull, it is still possible for the supplied MemoryRange to be null. Callers must check for this.
      Parameters:
      columnSelectorFactory - frame column selector factory
      expectedFrameType - expected type of the target frame
      expectedSignature - expected signature of the target frame
    • compareMemoryUnsigned

      public static int compareMemoryUnsigned(org.apache.datasketches.memory.Memory memory1, long position1, int length1, org.apache.datasketches.memory.Memory memory2, long position2, int length2)
      Compares two Memory ranges using unsigned byte ordering. Different from Memory.compareTo(long, long, org.apache.datasketches.memory.Memory, long, long), which uses signed ordering.
    • readComparableLong

      public static long readComparableLong(org.apache.datasketches.memory.Memory memory, long position, int length)
    • compareMemoryToByteArrayUnsigned

      public static int compareMemoryToByteArrayUnsigned(org.apache.datasketches.memory.Memory memory, long position1, long length1, byte[] array, int position2, int length2)
      Compares Memory with a byte array using unsigned byte ordering.
    • compareByteArraysUnsigned

      public static int compareByteArraysUnsigned(byte[] array1, int position1, int length1, byte[] array2, int position2, int length2)
      Compares two byte arrays using unsigned byte ordering.
    • compareComplexTypes

      public static int compareComplexTypes(byte[] array1, int position1, byte[] array2, int position2, ColumnType columnType, ComplexMetricSerde complexMetricSerde)
    • compareComplexTypes

      public static int compareComplexTypes(org.apache.datasketches.memory.Memory memory, long position1, byte[] array, int position2, ColumnType columnType, ComplexMetricSerde complexMetricSerde)
    • compareComplexTypes

      public static int compareComplexTypes(org.apache.datasketches.memory.Memory memory1, long position1, org.apache.datasketches.memory.Memory memory2, long position2, ColumnType columnType, ComplexMetricSerde complexMetricSerde)