public abstract class ScalarNestedCommonFormatColumnSerializer<T> extends NestedCommonFormatColumnSerializer
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closedForWrite |
protected Closer |
closer |
protected ByteBuffer |
columnNameBytes |
protected String |
dictionaryFileName |
protected DictionaryIdLookup |
dictionaryIdLookup |
protected boolean |
dictionarySerialized |
protected DictionaryWriter<T> |
dictionaryWriter |
protected boolean |
hasNulls |
protected IndexSpec |
indexSpec |
protected FixedIndexedIntWriter |
intermediateValueWriter |
protected static Logger |
log |
protected String |
name |
protected SegmentWriteOutMedium |
segmentWriteOutMedium |
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 and Description |
|---|
ScalarNestedCommonFormatColumnSerializer(String name,
String dictionaryFileName,
IndexSpec indexSpec,
SegmentWriteOutMedium segmentWriteOutMedium,
Closer closer) |
| Modifier and Type | Method and Description |
|---|---|
String |
getColumnName() |
DictionaryIdLookup |
getGlobalLookup() |
long |
getSerializedSize()
Returns the number of bytes, that this Serializer will write to the output _channel_ (not smoosher) on a
Serializer.writeTo(java.nio.channels.WritableByteChannel, org.apache.druid.java.util.common.io.smoosh.FileSmoosher) call. |
boolean |
hasNulls() |
void |
open() |
protected abstract void |
openValueColumnSerializer()
Called during
open() to allow opening any separate type specific value column serializers |
protected abstract int |
processValue(Object rawValue)
Called during
serialize(ColumnValueSelector) to convert value to dictionary id. |
void |
serialize(ColumnValueSelector<? extends StructuredData> selector) |
void |
writeTo(WritableByteChannel channel,
FileSmoosher smoosher)
Writes serialized form of this object to the given channel.
|
protected abstract void |
writeValueColumn(FileSmoosher smoosher)
Called during
writeTo(WritableByteChannel, FileSmoosher) to allow any type specific value column
serializers to use the FileSmoosher to write stuff to places. |
computeFilenameBytes, getInternalFileName, openDictionaryWriter, serializeDictionaries, serializeFields, writeInternal, writeV0Headerprotected static final Logger log
protected final String name
protected final SegmentWriteOutMedium segmentWriteOutMedium
protected final IndexSpec indexSpec
protected final Closer closer
protected final String dictionaryFileName
protected DictionaryIdLookup dictionaryIdLookup
protected DictionaryWriter<T> dictionaryWriter
protected boolean closedForWrite
protected boolean dictionarySerialized
protected FixedIndexedIntWriter intermediateValueWriter
protected ByteBuffer columnNameBytes
protected boolean hasNulls
public ScalarNestedCommonFormatColumnSerializer(String name, String dictionaryFileName, IndexSpec indexSpec, SegmentWriteOutMedium segmentWriteOutMedium, Closer closer)
protected abstract int processValue(@Nullable Object rawValue) throws IOException
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
openValueColumnSerializer(), or do whatever else is useful to do while handling a single row value.
IOExceptionprotected abstract void openValueColumnSerializer()
throws IOException
open() to allow opening any separate type specific value column serializersIOExceptionprotected abstract void writeValueColumn(FileSmoosher smoosher) throws IOException
writeTo(WritableByteChannel, FileSmoosher) to allow any type specific value column
serializers to use the FileSmoosher to write stuff to places.IOExceptionpublic String getColumnName()
getColumnName in class NestedCommonFormatColumnSerializerpublic DictionaryIdLookup getGlobalLookup()
getGlobalLookup in class NestedCommonFormatColumnSerializerpublic boolean hasNulls()
hasNulls in class NestedCommonFormatColumnSerializerpublic void open()
throws IOException
IOExceptionpublic void serialize(ColumnValueSelector<? extends StructuredData> selector) throws IOException
IOExceptionpublic long getSerializedSize()
SerializerSerializer.writeTo(java.nio.channels.WritableByteChannel, org.apache.druid.java.util.common.io.smoosh.FileSmoosher) call.public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException
SerializerIOExceptionCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.