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 byte
VERSION
-
Constructor Summary
Constructors Constructor Description EncodedStringDictionaryWriter(DictionaryWriter<byte[]> delegate, StringEncodingStrategy encodingStrategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
get(int dictId)
int
getCardinality()
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.boolean
isSorted()
void
open()
void
write(String objectToWrite)
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
-
-
Constructor Detail
-
EncodedStringDictionaryWriter
public EncodedStringDictionaryWriter(DictionaryWriter<byte[]> delegate, StringEncodingStrategy encodingStrategy)
-
-
Method Detail
-
isSorted
public boolean isSorted()
- Specified by:
isSorted
in interfaceDictionaryWriter<String>
-
open
public void open() throws IOException
- Specified by:
open
in interfaceDictionaryWriter<String>
- Throws:
IOException
-
write
public void write(@Nullable String objectToWrite) throws IOException
- Specified by:
write
in interfaceDictionaryWriter<String>
- Throws:
IOException
-
get
@Nullable public String get(int dictId) throws IOException
- Specified by:
get
in interfaceDictionaryWriter<String>
- Throws:
IOException
-
getCardinality
public int getCardinality()
- Specified by:
getCardinality
in interfaceDictionaryWriter<String>
-
getSerializedSize
public long getSerializedSize() throws IOException
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
- Throws:
IOException
-
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
-
-