Package org.apache.druid.segment.nested
Class ScalarStringColumnSerializer
- java.lang.Object
-
- org.apache.druid.segment.nested.NestedCommonFormatColumnSerializer
-
- org.apache.druid.segment.nested.ScalarNestedCommonFormatColumnSerializer<String>
-
- org.apache.druid.segment.nested.ScalarStringColumnSerializer
-
- All Implemented Interfaces:
GenericColumnSerializer<StructuredData>,Serializer
public class ScalarStringColumnSerializer extends ScalarNestedCommonFormatColumnSerializer<String>
Serializer for a stringNestedCommonFormatColumnthat can be read withStringUtf8DictionaryEncodedColumn.
-
-
Field Summary
-
Fields inherited from class org.apache.druid.segment.nested.ScalarNestedCommonFormatColumnSerializer
closedForWrite, closer, columnNameBytes, dictionaryIdLookup, dictionarySerialized, dictionaryWriter, hasNulls, indexSpec, intermediateValueWriter, log, name, segmentWriteOutMedium, writeDictionary
-
Fields inherited from class org.apache.druid.segment.nested.NestedCommonFormatColumnSerializer
NESTED_FIELD_PREFIX, RAW_FILE_NAME, V0
-
-
Constructor Summary
Constructors Constructor Description ScalarStringColumnSerializer(String name, IndexSpec indexSpec, SegmentWriteOutMedium segmentWriteOutMedium, Closer closer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCardinality()voidopenDictionaryWriter(File segmentBaseDir)protected voidopenValueColumnSerializer()Called duringScalarNestedCommonFormatColumnSerializer.open()to allow opening any separate type specific value column serializersprotected intprocessValue(Object rawValue)Called duringScalarNestedCommonFormatColumnSerializer.serialize(ColumnValueSelector)to convert value to dictionary id.voidserializeDictionaries(Iterable<String> strings, Iterable<Long> longs, Iterable<Double> doubles, Iterable<int[]> arrays)protected voidwriteDictionaryFile(FileSmoosher smoosher)protected voidwriteValueColumn(FileSmoosher smoosher)Called duringScalarNestedCommonFormatColumnSerializer.writeTo(WritableByteChannel, FileSmoosher)to allow any type specific value column serializers to use theFileSmoosherto write stuff to places.-
Methods inherited from class org.apache.druid.segment.nested.ScalarNestedCommonFormatColumnSerializer
getColumnName, getDictionaryIdLookup, getSerializedSize, hasNulls, open, serialize, setDictionaryIdLookup, writeTo
-
Methods inherited from class org.apache.druid.segment.nested.NestedCommonFormatColumnSerializer
computeFilenameBytes, copyFromTempSmoosh, serializeFields, writeInternal, writeV0Header
-
-
-
-
Constructor Detail
-
ScalarStringColumnSerializer
public ScalarStringColumnSerializer(String name, IndexSpec indexSpec, SegmentWriteOutMedium segmentWriteOutMedium, Closer closer)
-
-
Method Detail
-
processValue
protected int processValue(@Nullable Object rawValue)
Description copied from class:ScalarNestedCommonFormatColumnSerializerCalled duringScalarNestedCommonFormatColumnSerializer.serialize(ColumnValueSelector)to convert value to dictionary id.Implementations may optionally also serialize the value to a type specific value column if they opened one with
ScalarNestedCommonFormatColumnSerializer.openValueColumnSerializer(), or do whatever else is useful to do while handling a single row value.- Specified by:
processValuein classScalarNestedCommonFormatColumnSerializer<String>
-
openDictionaryWriter
public void openDictionaryWriter(File segmentBaseDir) throws IOException
- Specified by:
openDictionaryWriterin classNestedCommonFormatColumnSerializer- Throws:
IOException
-
openValueColumnSerializer
protected void openValueColumnSerializer()
Description copied from class:ScalarNestedCommonFormatColumnSerializerCalled duringScalarNestedCommonFormatColumnSerializer.open()to allow opening any separate type specific value column serializers- Specified by:
openValueColumnSerializerin classScalarNestedCommonFormatColumnSerializer<String>
-
serializeDictionaries
public void serializeDictionaries(Iterable<String> strings, Iterable<Long> longs, Iterable<Double> doubles, Iterable<int[]> arrays) throws IOException
- Specified by:
serializeDictionariesin classNestedCommonFormatColumnSerializer- Throws:
IOException
-
writeValueColumn
protected void writeValueColumn(FileSmoosher smoosher)
Description copied from class:ScalarNestedCommonFormatColumnSerializerCalled duringScalarNestedCommonFormatColumnSerializer.writeTo(WritableByteChannel, FileSmoosher)to allow any type specific value column serializers to use theFileSmoosherto write stuff to places.- Specified by:
writeValueColumnin classScalarNestedCommonFormatColumnSerializer<String>
-
writeDictionaryFile
protected void writeDictionaryFile(FileSmoosher smoosher) throws IOException
- Specified by:
writeDictionaryFilein classScalarNestedCommonFormatColumnSerializer<String>- Throws:
IOException
-
getCardinality
public int getCardinality()
- Specified by:
getCardinalityin classScalarNestedCommonFormatColumnSerializer<String>
-
-