Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Define DatabaseIdIdent with TIdent #15489

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions .github/actions/test_stateful_sharing/action.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/reuse.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,20 +181,6 @@ jobs:
with:
name: test-stateful-standalone-linux

test_stateful_sharing:
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
needs: [build, check]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/test_stateful_sharing
if: env.BUILD_PROFILE == 'debug'
timeout-minutes: 10
- name: Upload failure
if: failure()
uses: ./.github/actions/artifact_failure
with:
name: test-stateful-sharing-linux

test_stateful_cluster:
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
needs: [build, check]
Expand Down
30 changes: 1 addition & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ members = [
"src/query/storages/memory",
"src/query/storages/null",
"src/query/storages/random",
"src/query/storages/share",
"src/query/storages/stage",
"src/query/storages/stream",
"src/query/storages/system",
Expand Down
1 change: 0 additions & 1 deletion src/meta/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ anyhow = { workspace = true }
async-backtrace = { workspace = true }
async-trait = { workspace = true }
chrono = { workspace = true }
enumflags2 = { workspace = true }
futures = { workspace = true }
log = { workspace = true }
logcall = { workspace = true }
Expand Down
17 changes: 17 additions & 0 deletions src/meta/api/src/kv_pb_api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,23 @@ use crate::kv_pb_api::errors::PbApiWriteError;

/// This trait provides a way to access a kv store with `kvapi::Key` type key and protobuf encoded value.
pub trait KVPbApi: KVApi {
/// Update a protobuf encoded value by kvapi::Key.
///
/// Equivalent to `update_pb(UpsertPB::update(key,value))`
/// but returns the transition before and after executing the operation.
fn update_pb<K>(
&self,
key: K,
value: K::ValueType,
) -> impl Future<Output = Result<Change<K::ValueType>, Self::Error>> + Send
where
K: kvapi::Key + Send + 'static,
K::ValueType: FromToProto + Send,
Self::Error: From<PbApiWriteError<Self::Error>>,
{
async move { self.upsert_pb(&UpsertPB::update(key, value)).await }
}

/// Update or insert a protobuf encoded value by kvapi::Key.
///
/// The key will be converted to string and the value is encoded by `FromToProto`.
Expand Down
17 changes: 0 additions & 17 deletions src/meta/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ mod schema_api;
mod schema_api_impl;
mod schema_api_test_suite;
mod sequence_api;
mod share_api;
mod share_api_impl;
mod share_api_test_suite;
pub(crate) mod testing;
pub mod txn_backoff;
pub(crate) mod util;
Expand All @@ -44,31 +41,17 @@ pub use background_api::BackgroundApi;
pub use background_api_test_suite::BackgroundApiTestSuite;
pub use data_mask_api::DatamaskApi;
pub use schema_api::SchemaApi;
pub(crate) use schema_api_impl::get_db_or_err;
pub use schema_api_test_suite::SchemaApiTestSuite;
pub use sequence_api::SequenceApi;
pub use share_api::ShareApi;
pub use share_api_test_suite::ShareApiTestSuite;
pub use util::assert_table_exist;
pub use util::convert_share_meta_to_spec;
pub use util::db_has_to_exist;
pub use util::deserialize_struct;
pub use util::deserialize_u64;
pub use util::fetch_id;
pub use util::get_object_shared_by_share_ids;
pub use util::get_pb_value;
pub use util::get_share_account_meta_or_err;
pub use util::get_share_database_id_and_privilege;
pub use util::get_share_id_to_name_or_err;
pub use util::get_share_meta_by_id_or_err;
pub use util::get_share_or_err;
pub use util::get_share_table_info;
pub use util::get_u64_value;
pub use util::is_all_db_data_removed;
pub use util::is_db_need_to_be_remove;
pub use util::list_keys;
pub use util::list_u64_value;
pub use util::remove_db_from_share;
pub use util::send_txn;
pub use util::serialize_struct;
pub use util::serialize_u64;
Expand Down
6 changes: 5 additions & 1 deletion src/meta/api/src/schema_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use databend_common_meta_app::schema::CreateTableReply;
use databend_common_meta_app::schema::CreateTableReq;
use databend_common_meta_app::schema::CreateVirtualColumnReply;
use databend_common_meta_app::schema::CreateVirtualColumnReq;
use databend_common_meta_app::schema::DatabaseIdIdent;
use databend_common_meta_app::schema::DatabaseInfo;
use databend_common_meta_app::schema::DeleteLockRevReq;
use databend_common_meta_app::schema::DropCatalogReply;
Expand Down Expand Up @@ -95,6 +96,7 @@ use databend_common_meta_app::schema::UpdateVirtualColumnReq;
use databend_common_meta_app::schema::UpsertTableOptionReply;
use databend_common_meta_app::schema::UpsertTableOptionReq;
use databend_common_meta_app::schema::VirtualColumnMeta;
use databend_common_meta_app::tenant::Tenant;
use databend_common_meta_types::MetaError;
use databend_common_meta_types::MetaId;
use databend_common_meta_types::SeqV;
Expand Down Expand Up @@ -212,15 +214,17 @@ pub trait SchemaApi: Send + Sync {

async fn mget_table_names_by_ids(
&self,
tenant: &Tenant,
table_ids: &[MetaId],
) -> Result<Vec<Option<String>>, KVAppError>;

async fn mget_database_names_by_ids(
&self,
tenant: &Tenant,
db_ids: &[MetaId],
) -> Result<Vec<Option<String>>, KVAppError>;

async fn get_db_name_by_id(&self, db_id: MetaId) -> Result<String, KVAppError>;
async fn get_db_name_by_id(&self, db_id: DatabaseIdIdent) -> Result<String, KVAppError>;

async fn get_table_copied_file_info(
&self,
Expand Down
Loading
Loading