Package org.apache.druid.segment.data
Class FixedIndexedWriter<T>
- java.lang.Object
-
- org.apache.druid.segment.data.FixedIndexedWriter<T>
-
- All Implemented Interfaces:
DictionaryWriter<T>
,Serializer
public class FixedIndexedWriter<T> extends Object implements DictionaryWriter<T>
Writer for aFixedIndexed
-
-
Constructor Summary
Constructors Constructor Description FixedIndexedWriter(SegmentWriteOutMedium segmentWriteOutMedium, TypeStrategy<T> typeStrategy, ByteOrder byteOrder, int width, boolean isSorted)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get(int index)
int
getCardinality()
Iterator<T>
getIterator()
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(T objectToWrite)
void
writeTo(WritableByteChannel channel, FileSmoosher smoosher)
Writes serialized form of this object to the given channel.
-
-
-
Constructor Detail
-
FixedIndexedWriter
public FixedIndexedWriter(SegmentWriteOutMedium segmentWriteOutMedium, TypeStrategy<T> typeStrategy, ByteOrder byteOrder, int width, boolean isSorted)
-
-
Method Detail
-
isSorted
public boolean isSorted()
- Specified by:
isSorted
in interfaceDictionaryWriter<T>
-
open
public void open() throws IOException
- Specified by:
open
in interfaceDictionaryWriter<T>
- Throws:
IOException
-
getCardinality
public int getCardinality()
- Specified by:
getCardinality
in interfaceDictionaryWriter<T>
-
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
-
write
public void write(@Nullable T objectToWrite) throws IOException
- Specified by:
write
in interfaceDictionaryWriter<T>
- 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
-
get
@Nullable public T get(int index) throws IOException
- Specified by:
get
in interfaceDictionaryWriter<T>
- Throws:
IOException
-
-