Package org.apache.druid.segment.nested
Class NestedCommonFormatColumnSerializer
- java.lang.Object
-
- org.apache.druid.segment.nested.NestedCommonFormatColumnSerializer
-
- All Implemented Interfaces:
GenericColumnSerializer<StructuredData>,Serializer
- Direct Known Subclasses:
NestedDataColumnSerializer,ScalarNestedCommonFormatColumnSerializer,VariantColumnSerializer
public abstract class NestedCommonFormatColumnSerializer extends Object implements GenericColumnSerializer<StructuredData>
Basic serializer implementation for theNestedCommonFormatColumnfamily of columns. TheAutoTypeColumnIndexercatalogs the types and fields present in the data it processes using aStructuredDataProcessor. When persisting and merging segments, theAutoTypeColumnMergerwill choose the most appropriate serializer based on the data which was processed as follows:
-
-
Field Summary
Fields Modifier and Type Field Description static StringNESTED_FIELD_PREFIXstatic StringRAW_FILE_NAMEstatic byteV0
-
Constructor Summary
Constructors Constructor Description NestedCommonFormatColumnSerializer()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ByteBuffercomputeFilenameBytes()protected static voidcopyFromTempSmoosh(FileSmoosher smoosher, SmooshedFileMapper fileMapper)abstract StringgetColumnName()abstract DictionaryIdLookupgetDictionaryIdLookup()abstract booleanhasNulls()abstract voidopenDictionaryWriter(File segmentBaseDir)abstract voidserializeDictionaries(Iterable<String> strings, Iterable<Long> longs, Iterable<Double> doubles, Iterable<int[]> arrays)voidserializeFields(SortedMap<String,FieldTypeInfo.MutableTypeSet> fields)abstract voidsetDictionaryIdLookup(DictionaryIdLookup dictionaryIdLookup)protected voidwriteInternal(FileSmoosher smoosher, Serializer serializer, String fileName)static voidwriteV0Header(WritableByteChannel channel, ByteBuffer columnNameBuffer)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.segment.GenericColumnSerializer
open, serialize
-
Methods inherited from interface org.apache.druid.segment.serde.Serializer
getSerializedSize, writeTo
-
-
-
-
Field Detail
-
V0
public static final byte V0
- See Also:
- Constant Field Values
-
RAW_FILE_NAME
public static final String RAW_FILE_NAME
- See Also:
- Constant Field Values
-
NESTED_FIELD_PREFIX
public static final String NESTED_FIELD_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
openDictionaryWriter
public abstract void openDictionaryWriter(File segmentBaseDir) throws IOException
- Throws:
IOException
-
serializeFields
public void serializeFields(SortedMap<String,FieldTypeInfo.MutableTypeSet> fields) throws IOException
- Throws:
IOException
-
serializeDictionaries
public abstract void serializeDictionaries(Iterable<String> strings, Iterable<Long> longs, Iterable<Double> doubles, Iterable<int[]> arrays) throws IOException
- Throws:
IOException
-
getColumnName
public abstract String getColumnName()
-
getDictionaryIdLookup
public abstract DictionaryIdLookup getDictionaryIdLookup()
-
setDictionaryIdLookup
public abstract void setDictionaryIdLookup(DictionaryIdLookup dictionaryIdLookup)
-
hasNulls
public abstract boolean hasNulls()
-
writeInternal
protected void writeInternal(FileSmoosher smoosher, Serializer serializer, String fileName) throws IOException
- Throws:
IOException
-
copyFromTempSmoosh
protected static void copyFromTempSmoosh(FileSmoosher smoosher, SmooshedFileMapper fileMapper) throws IOException
- Throws:
IOException
-
writeV0Header
public static void writeV0Header(WritableByteChannel channel, ByteBuffer columnNameBuffer) throws IOException
- Throws:
IOException
-
computeFilenameBytes
protected ByteBuffer computeFilenameBytes()
-
-