Package org.apache.druid.frame.read
Class FrameReaderUtils
- java.lang.Object
-
- org.apache.druid.frame.read.FrameReaderUtils
-
-
Constructor Summary
Constructors Constructor Description FrameReaderUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcompareByteArraysUnsigned(byte[] array1, int position1, int length1, byte[] array2, int position2, int length2)Compares two byte arrays using unsigned byte ordering.static intcompareComplexTypes(byte[] array1, int position1, byte[] array2, int position2, ColumnType columnType, ComplexMetricSerde complexMetricSerde)static intcompareComplexTypes(org.apache.datasketches.memory.Memory memory, long position1, byte[] array, int position2, ColumnType columnType, ComplexMetricSerde complexMetricSerde)static intcompareComplexTypes(org.apache.datasketches.memory.Memory memory1, long position1, org.apache.datasketches.memory.Memory memory2, long position2, ColumnType columnType, ComplexMetricSerde complexMetricSerde)static intcompareMemoryToByteArrayUnsigned(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 intcompareMemoryUnsigned(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, RowSignature expectedSignature)Returns a direct row memory supplier ifmayBeAbleToSelectRowMemory(org.apache.druid.segment.ColumnSelectorFactory), otherwise returns null.static ByteBufferreadByteBuffer(org.apache.datasketches.memory.Memory memory, long dataStart, int dataLength)Returns a ByteBuffer containing data from the providedMemory.static longreadComparableLong(org.apache.datasketches.memory.Memory memory, long position, int length)
-
-
-
Method Detail
-
readByteBuffer
public static ByteBuffer readByteBuffer(org.apache.datasketches.memory.Memory memory, long dataStart, int dataLength)
Returns a ByteBuffer containing data from the providedMemory. 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 theMemoryobject, so it is not OK to write to its contents.
-
makeRowMemorySupplier
@Nullable public static Supplier<MemoryRange<org.apache.datasketches.memory.Memory>> makeRowMemorySupplier(ColumnSelectorFactory columnSelectorFactory, RowSignature expectedSignature)
Returns a direct row memory supplier ifmayBeAbleToSelectRowMemory(org.apache.druid.segment.ColumnSelectorFactory), otherwise returns null. Note that even if the returned supplier is nonnull, it is still possible for the suppliedMemoryRangeto be null. Callers must check for this.- Parameters:
columnSelectorFactory- frame column selector factoryexpectedSignature- 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 fromMemory.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)
-
-