1mod bucket;
20mod builder;
21mod catalog;
22mod maintenance;
23mod purger;
24mod searcher;
25mod task;
26#[cfg(test)]
27mod tests;
28mod version;
29mod writer;
30
31use std::sync::Arc;
32
33use futures::stream::BoxStream;
34use object_store::ObjectStore;
35use store_api::metric_engine_consts::{
36 DATA_SCHEMA_TABLE_ID_COLUMN_NAME as TABLE_ID_COLUMN,
37 DATA_SCHEMA_TSID_COLUMN_NAME as TSID_COLUMN,
38};
39
40use crate::error::Result;
41#[cfg(test)]
42pub(crate) use crate::series_index::catalog::{RangeIndexEntry, SeriesIndexEntry};
43pub(crate) use crate::series_index::catalog::{
44 delete_catalogs, load_version_control, series_index_path,
45};
46pub(crate) use crate::series_index::purger::{IndexFilePurger, series_index_channel};
47pub use crate::series_index::searcher::SeriesIndexSearcher;
48pub(crate) use crate::series_index::task::{SeriesIndexTaskState, spawn_series_index_tasks};
49pub(crate) use crate::series_index::version::{
50 SeriesIndexFileHandle, SeriesIndexVersion, SeriesIndexVersionControl,
51};
52pub use crate::series_index::writer::{
53 SeriesIndexWriter, SeriesIndexWriterMetrics, SeriesIndexWriterOptions, series_index_schema,
54};
55
56#[derive(Clone)]
58pub(crate) struct SeriesIndexReadContext {
59 pub(crate) store: ObjectStore,
60 pub(crate) version: Arc<SeriesIndexVersion>,
61}
62
63pub(crate) const MIN_TS_COLUMN: &str = "__series_min_ts";
64pub(crate) const MAX_TS_COLUMN: &str = "__series_max_ts";
65pub(crate) const ROW_COUNT_COLUMN: &str = "__series_row_count";
66pub(crate) const METRIC_SERIES_ID_BATCH_SIZE: usize = 500;
67
68#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
70pub struct MetricSeriesId {
71 pub table_id: u32,
73 pub tsid: u64,
75}
76
77pub type MetricSeriesIdStream = BoxStream<'static, Result<Vec<MetricSeriesId>>>;