StarRocks学习: 读写流程
SQL
1 | ReadListener(handleEvent) ->ConnectProcessor(processOnce ->dispatch->handleQuery) -> StmtExecutor(execute) |
读流程
1 | olap_scan_node -> tabel_scanner -> tablet_reader(_init_collector) -> BetaRowset(get_segment_iterators) -> SegmentIterator |
Rowset package
1 | SegmentIterator(do_get_next,_init,_get_row_ranges_by_keys,_init_column_iterators) -> Segment(new_column_iterator) ->ColumnReader->ColumnIterator |
1 | ColumnIterator >> (DefaultValueColumnIterator|ArrayColumnIterator|DictCodeColumnIterator|ScalarColumnIterator) |
1 | Segment::new_iterator >> (SegmentChunkIteratorAdapter | SegmentIterator) |
1 | ColumnReader >> (ZoneMapIndexReader|OrdinalIndexReader|BitmapIndexReader|BloomFilterIndexReader) >> IndexedColumnReader >> IndexedColumnIterator >> IndexPageIterator |
1 | PageBuilder >> (BinaryDictPageBuilder|BinaryPlainPageBuilder|BinaryPrefixPageBuilder|BitshufflePageBuilder|FrameOfReferencePageBuilder|PlainPageBuilder|RlePageBuilder) >> EncodingInfo >> ColumnReader |
1 | StoragePageDecoder >> PageIO::read_and_decompress_page >> ColumnReader::read_page |
1 | SegmentIterator >> ColumnDecoder.(check_global_dict|encode_to_global_id) |
Vectorized package
1 | ChunkIterator >> (SegmentIterator|SegmentChunkIteratorAdapter|TimedChunkIterator|AggregateIterator|EmptyIterator|MergeIterator|ProjectionIterator|TabletReader|UnionIterator) >> TabletReader |
1 | StorageEngine(_perform_base_compaction) >> (CumulativeCompaction|BaseCompaction) |
1 | ColumnPredicate >> (NullPredicate|ColumnEqPredicate|BinaryColumnEqPredicate|ColumnExprPredicate|ColumnTruePredicate|ColumnGePredicate|BinaryColumnGePredicate|ColumnGtPredicate|BinaryColumnGtPredicate....) >> |
Task package
1 | EngineTask >> (EngineStorageMigrationTask|EnginePublishVersionTask|EngineCloneTask|EngineChecksumTask|EngineBatchLoadTask|EngineAlterTabletTask) |
写流程
1 | data_sink -> tablet_sink -> LoadChannel->TabletsChannel->DeltaWriter->rowset_writer |