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 Tget(int index)intgetCardinality()Iterator<T>getIterator()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(T objectToWrite)voidwriteTo(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:
isSortedin interfaceDictionaryWriter<T>
-
open
public void open() throws IOException- Specified by:
openin interfaceDictionaryWriter<T>- Throws:
IOException
-
getCardinality
public int getCardinality()
- Specified by:
getCardinalityin interfaceDictionaryWriter<T>
-
getSerializedSize
public long getSerializedSize()
Description 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
-
write
public void write(@Nullable T objectToWrite) throws IOException
- Specified by:
writein interfaceDictionaryWriter<T>- 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
-
get
@Nullable public T get(int index) throws IOException
- Specified by:
getin interfaceDictionaryWriter<T>- Throws:
IOException
-
-