Skip to content

Commit

Permalink
server: implement full raft client (tikv#8498)
Browse files Browse the repository at this point in the history
This is the second PR extracted from tikv#6228. See also tikv#8475.

This PR adds the missing implement of raft client.

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
  • Loading branch information
BusyJay committed Aug 25, 2020
1 parent 63fe83e commit e090563
Show file tree
Hide file tree
Showing 3 changed files with 317 additions and 65 deletions.
2 changes: 1 addition & 1 deletion components/tikv_util/src/future_pool/mod.rs
Expand Up @@ -17,7 +17,7 @@ use futures03::channel::oneshot::{self, Canceled};
use prometheus::{Histogram, IntCounter, IntGauge};
use yatp::task::future;

type ThreadPool = yatp::ThreadPool<future::TaskCell>;
pub type ThreadPool = yatp::ThreadPool<future::TaskCell>;

use crate::time::Instant;
use yatp::pool::Local;
Expand Down
11 changes: 11 additions & 0 deletions components/tikv_util/src/lru.rs
Expand Up @@ -229,6 +229,17 @@ where
None => None,
}
}

#[inline]
pub fn get_mut(&mut self, key: &K) -> Option<&mut V> {
match self.map.get_mut(key) {
Some(v) => {
self.trace.maybe_promote(v.record);
Some(&mut v.value)
}
None => None,
}
}
}

unsafe impl<K: Send, V: Send> Send for LruCache<K, V> {}
Expand Down

0 comments on commit e090563

Please sign in to comment.