File tree Expand file tree Collapse file tree 10 files changed +20
-39
lines changed
tests/it/storages/fuse/operations Expand file tree Collapse file tree 10 files changed +20
-39
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ use common_meta_app::schema::CountTablesReq;
21
21
use common_meta_app:: schema:: CreateDatabaseReply ;
22
22
use common_meta_app:: schema:: CreateDatabaseReq ;
23
23
use common_meta_app:: schema:: CreateTableReq ;
24
- use common_meta_app:: schema:: DatabaseType ;
25
24
use common_meta_app:: schema:: DropDatabaseReq ;
26
25
use common_meta_app:: schema:: DropTableReply ;
27
26
use common_meta_app:: schema:: DropTableReq ;
@@ -143,8 +142,7 @@ pub trait Catalog: DynClone + Send + Sync {
143
142
144
143
async fn update_table_meta (
145
144
& self ,
146
- tenant : & str ,
147
- db_type : DatabaseType ,
145
+ table_info : & TableInfo ,
148
146
req : UpdateTableMetaReq ,
149
147
) -> Result < UpdateTableMetaReply > ;
150
148
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ use common_meta_app::schema::CountTablesReq;
23
23
use common_meta_app:: schema:: CreateDatabaseReply ;
24
24
use common_meta_app:: schema:: CreateDatabaseReq ;
25
25
use common_meta_app:: schema:: CreateTableReq ;
26
- use common_meta_app:: schema:: DatabaseType ;
27
26
use common_meta_app:: schema:: DropDatabaseReq ;
28
27
use common_meta_app:: schema:: DropTableReply ;
29
28
use common_meta_app:: schema:: DropTableReq ;
@@ -462,12 +461,11 @@ impl Catalog for DatabaseCatalog {
462
461
463
462
async fn update_table_meta (
464
463
& self ,
465
- tenant : & str ,
466
- db_type : DatabaseType ,
464
+ table_info : & TableInfo ,
467
465
req : UpdateTableMetaReq ,
468
466
) -> Result < UpdateTableMetaReply > {
469
467
self . mutable_catalog
470
- . update_table_meta ( tenant , db_type , req)
468
+ . update_table_meta ( table_info , req)
471
469
. await
472
470
}
473
471
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ use common_meta_app::schema::CountTablesReq;
23
23
use common_meta_app:: schema:: CreateDatabaseReply ;
24
24
use common_meta_app:: schema:: CreateDatabaseReq ;
25
25
use common_meta_app:: schema:: CreateTableReq ;
26
- use common_meta_app:: schema:: DatabaseType ;
27
26
use common_meta_app:: schema:: DropDatabaseReq ;
28
27
use common_meta_app:: schema:: DropTableReply ;
29
28
use common_meta_app:: schema:: DropTableReq ;
@@ -249,8 +248,7 @@ impl Catalog for ImmutableCatalog {
249
248
250
249
async fn update_table_meta (
251
250
& self ,
252
- _tenant : & str ,
253
- _db_type : DatabaseType ,
251
+ _table_info : & TableInfo ,
254
252
req : UpdateTableMetaReq ,
255
253
) -> Result < UpdateTableMetaReply > {
256
254
Err ( ErrorCode :: Unimplemented ( format ! (
Original file line number Diff line number Diff line change @@ -282,14 +282,15 @@ impl Catalog for MutableCatalog {
282
282
283
283
async fn update_table_meta (
284
284
& self ,
285
- tenant : & str ,
286
- db_type : DatabaseType ,
285
+ table_info : & TableInfo ,
287
286
req : UpdateTableMetaReq ,
288
287
) -> Result < UpdateTableMetaReply > {
289
- match db_type {
288
+ match table_info . db_type . clone ( ) {
290
289
DatabaseType :: NormalDB => Ok ( self . ctx . meta . update_table_meta ( req) . await ?) ,
291
290
DatabaseType :: ShareDB ( share_ident) => {
292
- let db = self . get_database ( tenant, & share_ident. share_name ) . await ?;
291
+ let db = self
292
+ . get_database ( & share_ident. tenant , & share_ident. share_name )
293
+ . await ?;
293
294
db. update_table_meta ( req) . await
294
295
}
295
296
}
Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ use common_meta_app::schema::CountTablesReq;
38
38
use common_meta_app:: schema:: CreateDatabaseReply ;
39
39
use common_meta_app:: schema:: CreateDatabaseReq ;
40
40
use common_meta_app:: schema:: CreateTableReq ;
41
- use common_meta_app:: schema:: DatabaseType ;
42
41
use common_meta_app:: schema:: DropDatabaseReq ;
43
42
use common_meta_app:: schema:: DropTableReply ;
44
43
use common_meta_app:: schema:: DropTableReq ;
@@ -544,14 +543,13 @@ impl Catalog for FakedCatalog {
544
543
545
544
async fn update_table_meta (
546
545
& self ,
547
- tenant : & str ,
548
- db_type : DatabaseType ,
546
+ table_info : & TableInfo ,
549
547
req : UpdateTableMetaReq ,
550
548
) -> Result < UpdateTableMetaReply > {
551
549
if let Some ( e) = & self . error_injection {
552
550
Err ( e. clone ( ) )
553
551
} else {
554
- self . cat . update_table_meta ( tenant , db_type , req) . await
552
+ self . cat . update_table_meta ( table_info , req) . await
555
553
}
556
554
}
557
555
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ impl FuseTable {
100
100
DatabaseType :: ShareDB ( share_ident) => create_share_table_operator (
101
101
ShareTableConfig :: share_endpoint_address ( ) ,
102
102
ShareTableConfig :: share_endpoint_token ( ) ,
103
- & share_ident. share_name ,
103
+ & share_ident. tenant ,
104
104
& share_ident. share_name ,
105
105
& table_info. name ,
106
106
) ,
Original file line number Diff line number Diff line change @@ -354,10 +354,7 @@ impl FuseTable {
354
354
} ;
355
355
356
356
// 3. let's roll
357
- let tenant = ctx. get_tenant ( ) ;
358
- let reply = catalog
359
- . update_table_meta ( & tenant, table_info. db_type . clone ( ) , req)
360
- . await ;
357
+ let reply = catalog. update_table_meta ( table_info, req) . await ;
361
358
match reply {
362
359
Ok ( _) => {
363
360
if let Some ( snapshot_cache) = CacheManager :: instance ( ) . get_table_snapshot_cache ( ) {
Original file line number Diff line number Diff line change @@ -53,10 +53,7 @@ impl FuseTable {
53
53
} ;
54
54
55
55
// 4. let's roll
56
- let tenant = ctx. get_tenant ( ) ;
57
- let reply = catalog
58
- . update_table_meta ( & tenant, self . table_info . db_type . clone ( ) , req)
59
- . await ;
56
+ let reply = catalog. update_table_meta ( & self . table_info , req) . await ;
60
57
if reply. is_ok ( ) {
61
58
// try keep the snapshot hit
62
59
let snapshot_location = table_reverting_to. snapshot_loc ( ) . await ?. ok_or_else ( || {
Original file line number Diff line number Diff line change @@ -72,15 +72,11 @@ impl FuseTable {
72
72
let db_name = ctx. get_current_database ( ) ;
73
73
74
74
catalog
75
- . update_table_meta (
76
- & tenant,
77
- self . table_info . db_type . clone ( ) ,
78
- UpdateTableMetaReq {
79
- table_id,
80
- seq : MatchSeq :: Exact ( table_version) ,
81
- new_table_meta,
82
- } ,
83
- )
75
+ . update_table_meta ( & self . table_info , UpdateTableMetaReq {
76
+ table_id,
77
+ seq : MatchSeq :: Exact ( table_version) ,
78
+ new_table_meta,
79
+ } )
84
80
. await ?;
85
81
86
82
catalog
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ use common_meta_app::schema::CountTablesReq;
32
32
use common_meta_app:: schema:: CreateDatabaseReply ;
33
33
use common_meta_app:: schema:: CreateDatabaseReq ;
34
34
use common_meta_app:: schema:: CreateTableReq ;
35
- use common_meta_app:: schema:: DatabaseType ;
36
35
use common_meta_app:: schema:: DropDatabaseReq ;
37
36
use common_meta_app:: schema:: DropTableReply ;
38
37
use common_meta_app:: schema:: DropTableReq ;
@@ -360,8 +359,7 @@ impl Catalog for HiveCatalog {
360
359
361
360
async fn update_table_meta (
362
361
& self ,
363
- _tenant : & str ,
364
- _db_type : DatabaseType ,
362
+ _table_info : & TableInfo ,
365
363
_req : UpdateTableMetaReq ,
366
364
) -> Result < UpdateTableMetaReply > {
367
365
Err ( ErrorCode :: Unimplemented (
You can’t perform that action at this time.
0 commit comments