File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ impl InnerBuffer {
27
27
self . entry_map . insert ( key, entry) ;
28
28
}
29
29
30
- pub fn get_primary_key_or ( & mut self , key : & Key ) -> & Key {
30
+ pub fn get_primary_key_or_insert ( & mut self , key : & Key ) -> & Key {
31
31
self . primary_key . get_or_insert ( key. clone ( ) )
32
32
}
33
33
}
@@ -50,8 +50,12 @@ impl Buffer {
50
50
}
51
51
52
52
/// Get the primary key of the buffer, if not exists, use `key` as the primary key.
53
- pub async fn get_primary_key_or ( & self , key : & Key ) -> Key {
54
- self . inner . lock ( ) . await . get_primary_key_or ( key) . clone ( )
53
+ pub async fn get_primary_key_or_insert ( & self , key : & Key ) -> Key {
54
+ self . inner
55
+ . lock ( )
56
+ . await
57
+ . get_primary_key_or_insert ( key)
58
+ . clone ( )
55
59
}
56
60
57
61
/// Get a value from the buffer.
Original file line number Diff line number Diff line change @@ -674,7 +674,7 @@ impl<PdC: PdClient> Transaction<PdC> {
674
674
let pairs = plan. execute ( ) . await ;
675
675
676
676
// primary key will be set here if needed
677
- self . buffer . get_primary_key_or ( & first_key) . await ;
677
+ self . buffer . get_primary_key_or_insert ( & first_key) . await ;
678
678
679
679
self . start_auto_heartbeat ( ) . await ;
680
680
You can’t perform that action at this time.
0 commit comments