-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor:
get_history_tables_for_gc()
should not return TableInfo
โฆ
โฆ, but just table name, id and values (#16545) `SchemaApi` can not provide enough information to build a valid `TableInfo`, such as, it does not know about catalog type and database type. Therefore `get_history_tables_for_gc()` should just return `table name, table id and the table meta` to its caller to let the build a `TableInfo` if needed.
- Loading branch information
1 parent
dd45c19
commit 0ed932b
Showing
4 changed files
with
112 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2021 Datafuse Labs | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
use databend_common_meta_types::SeqV; | ||
|
||
use crate::schema::DBIdTableName; | ||
use crate::schema::TableId; | ||
use crate::schema::TableMeta; | ||
|
||
/// The **Name, ID, Value** for a table metadata stored in meta-service. | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
pub struct TableNIV { | ||
name: DBIdTableName, | ||
id: TableId, | ||
value: SeqV<TableMeta>, | ||
} | ||
|
||
impl TableNIV { | ||
pub fn new(name: DBIdTableName, id: TableId, value: SeqV<TableMeta>) -> Self { | ||
TableNIV { name, id, value } | ||
} | ||
|
||
pub fn name(&self) -> &DBIdTableName { | ||
&self.name | ||
} | ||
|
||
pub fn id(&self) -> &TableId { | ||
&self.id | ||
} | ||
|
||
pub fn value(&self) -> &SeqV<TableMeta> { | ||
&self.value | ||
} | ||
|
||
pub fn unpack(self) -> (DBIdTableName, TableId, SeqV<TableMeta>) { | ||
(self.name, self.id, self.value) | ||
} | ||
} |