mirror of https://github.com/tikv/client-rust.git
Address comments
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
This commit is contained in:
parent
a6505e5bbb
commit
8d02eea86e
|
@ -28,6 +28,11 @@ mod transaction;
|
|||
const PHYSICAL_SHIFT_BITS: i64 = 18;
|
||||
const LOGICAL_MASK: i64 = (1 << PHYSICAL_SHIFT_BITS) - 1;
|
||||
|
||||
/// A timestamp returned from the timestamp oracle.
|
||||
///
|
||||
/// The version used in transactions can be converted from a timestamp.
|
||||
/// The lower 18 (PHYSICAL_SHIFT_BITS) bits are the logical part of the timestamp.
|
||||
/// The higher bits of the version are the physical part of the timestamp.
|
||||
#[derive(Eq, PartialEq, Debug, Clone, Copy)]
|
||||
pub struct Timestamp {
|
||||
pub physical: i64,
|
||||
|
|
|
@ -243,10 +243,7 @@ impl KvRequest for kvrpcpb::ResolveLockRequest {
|
|||
fn reduce(
|
||||
results: BoxStream<'static, Result<Self::Result>>,
|
||||
) -> BoxFuture<'static, Result<Self::Result>> {
|
||||
results
|
||||
.into_future()
|
||||
.map(|(f, _)| f.expect("no results should be impossible"))
|
||||
.boxed()
|
||||
results.try_collect().boxed()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,7 +263,7 @@ pub fn new_resolve_lock_request(
|
|||
// TODO: Add lite resolve lock (resolve specified locks only)
|
||||
|
||||
impl KvRequest for kvrpcpb::CleanupRequest {
|
||||
/// Commit version if the key is commiitted, 0 otherwise.
|
||||
/// Commit version if the key is committed, 0 otherwise.
|
||||
type Result = u64;
|
||||
type RpcResponse = kvrpcpb::CleanupResponse;
|
||||
type KeyData = Key;
|
||||
|
|
Loading…
Reference in New Issue