Skip to content

Commit ad2bc7f

Browse files
authored
Merge branch 'main' into main
2 parents 1b7aa69 + ca89191 commit ad2bc7f

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/meta/api/src/schema_api_impl.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ const DEFAULT_DATA_RETENTION_SECONDS: i64 = 24 * 60 * 60;
224224
/// SchemaApi is implemented upon kvapi::KVApi.
225225
/// Thus every type that impl kvapi::KVApi impls SchemaApi.
226226
#[tonic::async_trait]
227-
impl<KV: kvapi::KVApi<Error = MetaError>> SchemaApi for KV {
227+
impl<KV: kvapi::KVApi<Error = MetaError> + ?Sized> SchemaApi for KV {
228228
#[logcall::logcall("debug")]
229229
#[minitrace::trace]
230230
async fn create_database(
@@ -2987,7 +2987,7 @@ impl<KV: kvapi::KVApi<Error = MetaError>> SchemaApi for KV {
29872987
inner: db_info.name_ident.clone(),
29882988
filter,
29892989
};
2990-
do_get_table_history(&self, req, db_info.ident.db_id, &db_info.meta)
2990+
do_get_table_history(self, req, db_info.ident.db_id, &db_info.meta)
29912991
.await?
29922992
} else {
29932993
// while filter_drop_on is None, then get all the drop db tables
@@ -2996,7 +2996,7 @@ impl<KV: kvapi::KVApi<Error = MetaError>> SchemaApi for KV {
29962996
inner: db_info.name_ident.clone(),
29972997
filter: TableInfoFilter::All,
29982998
};
2999-
do_get_table_history(&self, req, db_info.ident.db_id, &db_info.meta)
2999+
do_get_table_history(self, req, db_info.ident.db_id, &db_info.meta)
30003000
.await?
30013001
}
30023002
}
@@ -3006,7 +3006,7 @@ impl<KV: kvapi::KVApi<Error = MetaError>> SchemaApi for KV {
30063006
filter: TableInfoFilter::Dropped(*filter_drop_on),
30073007
};
30083008
// not drop db, only filter drop tables with filter drop on
3009-
do_get_table_history(&self, req, db_info.ident.db_id, &db_info.meta).await?
3009+
do_get_table_history(self, req, db_info.ident.db_id, &db_info.meta).await?
30103010
}
30113011
};
30123012
if drop_db {
@@ -3055,7 +3055,7 @@ impl<KV: kvapi::KVApi<Error = MetaError>> SchemaApi for KV {
30553055
});
30563056
}
30573057

3058-
let table_infos = do_get_table_history(&self, req, db_id, &db_meta).await?;
3058+
let table_infos = do_get_table_history(self, req, db_id, &db_meta).await?;
30593059
table_infos.iter().for_each(|table_info| {
30603060
drop_ids.push(DroppedId::Table(
30613061
db_id,
@@ -3564,7 +3564,7 @@ impl<KV: kvapi::KVApi<Error = MetaError>> SchemaApi for KV {
35643564
///
35653565
/// Returns number of files that are going to be removed.
35663566
async fn remove_table_copied_files(
3567-
kv_api: &impl kvapi::KVApi<Error = MetaError>,
3567+
kv_api: &(impl kvapi::KVApi<Error = MetaError> + ?Sized),
35683568
table_id: u64,
35693569
condition: &mut Vec<TxnCondition>,
35703570
if_then: &mut Vec<TxnOp>,
@@ -3605,7 +3605,7 @@ async fn remove_table_copied_files(
36053605

36063606
/// List the copied file identities belonging to a table.
36073607
async fn list_table_copied_files(
3608-
kv_api: &impl kvapi::KVApi<Error = MetaError>,
3608+
kv_api: &(impl kvapi::KVApi<Error = MetaError> + ?Sized),
36093609
table_id: u64,
36103610
) -> Result<Vec<TableCopiedFileNameIdent>, MetaError> {
36113611
let copied_file_ident = TableCopiedFileNameIdent {
@@ -3697,7 +3697,7 @@ fn table_has_to_not_exist(
36973697
/// It returns (seq, `u64` value).
36983698
/// If the count value is not in the kv space, (0, `u64` value) is returned.
36993699
async fn count_tables(
3700-
kv_api: &impl kvapi::KVApi<Error = MetaError>,
3700+
kv_api: &(impl kvapi::KVApi<Error = MetaError> + ?Sized),
37013701
key: &CountTablesKey,
37023702
) -> Result<u64, KVAppError> {
37033703
// For backward compatibility:
@@ -3774,7 +3774,7 @@ async fn get_share_table_info_map(
37743774
}
37753775

37763776
async fn get_table_id_from_share_by_name(
3777-
kv_api: &impl kvapi::KVApi<Error = MetaError>,
3777+
kv_api: &(impl kvapi::KVApi<Error = MetaError> + ?Sized),
37783778
share: &ShareNameIdent,
37793779
table_name: &String,
37803780
) -> Result<u64, KVAppError> {
@@ -3885,7 +3885,7 @@ fn set_update_expire_operation(
38853885
#[logcall::logcall("debug")]
38863886
#[minitrace::trace]
38873887
async fn do_get_table_history(
3888-
kv_api: &impl kvapi::KVApi<Error = MetaError>,
3888+
kv_api: &(impl kvapi::KVApi<Error = MetaError> + ?Sized),
38893889
req: ListDroppedTableReq,
38903890
db_id: u64,
38913891
db_meta: &DatabaseMeta,
@@ -4021,7 +4021,7 @@ pub(crate) async fn get_index_or_err(
40214021
}
40224022

40234023
async fn gc_dropped_db_by_id(
4024-
kv_api: &impl kvapi::KVApi<Error = MetaError>,
4024+
kv_api: &(impl kvapi::KVApi<Error = MetaError> + ?Sized),
40254025
db_id: u64,
40264026
tenant: String,
40274027
db_name: String,
@@ -4123,7 +4123,7 @@ async fn gc_dropped_db_by_id(
41234123
}
41244124

41254125
async fn gc_dropped_table_by_id(
4126-
kv_api: &impl kvapi::KVApi<Error = MetaError>,
4126+
kv_api: &(impl kvapi::KVApi<Error = MetaError> + ?Sized),
41274127
tenant: String,
41284128
db_id: u64,
41294129
table_id: u64,
@@ -4169,7 +4169,7 @@ async fn gc_dropped_table_by_id(
41694169
}
41704170

41714171
async fn gc_dropped_table_data(
4172-
kv_api: &impl kvapi::KVApi<Error = MetaError>,
4172+
kv_api: &(impl kvapi::KVApi<Error = MetaError> + ?Sized),
41734173
table_id: u64,
41744174
condition: &mut Vec<TxnCondition>,
41754175
if_then: &mut Vec<TxnOp>,
@@ -4209,7 +4209,7 @@ async fn gc_dropped_table_data(
42094209
}
42104210

42114211
async fn gc_dropped_table_index(
4212-
kv_api: &impl kvapi::KVApi<Error = MetaError>,
4212+
kv_api: &(impl kvapi::KVApi<Error = MetaError> + ?Sized),
42134213
tenant: &str,
42144214
table_id: u64,
42154215
if_then: &mut Vec<TxnOp>,

src/meta/api/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pub fn deserialize_u64(v: &[u8]) -> Result<Id, MetaNetworkError> {
224224
/// Ids are categorized by generators.
225225
/// Ids may not be consecutive.
226226
pub async fn fetch_id<T: kvapi::Key>(
227-
kv_api: &impl kvapi::KVApi<Error = MetaError>,
227+
kv_api: &(impl kvapi::KVApi<Error = MetaError> + ?Sized),
228228
generator: T,
229229
) -> Result<u64, KVAppError> {
230230
let res = kv_api

src/query/management/src/role/role_mgr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ use crate::role::role_api::RoleApi;
3131
static ROLE_API_KEY_PREFIX: &str = "__fd_roles";
3232

3333
pub struct RoleMgr {
34-
kv_api: Arc<dyn kvapi::KVApi<Error = MetaError>>,
34+
kv_api: Arc<dyn kvapi::KVApi<Error = MetaError> + Send + Sync>,
3535
role_prefix: String,
3636
}
3737

3838
impl RoleMgr {
3939
pub fn create(
40-
kv_api: Arc<dyn kvapi::KVApi<Error = MetaError>>,
40+
kv_api: Arc<dyn kvapi::KVApi<Error = MetaError> + Send + Sync>,
4141
tenant: &str,
4242
) -> Result<Self, ErrorCode> {
4343
if tenant.is_empty() {

src/query/users/src/user_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use crate::idm_config::IDMConfig;
4646

4747
pub struct UserApiProvider {
4848
meta: MetaStore,
49-
client: Arc<dyn kvapi::KVApi<Error = MetaError>>,
49+
client: Arc<dyn kvapi::KVApi<Error = MetaError> + Send + Sync>,
5050
idm_config: IDMConfig,
5151
}
5252

0 commit comments

Comments
 (0)