File tree 2 files changed +7
-10
lines changed
table_engine/src/partition
2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -323,6 +323,7 @@ impl Proxy {
323
323
part_info : & PartitionInfo ,
324
324
) -> Result < TableInfo > {
325
325
let get_inner = |i| async move {
326
+ // TODO: the remote engine should provide a method to get all sub table names.
326
327
let sub_partition_table_name = util:: get_sub_partition_name ( base_name, part_info, i) ;
327
328
let table = self
328
329
. instance
@@ -344,16 +345,12 @@ impl Proxy {
344
345
Ok ( table)
345
346
} ;
346
347
347
- let part_num = part_info. get_definition_num ( ) ;
348
- if part_num == 1 {
349
- return get_inner ( 0 ) . await ;
350
- }
351
-
352
- // Loop get sub tables to get table info in case of some of them has problems.
353
- for i in 0 ..part_info. get_definition_num ( ) - 1 {
348
+ let part_num = part_info. get_partition_num ( ) ;
349
+ // Loop all sub tables to get table info in case of some of them has problems.
350
+ for i in 0 ..part_num - 1 {
354
351
let ret = get_inner ( i) . await ;
355
- if let Err ( err ) = ret {
356
- warn ! ( "Failed to get table info, err:{err :?}" ) ;
352
+ if let Err ( e ) = ret {
353
+ warn ! ( "Failed to get table info, err:{e :?}" ) ;
357
354
} else {
358
355
return ret;
359
356
}
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ impl PartitionInfo {
100
100
}
101
101
102
102
#[ inline]
103
- pub fn get_definition_num ( & self ) -> usize {
103
+ pub fn get_partition_num ( & self ) -> usize {
104
104
match self {
105
105
Self :: Random ( v) => v. definitions . len ( ) ,
106
106
Self :: Hash ( v) => v. definitions . len ( ) ,
You can’t perform that action at this time.
0 commit comments