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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! BTI (Big Trie Index) parser implementation
//!
//! This module provides parsing capabilities for BTI format components:
//! - Partitions.db BTI index for partition lookups
//! - Rows.db BTI index for clustering key lookups within partitions
//!
//! ## Node-type encoding (TrieNode.java, Cassandra 5.0)
//!
//! The high nibble (bits 7-4) of every node's first byte is a 4-bit ordinal that
//! selects one of up to 16 concrete trie-node subtypes:
//!
//! | Nibble | Java class | Rust category | Pointer size |
//! |--------|---------------------|------------------|--------------|
//! | 0 | PayloadOnly | `PayloadOnly` | — |
//! | 1 | SingleNoPayload4 | `Single` | 4-bit delta |
//! | 2 | Single8 | `Single` | 1 byte |
//! | 3 | SingleNoPayload12 | `Single` | 12-bit delta |
//! | 4 | Single16 | `Single` | 2 bytes |
//! | 5 | Sparse8 | `Sparse` | 1 byte |
//! | 6 | Sparse12 | `Sparse` | 12-bit |
//! | 7 | Sparse16 | `Sparse` | 2 bytes |
//! | 8 | Sparse24 | `Sparse` | 3 bytes |
//! | 9 | Sparse40 | `Sparse` | 5 bytes |
//! | 10 | Dense12 | `Dense` | 12-bit |
//! | 11 | Dense16 | `Dense` | 2 bytes |
//! | 12 | Dense24 | `Dense` | 3 bytes |
//! | 13 | Dense32 | `Dense` | 4 bytes |
//! | 14 | Dense40 | `Dense` | 5 bytes |
//! | 15 | LongDense | `Dense` | 8 bytes |
//!
//! The low nibble (bits 3-0) carries payload flags; a non-zero value means a
//! payload follows immediately after the node's fixed-size header.
//!
//! All transition deltas are stored as *backward* distances (the child always
//! appears earlier in the file), so the absolute child position is:
//! `child_pos = parent_pos - delta`
//!
//! The "no-payload" Single variants (nibbles 1 and 3) encode the delta in the
//! low nibble / low 12 bits of the first two bytes respectively, and cannot
//! carry a payload (their payload-flag nibble is always 0).
//!
//! ## Module layout (issue #1119, epic #1116)
//!
//! - [`node_decode`] — node-type nibble classification + the 16-ordinal
//! `parse_bti_node` dispatcher and its byte/12-bit readers.
//! - [`partitions`] — `Partitions.db` leaf payload decode, trie walk, and
//! point lookup (`lookup_partition_in_bti_file`).
//! - [`traversal`] — depth-capped in-order DFS primitives + the headerless
//! partition iterator.
//! - [`rows`] — `Rows.db` `RowIndexReader.IndexInfo` / `TrieIndexEntry`
//! decode, row iteration, and range-block selection.
//! - [`encoding`] — Cassandra OSS50 byte-comparable clustering-bound encoders.
//! - [`reader`] — the stateful `BtiHeader` / `PartitionsParser` /
//! `RowsParser` navigators, their iterators, and `BtiIndexStats`.
// Public surface — re-exported unchanged so `bti::parser::X` paths keep working.
pub use ;
pub use ;
pub use ;
pub use ;
pub use iterate_partitions_in_bti_file;