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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVariantColumnSerializer.InternalSerializerInternal serializer used to serialize aVariantColumn.
-
Field Summary
-
Fields inherited from class org.apache.druid.segment.nested.NestedCommonFormatColumnSerializer
NESTED_FIELD_PREFIX, RAW_FILE_NAME, V0
-
-
Constructor Summary
Constructors Constructor Description VariantColumnSerializer(String name, ColumnType logicalType, Byte variantTypeSetByte, IndexSpec indexSpec, SegmentWriteOutMedium segmentWriteOutMedium, Closer closer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetColumnName()DictionaryIdLookupgetDictionaryIdLookup()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(File segmentBaseDir)voidserialize(ColumnValueSelector<? extends StructuredData> selector)voidserializeDictionaries(Iterable<String> strings, Iterable<Long> longs, Iterable<Double> doubles, Iterable<int[]> arrays)voidsetDictionaryIdLookup(DictionaryIdLookup dictionaryIdLookup)voidwriteTo(WritableByteChannel channel, FileSmoosher smoosher)Writes the serialized form of this object.-
Methods inherited from class org.apache.druid.segment.nested.NestedCommonFormatColumnSerializer
computeFilenameBytes, copyFromTempSmoosh, serializeFields, writeInternal, writeV0Header
-
-
-
-
Constructor Detail
-
VariantColumnSerializer
public VariantColumnSerializer(String name, @Nullable ColumnType logicalType, @Nullable Byte variantTypeSetByte, IndexSpec indexSpec, SegmentWriteOutMedium segmentWriteOutMedium, Closer closer)
-
-
Method Detail
-
getColumnName
public String getColumnName()
- Specified by:
getColumnNamein classNestedCommonFormatColumnSerializer
-
getDictionaryIdLookup
public DictionaryIdLookup getDictionaryIdLookup()
- Specified by:
getDictionaryIdLookupin classNestedCommonFormatColumnSerializer
-
setDictionaryIdLookup
public void setDictionaryIdLookup(DictionaryIdLookup dictionaryIdLookup)
- Specified by:
setDictionaryIdLookupin classNestedCommonFormatColumnSerializer
-
hasNulls
public boolean hasNulls()
- Specified by:
hasNullsin classNestedCommonFormatColumnSerializer
-
openDictionaryWriter
public void openDictionaryWriter(File segmentBaseDir) 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() 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.- Throws:
IOException
-
writeTo
public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException
Description copied from interface:SerializerWrites the serialized form of this object. The entire object may be written to the provided channel, or the object may be split over the provided channel and files added to the {@link FileSmoosher], where additional channels can be created viaFileSmoosher.addWithSmooshedWriter(String, long). The latter approach is useful when the serialized form of the object is too large for a single smoosh container. At the time this javadoc was written, the max smoosh container size is limit to the maxByteBuffersize.- Throws:
IOException
-
-