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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanCompare()WhetherComparator.compare(T, T)is valid or not.intcompare(ResourceHolder<ByteBuffer> o1, ResourceHolder<ByteBuffer> o2)ResourceHolder<ByteBuffer>fromByteBuffer(ByteBuffer buffer, int numBytes)Convert values from their underlying byte representation.Class<ResourceHolder<ByteBuffer>>getClazz()static DecompressingByteBufferObjectStrategyof(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, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface org.apache.druid.segment.data.ObjectStrategy
fromByteBufferSafe, fromByteBufferWithSize, readRetainsBufferReference, writeTo
-
-
-
-
Method Detail
-
of
public static DecompressingByteBufferObjectStrategy of(ByteOrder order, CompressionStrategy compression)
-
getClazz
public Class<ResourceHolder<ByteBuffer>> getClazz()
- Specified by:
getClazzin interfaceObjectStrategy<ResourceHolder<ByteBuffer>>
-
fromByteBuffer
public ResourceHolder<ByteBuffer> fromByteBuffer(ByteBuffer buffer, int numBytes)
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
public int compare(ResourceHolder<ByteBuffer> o1, ResourceHolder<ByteBuffer> o2)
- Specified by:
comparein interfaceComparator<ResourceHolder<ByteBuffer>>
-
toBytes
public byte[] toBytes(ResourceHolder<ByteBuffer> holder)
- Specified by:
toBytesin interfaceObjectStrategy<ResourceHolder<ByteBuffer>>
-
-