public class FrontCodedIntArrayIndexedWriter extends Object implements DictionaryWriter<int[]>
| Modifier and Type | Field and Description |
|---|---|
static Comparator<int[]> |
ARRAY_COMPARATOR |
| Constructor and Description |
|---|
FrontCodedIntArrayIndexedWriter(SegmentWriteOutMedium segmentWriteOutMedium,
ByteOrder byteOrder,
int bucketSize) |
| Modifier and Type | Method and Description |
|---|---|
int[] |
get(int index) |
int |
getCardinality() |
long |
getSerializedSize()
Returns the number of bytes, that this Serializer will write to the output _channel_ (not smoosher) on a
Serializer.writeTo(java.nio.channels.WritableByteChannel, org.apache.druid.java.util.common.io.smoosh.FileSmoosher) call. |
boolean |
isSorted() |
void |
open() |
void |
write(int[] value) |
static int |
writeBucket(ByteBuffer buffer,
int[][] values,
int numValues)
Write bucket of values to a
ByteBuffer. |
void |
writeTo(WritableByteChannel channel,
FileSmoosher smoosher)
Writes serialized form of this object to the given channel.
|
static int |
writeValue(ByteBuffer buffer,
int[] ints)
Write a variable length int[] value to a
ByteBuffer, storing the length as a VByte encoded
integer followed by the value itself. |
public static final Comparator<int[]> ARRAY_COMPARATOR
public FrontCodedIntArrayIndexedWriter(SegmentWriteOutMedium segmentWriteOutMedium, ByteOrder byteOrder, int bucketSize)
public void open()
throws IOException
open in interface DictionaryWriter<int[]>IOExceptionpublic void write(@Nullable int[] value) throws IOException
write in interface DictionaryWriter<int[]>IOExceptionpublic long getSerializedSize()
throws IOException
SerializerSerializer.writeTo(java.nio.channels.WritableByteChannel, org.apache.druid.java.util.common.io.smoosh.FileSmoosher) call.getSerializedSize in interface SerializerIOExceptionpublic void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException
SerializerwriteTo in interface SerializerIOExceptionpublic boolean isSorted()
isSorted in interface DictionaryWriter<int[]>@Nullable public int[] get(int index) throws IOException
get in interface DictionaryWriter<int[]>IOExceptionpublic int getCardinality()
getCardinality in interface DictionaryWriter<int[]>public static int writeBucket(ByteBuffer buffer, int[][] values, int numValues)
ByteBuffer. The first value is written completely, subsequent values are
written with an integer to indicate how much of the first value in the bucket is a prefix of the value, followed
by the remaining bytes of the value.
Uses VByte encoded integers to indicate prefix length and value length.public static int writeValue(ByteBuffer buffer, int[] ints)
ByteBuffer, storing the length as a VByte encoded
integer followed by the value itself. Returns the number of bytes written to the buffer. This method returns a
negative value if there is no room available in the buffer, so that it can be grown if needed.Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.