Package org.apache.druid.segment.data
Class V3CompressedVSizeColumnarMultiIntsSupplier
- java.lang.Object
-
- org.apache.druid.segment.data.V3CompressedVSizeColumnarMultiIntsSupplier
-
- All Implemented Interfaces:
com.google.common.base.Supplier<ColumnarMultiInts>
,Supplier<ColumnarMultiInts>
,WritableSupplier<ColumnarMultiInts>
,Serializer
public class V3CompressedVSizeColumnarMultiIntsSupplier extends Object implements WritableSupplier<ColumnarMultiInts>
The format is mostly the same withCompressedVSizeColumnarMultiIntsSupplier
(which has version 0x2, so we call it V2), the only difference is V3's offsets is not VSize encoded, it's just compressed. The reason we provide this is we can streams the data out in the binary format withV3CompressedVSizeColumnarMultiIntsSerializer
. If we want to streams VSizeInts, we must know the max value in the value sets. It's easy to know the max id of values(like dimension cardinality while encoding dimension), but difficult to known the max id of offsets.
-
-
Field Summary
Fields Modifier and Type Field Description static byte
VERSION
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static V3CompressedVSizeColumnarMultiIntsSupplier
fromByteBuffer(ByteBuffer buffer, ByteOrder order)
static V3CompressedVSizeColumnarMultiIntsSupplier
fromByteBuffer(ByteBuffer buffer, ByteOrder order, SmooshedFileMapper mapper)
static V3CompressedVSizeColumnarMultiIntsSupplier
fromIterable(Iterable<IndexedInts> objectsIterable, int offsetChunkFactor, int maxValue, ByteOrder byteOrder, CompressionStrategy compression, Closer closer)
ColumnarMultiInts
get()
long
getSerializedSize()
Returns the number of bytes, that this Serializer will write to the output _channel_ (not smoosher) on aSerializer.writeTo(java.nio.channels.WritableByteChannel, org.apache.druid.java.util.common.io.smoosh.FileSmoosher)
call.void
writeTo(WritableByteChannel channel, FileSmoosher smoosher)
Writes serialized form of this object to the given channel.
-
-
-
Field Detail
-
VERSION
public static final byte VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
fromByteBuffer
public static V3CompressedVSizeColumnarMultiIntsSupplier fromByteBuffer(ByteBuffer buffer, ByteOrder order)
-
fromByteBuffer
public static V3CompressedVSizeColumnarMultiIntsSupplier fromByteBuffer(ByteBuffer buffer, ByteOrder order, SmooshedFileMapper mapper)
-
fromIterable
public static V3CompressedVSizeColumnarMultiIntsSupplier fromIterable(Iterable<IndexedInts> objectsIterable, int offsetChunkFactor, int maxValue, ByteOrder byteOrder, CompressionStrategy compression, Closer closer)
-
getSerializedSize
public long getSerializedSize()
Description copied from interface:Serializer
Returns the number of bytes, that this Serializer will write to the output _channel_ (not smoosher) on aSerializer.writeTo(java.nio.channels.WritableByteChannel, org.apache.druid.java.util.common.io.smoosh.FileSmoosher)
call.- Specified by:
getSerializedSize
in interfaceSerializer
-
writeTo
public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException
Description copied from interface:Serializer
Writes serialized form of this object to the given channel. If parallel data streams are needed, they could be created with the provided smoosher.- Specified by:
writeTo
in interfaceSerializer
- Throws:
IOException
-
get
public ColumnarMultiInts get()
- Specified by:
get
in interfacecom.google.common.base.Supplier<ColumnarMultiInts>
- Specified by:
get
in interfaceSupplier<ColumnarMultiInts>
-
-