@@ -85,9 +85,9 @@ impl RpcClientInner {
85
85
self . pd . get_region ( key. as_ref ( ) )
86
86
}
87
87
88
- fn kv_client ( & self , context : RegionContext ) -> Result < ( RegionContext , Arc < KvClient > ) > {
88
+ fn kv_client ( & self , context : & RegionContext ) -> Result < Arc < KvClient > > {
89
89
if let Some ( conn) = self . tikv . read ( ) . unwrap ( ) . get ( context. address ( ) ) {
90
- return Ok ( ( context , Arc :: clone ( conn) ) ) ;
90
+ return Ok ( Arc :: clone ( conn) ) ;
91
91
} ;
92
92
info ! ( "connect to tikv endpoint: {:?}" , context. address( ) ) ;
93
93
let tikv = Arc :: clone ( & self . tikv ) ;
@@ -102,7 +102,7 @@ impl RpcClientInner {
102
102
tikv. write ( )
103
103
. unwrap ( )
104
104
. insert ( context. address ( ) . to_owned ( ) , Arc :: clone ( & c) ) ;
105
- ( context , c )
105
+ c
106
106
} )
107
107
}
108
108
@@ -118,7 +118,7 @@ impl RpcClientInner {
118
118
self . load_store ( store_id)
119
119
. map_ok ( |store| RegionContext { region, store } )
120
120
} )
121
- . and_then ( move |region| future:: ready ( self2. kv_client ( region) ) )
121
+ . and_then ( move |region| future:: ready ( self2. kv_client ( & region) . map ( |c| ( ( region , c ) ) ) ) )
122
122
}
123
123
124
124
fn region_context_for_key (
@@ -395,13 +395,11 @@ impl RpcClient {
395
395
396
396
pub fn raw_batch_scan (
397
397
& self ,
398
- ranges : Vec < BoundRange > ,
398
+ _ranges : Vec < BoundRange > ,
399
399
_each_limit : u32 ,
400
400
_key_only : bool ,
401
- cf : Option < ColumnFamily > ,
401
+ _cf : Option < ColumnFamily > ,
402
402
) -> impl Future < Output = Result < Vec < KvPair > > > {
403
- drop ( ranges) ;
404
- drop ( cf) ;
405
403
future:: err ( Error :: unimplemented ( ) )
406
404
}
407
405
0 commit comments