Address comments

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
This commit is contained in:
Yilin Chen 2019-08-27 10:32:30 +08:00
parent a6505e5bbb
commit 8d02eea86e
No known key found for this signature in database
GPG Key ID: 353E7ED34BF326E0
2 changed files with 7 additions and 5 deletions

View File

@ -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,

View File

@ -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;