1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright 2022 RisingLight Project Authors. Licensed under Apache-2.0.
//! Rowset encoding and decoding implementation of RisingLight.
//!
//! Rowset is the minimum managing unit of RisingLight's secondary storage engine.
//! A table contains multiple Rowsets on disk. Rowset stores `DataChunk`s,
//! where each `Array` is stored in one or two column files along with an index,
//! Data are sorted by sort key.
//!
//! For example, `create table t1 (v1 primary int not null, v2 int)` will generate the
//! following Rowset directory structure:
//!
//! ```plain
//! 03_03 directory name = <TableId>_<RowsetId>
//! |- MANIFEST manifest file, which contains column descriptions of the current Rowset
//! |- 01.col data for v1
//! |- 01.sort sort index for v1, which stores RowId + Key -> Block mapping
//! |- 02.col data for v2
//! \- 02.idx normal index for v2, which stores RowId -> Block mapping
//! ```
//!
//! Data flushed to directory will be immutable, and the directory content will remain
//! unchanged throughout the whole process. Delete vectors for all Rowsets will be
//! stored in a separate directory.
//!
//! Each index, sorted index and column data file has a pre-defined encoding scheme, and is
//! managed on the granularity of block, which might be about 4KB in size. Block builders
//! could freely encode the data as they prefer inside each block.
//!
//! There are a lot of block builders and column builders in Secondary. For each
//! encoding scheme, the the following structures should be implemented in pairs:
//!
//! * `RunLengthIntBlockBuilder` - `RunLengthIntBlock` - `RunLengthIntBlockIterator` - an entry in
//! proto
//! * `IntColumnBuilder` - `IntColumn` - `IntColumnIterator` - an entry in proto
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;