Package org.apache.druid.segment.data
Class DecompressingByteBufferObjectStrategy
java.lang.Object
org.apache.druid.segment.data.DecompressingByteBufferObjectStrategy
- All Implemented Interfaces:
Comparator<ResourceHolder<ByteBuffer>>,ObjectStrategy<ResourceHolder<ByteBuffer>>
public class DecompressingByteBufferObjectStrategy
extends Object
implements ObjectStrategy<ResourceHolder<ByteBuffer>>
-
Method Summary
Modifier and TypeMethodDescriptionbooleanWhetherComparator.compare(T, T)is valid or not.intcompare(ResourceHolder<ByteBuffer> o1, ResourceHolder<ByteBuffer> o2) fromByteBuffer(ByteBuffer buffer, int numBytes) Convert values from their underlying byte representation.getClazz()of(ByteOrder order, CompressionStrategy compression) byte[]toBytes(ResourceHolder<ByteBuffer> holder) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods inherited from interface org.apache.druid.segment.data.ObjectStrategy
fromByteBufferSafe, fromByteBufferWithSize, readRetainsBufferReference, writeTo
-
Method Details
-
of
public static DecompressingByteBufferObjectStrategy of(ByteOrder order, CompressionStrategy compression) -
getClazz
- Specified by:
getClazzin interfaceObjectStrategy<ResourceHolder<ByteBuffer>>
-
fromByteBuffer
Description copied from interface:ObjectStrategyConvert values from their underlying byte representation. Implementations of this method may change the given buffer's mark, or limit, and position. Implementations of this method may not store the given buffer in a field of the "deserialized" object, need to useByteBuffer.slice(),ByteBuffer.asReadOnlyBuffer()orByteBuffer.duplicate()in this case.- Specified by:
fromByteBufferin interfaceObjectStrategy<ResourceHolder<ByteBuffer>>- Parameters:
buffer- buffer to read value fromnumBytes- number of bytes used to store the value, starting at buffer.position()- Returns:
- an object created from the given byte buffer representation
-
canCompare
public boolean canCompare()Description copied from interface:ObjectStrategyWhetherComparator.compare(T, T)is valid or not.- Specified by:
canComparein interfaceObjectStrategy<ResourceHolder<ByteBuffer>>
-
compare
- Specified by:
comparein interfaceComparator<ResourceHolder<ByteBuffer>>
-
toBytes
- Specified by:
toBytesin interfaceObjectStrategy<ResourceHolder<ByteBuffer>>
-