1#![feature(once_cell_try)]
2#![feature(sync_unsafe_cell)]
3
4mod arc_bytes;
5pub(crate) mod be;
6mod collector;
7mod collector_entry;
8mod compaction;
9mod compression;
10mod constants;
11mod db;
12mod key;
13mod lookup_entry;
14mod merge_iter;
15pub mod meta_file;
16mod meta_file_builder;
17pub mod mmap_helper;
18mod parallel_scheduler;
19mod rc_bytes;
20mod shared_bytes;
21pub mod sst_filter;
22pub mod static_sorted_file;
23mod static_sorted_file_builder;
24mod value_block_count_tracker;
25mod value_buf;
26mod write_batch;
27
28#[cfg(test)]
29mod tests;
30
31pub use arc_bytes::ArcBytes;
32pub use compression::checksum_block;
33pub use db::{CompactConfig, MetaFileEntryInfo, MetaFileInfo, TurboPersistence};
34
35#[derive(Clone, Copy, Debug, PartialEq, Eq)]
36pub enum FamilyKind {
37 SingleValue,
42 MultiValue,
47}
48
49#[derive(Clone, Copy, Debug)]
51pub struct FamilyConfig {
52 pub name: &'static str,
53 pub kind: FamilyKind,
54}
55
56#[derive(Clone, Debug)]
61pub struct DbConfig<const FAMILIES: usize> {
62 pub family_configs: [FamilyConfig; FAMILIES],
63}
64
65impl<const FAMILIES: usize> Default for DbConfig<FAMILIES> {
66 fn default() -> Self {
67 Self {
68 family_configs: [FamilyConfig {
69 name: "unknown",
70 kind: FamilyKind::SingleValue,
71 }; FAMILIES],
72 }
73 }
74}
75pub use key::{KeyBase, QueryKey, StoreKey, hash_key};
76pub use meta_file::MetaEntryFlags;
77pub use parallel_scheduler::{ParallelScheduler, SerialScheduler};
78pub use static_sorted_file::{
79 BlockCache, BlockCacheLifecycle, BlockWeighter, SstLookupResult, StaticSortedFile,
80 StaticSortedFileMetaData,
81};
82pub use static_sorted_file_builder::{
83 BLOCK_HEADER_SIZE, Entry, EntryValue, StreamingSstWriter, write_static_stored_file,
84};
85pub use value_buf::ValueBuffer;
86pub use write_batch::WriteBatch;