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 int
compareByteArraysUnsigned(byte[] array1, int position1, int length1, byte[] array2, int position2, int length2)
Compares two byte arrays using unsigned byte ordering.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, long length1, org.apache.datasketches.memory.Memory memory2, long position2, long 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 ByteBuffer
readByteBuffer(org.apache.datasketches.memory.Memory memory, long dataStart, int dataLength)
Returns a ByteBuffer containing data from the providedMemory
.
-
-
-
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 theMemory
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, 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 suppliedMemoryRange
to 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, long length1, org.apache.datasketches.memory.Memory memory2, long position2, long 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.
-
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.
-
-