mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-15 20:40:39 +00:00
refactor(mito2): reduce duplicate IndexOutput struct (#4592)
* refactor(mito2): reduce duplicate IndexOutput struct * docs(mito2): add index output note
This commit is contained in:
@@ -52,39 +52,27 @@ pub struct IndexOutput {
|
||||
pub fulltext_index: FulltextIndexOutput,
|
||||
}
|
||||
|
||||
/// Base output of the index creation.
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct IndexBaseOutput {
|
||||
/// Size of the index.
|
||||
pub index_size: ByteCount,
|
||||
/// Number of rows in the index.
|
||||
pub row_count: RowCount,
|
||||
/// Available columns in the index.
|
||||
pub columns: Vec<ColumnId>,
|
||||
}
|
||||
|
||||
impl IndexBaseOutput {
|
||||
pub fn is_available(&self) -> bool {
|
||||
self.index_size > 0
|
||||
}
|
||||
}
|
||||
|
||||
/// Output of the inverted index creation.
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct InvertedIndexOutput {
|
||||
/// Size of the index.
|
||||
pub index_size: ByteCount,
|
||||
/// Number of rows in the index.
|
||||
pub row_count: RowCount,
|
||||
/// Available columns in the index.
|
||||
pub columns: Vec<ColumnId>,
|
||||
}
|
||||
|
||||
pub type InvertedIndexOutput = IndexBaseOutput;
|
||||
/// Output of the fulltext index creation.
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct FulltextIndexOutput {
|
||||
/// Size of the index.
|
||||
pub index_size: ByteCount,
|
||||
/// Number of rows in the index.
|
||||
pub row_count: RowCount,
|
||||
/// Available columns in the index.
|
||||
pub columns: Vec<ColumnId>,
|
||||
}
|
||||
|
||||
impl InvertedIndexOutput {
|
||||
pub fn is_available(&self) -> bool {
|
||||
self.index_size > 0
|
||||
}
|
||||
}
|
||||
|
||||
impl FulltextIndexOutput {
|
||||
pub fn is_available(&self) -> bool {
|
||||
self.index_size > 0
|
||||
}
|
||||
}
|
||||
pub type FulltextIndexOutput = IndexBaseOutput;
|
||||
|
||||
/// The index creator that hides the error handling details.
|
||||
#[derive(Default)]
|
||||
|
||||
Reference in New Issue
Block a user