Package org.apache.druid.segment.data
Class EncodedStringDictionaryWriter
- java.lang.Object
-
- org.apache.druid.segment.data.EncodedStringDictionaryWriter
-
- All Implemented Interfaces:
DictionaryWriter<String>,Serializer
public class EncodedStringDictionaryWriter extends Object implements DictionaryWriter<String>
-
-
Field Summary
Fields Modifier and Type Field Description static byteVERSION
-
Constructor Summary
Constructors Constructor Description EncodedStringDictionaryWriter(DictionaryWriter<byte[]> delegate, StringEncodingStrategy encodingStrategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringget(int dictId)intgetCardinality()longgetSerializedSize()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.booleanisSorted()voidopen()voidwrite(String objectToWrite)voidwriteTo(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
-
-
Constructor Detail
-
EncodedStringDictionaryWriter
public EncodedStringDictionaryWriter(DictionaryWriter<byte[]> delegate, StringEncodingStrategy encodingStrategy)
-
-
Method Detail
-
isSorted
public boolean isSorted()
- Specified by:
isSortedin interfaceDictionaryWriter<String>
-
open
public void open() throws IOException- Specified by:
openin interfaceDictionaryWriter<String>- Throws:
IOException
-
write
public void write(@Nullable String objectToWrite) throws IOException
- Specified by:
writein interfaceDictionaryWriter<String>- Throws:
IOException
-
get
@Nullable public String get(int dictId) throws IOException
- Specified by:
getin interfaceDictionaryWriter<String>- Throws:
IOException
-
getCardinality
public int getCardinality()
- Specified by:
getCardinalityin interfaceDictionaryWriter<String>
-
getSerializedSize
public long getSerializedSize() throws IOExceptionDescription copied from interface:SerializerReturns 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:
getSerializedSizein interfaceSerializer- Throws:
IOException
-
writeTo
public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException
Description copied from interface:SerializerWrites 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:
writeToin interfaceSerializer- Throws:
IOException
-
-