Package org.apache.druid.segment.nested
Class ScalarLongColumnSerializer
- java.lang.Object
-
- org.apache.druid.segment.nested.NestedCommonFormatColumnSerializer
-
- org.apache.druid.segment.nested.ScalarNestedCommonFormatColumnSerializer<Long>
-
- org.apache.druid.segment.nested.ScalarLongColumnSerializer
-
- All Implemented Interfaces:
GenericColumnSerializer<StructuredData>,Serializer
public class ScalarLongColumnSerializer extends ScalarNestedCommonFormatColumnSerializer<Long>
Serializer for aScalarLongColumn
-
-
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 ScalarLongColumnSerializer(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
-
ScalarLongColumnSerializer
public ScalarLongColumnSerializer(String name, IndexSpec indexSpec, SegmentWriteOutMedium segmentWriteOutMedium, Closer closer)
-
-
Method Detail
-
processValue
protected int processValue(@Nullable Object rawValue) throws IOException
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<Long>- Throws:
IOException
-
openDictionaryWriter
public void openDictionaryWriter(File segmentBaseDir) throws IOException
- Specified by:
openDictionaryWriterin classNestedCommonFormatColumnSerializer- Throws:
IOException
-
openValueColumnSerializer
protected void openValueColumnSerializer() throws IOExceptionDescription copied from class:ScalarNestedCommonFormatColumnSerializerCalled duringScalarNestedCommonFormatColumnSerializer.open()to allow opening any separate type specific value column serializers- Specified by:
openValueColumnSerializerin classScalarNestedCommonFormatColumnSerializer<Long>- 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
-
writeValueColumn
protected void writeValueColumn(FileSmoosher smoosher) throws IOException
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<Long>- Throws:
IOException
-
writeDictionaryFile
protected void writeDictionaryFile(FileSmoosher smoosher) throws IOException
- Specified by:
writeDictionaryFilein classScalarNestedCommonFormatColumnSerializer<Long>- Throws:
IOException
-
getCardinality
public int getCardinality()
- Specified by:
getCardinalityin classScalarNestedCommonFormatColumnSerializer<Long>
-
-