public class GenericIndexedWriter<T> extends Object implements DictionaryWriter<T>
GenericIndexed
The version EncodedStringDictionaryWriter.VERSION is reserved and must never be specified as the
GenericIndexed version byte, else it will interfere with string column deserialization.| Constructor and Description |
|---|
GenericIndexedWriter(SegmentWriteOutMedium segmentWriteOutMedium,
String filenameBase,
ObjectStrategy<T> strategy) |
GenericIndexedWriter(SegmentWriteOutMedium segmentWriteOutMedium,
String filenameBase,
ObjectStrategy<T> strategy,
int fileSizeLimit) |
| Modifier and Type | Method and Description |
|---|---|
static ObjectStrategy<ByteBuffer> |
compressedByteBuffersWriteObjectStrategy(CompressionStrategy compressionStrategy,
int bufferSize,
Closer closer) |
static String |
generateHeaderFileName(String fileNameBase) |
static String |
generateValueFileName(String fileNameBase,
int fileNum) |
T |
get(int index) |
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() |
static GenericIndexedWriter<ByteBuffer> |
ofCompressedByteBuffers(SegmentWriteOutMedium segmentWriteOutMedium,
String filenameBase,
CompressionStrategy compressionStrategy,
int bufferSize) |
void |
open() |
void |
setObjectsNotSorted() |
void |
write(T objectToWrite) |
void |
writeTo(WritableByteChannel channel,
FileSmoosher smoosher)
Writes serialized form of this object to the given channel.
|
public GenericIndexedWriter(SegmentWriteOutMedium segmentWriteOutMedium, String filenameBase, ObjectStrategy<T> strategy)
public GenericIndexedWriter(SegmentWriteOutMedium segmentWriteOutMedium, String filenameBase, ObjectStrategy<T> strategy, int fileSizeLimit)
public static GenericIndexedWriter<ByteBuffer> ofCompressedByteBuffers(SegmentWriteOutMedium segmentWriteOutMedium, String filenameBase, CompressionStrategy compressionStrategy, int bufferSize)
public static ObjectStrategy<ByteBuffer> compressedByteBuffersWriteObjectStrategy(CompressionStrategy compressionStrategy, int bufferSize, Closer closer)
public void open()
throws IOException
open in interface DictionaryWriter<T>IOExceptionpublic void setObjectsNotSorted()
public boolean isSorted()
isSorted in interface DictionaryWriter<T>public void write(@Nullable T objectToWrite) throws IOException
write in interface DictionaryWriter<T>IOException@Nullable public T get(int index) throws IOException
get in interface DictionaryWriter<T>IOExceptionpublic long getSerializedSize()
SerializerSerializer.writeTo(java.nio.channels.WritableByteChannel, org.apache.druid.java.util.common.io.smoosh.FileSmoosher) call.getSerializedSize in interface Serializerpublic void writeTo(WritableByteChannel channel, @Nullable FileSmoosher smoosher) throws IOException
SerializerwriteTo in interface SerializerIOExceptionCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.