Skip to content

Commit

Permalink
raftstore: Convert to engine_traits
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Anderson <andersrb@gmail.com>
  • Loading branch information
brson committed Feb 26, 2020
1 parent 4de8507 commit f7279bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/raftstore/src/store/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ pub trait StoreRouter {
fn send(&self, msg: StoreMsg) -> Result<()>;
}

impl CasualRouter<RocksEngine> for RaftRouter<RocksEngine> {
impl<E: KvEngine> CasualRouter<E> for RaftRouter<E> {
#[inline]
fn send(&self, region_id: u64, msg: CasualMessage<RocksEngine>) -> Result<()> {
fn send(&self, region_id: u64, msg: CasualMessage<E>) -> Result<()> {
match self.router.send(region_id, PeerMsg::CasualMessage(msg)) {
Ok(()) => Ok(()),
Err(TrySendError::Full(_)) => Err(Error::Transport(DiscardReason::Full)),
Expand Down Expand Up @@ -65,8 +65,8 @@ impl StoreRouter for RaftRouter<RocksEngine> {
}
}

impl CasualRouter<RocksEngine> for mpsc::SyncSender<(u64, CasualMessage<RocksEngine>)> {
fn send(&self, region_id: u64, msg: CasualMessage<RocksEngine>) -> Result<()> {
impl<E: KvEngine> CasualRouter<E> for mpsc::SyncSender<(u64, CasualMessage<E>)> {
fn send(&self, region_id: u64, msg: CasualMessage<E>) -> Result<()> {
match self.try_send((region_id, msg)) {
Ok(()) => Ok(()),
Err(mpsc::TrySendError::Disconnected(_)) => {
Expand Down

0 comments on commit f7279bc

Please sign in to comment.