Package org.apache.druid.segment.nested
Class VariantColumnSerializer
- java.lang.Object
-
- org.apache.druid.segment.nested.NestedCommonFormatColumnSerializer
-
- org.apache.druid.segment.nested.VariantColumnSerializer
-
- All Implemented Interfaces:
GenericColumnSerializer<StructuredData>,Serializer
public class VariantColumnSerializer extends NestedCommonFormatColumnSerializer
Serializer for aNestedCommonFormatColumnfor single type arrays and mixed type columns, but not columns with nested data. IfvariantTypeSetByteis set then the column has mixed types, which is added to the base metadata stored in the column file.
-
-
Field Summary
-
Fields inherited from class org.apache.druid.segment.nested.NestedCommonFormatColumnSerializer
ARRAY_DICTIONARY_FILE_NAME, ARRAY_ELEMENT_BITMAP_INDEX_FILE_NAME, ARRAY_ELEMENT_DICTIONARY_FILE_NAME, BITMAP_INDEX_FILE_NAME, DOUBLE_DICTIONARY_FILE_NAME, DOUBLE_VALUE_COLUMN_FILE_NAME, ENCODED_VALUE_COLUMN_FILE_NAME, LONG_DICTIONARY_FILE_NAME, LONG_VALUE_COLUMN_FILE_NAME, NESTED_FIELD_PREFIX, NULL_BITMAP_FILE_NAME, RAW_FILE_NAME, STRING_DICTIONARY_FILE_NAME, V0
-
-
Constructor Summary
Constructors Constructor Description VariantColumnSerializer(String name, Byte variantTypeSetByte, IndexSpec indexSpec, SegmentWriteOutMedium segmentWriteOutMedium, Closer closer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetColumnName()DictionaryIdLookupgetGlobalLookup()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.booleanhasNulls()voidopen()voidopenDictionaryWriter()voidserialize(ColumnValueSelector<? extends StructuredData> selector)voidserializeDictionaries(Iterable<String> strings, Iterable<Long> longs, Iterable<Double> doubles, Iterable<int[]> arrays)voidwriteTo(WritableByteChannel channel, FileSmoosher smoosher)Writes serialized form of this object to the given channel.-
Methods inherited from class org.apache.druid.segment.nested.NestedCommonFormatColumnSerializer
computeFilenameBytes, getInternalFileName, serializeFields, writeInternal, writeInternal, writeV0Header
-
-
-
-
Method Detail
-
getColumnName
public String getColumnName()
- Specified by:
getColumnNamein classNestedCommonFormatColumnSerializer
-
getGlobalLookup
public DictionaryIdLookup getGlobalLookup()
- Specified by:
getGlobalLookupin classNestedCommonFormatColumnSerializer
-
hasNulls
public boolean hasNulls()
- Specified by:
hasNullsin classNestedCommonFormatColumnSerializer
-
openDictionaryWriter
public void openDictionaryWriter() throws IOException- Specified by:
openDictionaryWriterin classNestedCommonFormatColumnSerializer- Throws:
IOException
-
open
public void open() throws IOException- Throws:
IOException
-
serializeDictionaries
public void serializeDictionaries(Iterable<String> strings, Iterable<Long> longs, Iterable<Double> doubles, Iterable<int[]> arrays) throws IOException
- Specified by:
serializeDictionariesin classNestedCommonFormatColumnSerializer- Throws:
IOException
-
serialize
public void serialize(ColumnValueSelector<? extends StructuredData> selector) throws IOException
- Throws:
IOException
-
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.
-
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.- Throws:
IOException
-
-