Skip to content

Commit

Permalink
raftstore: Parameterize more of PollContext over engines
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Anderson <andersrb@gmail.com>
  • Loading branch information
brson committed Jul 20, 2020
1 parent 349f3bd commit cb5f064
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions components/raftstore/src/store/fsm/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ pub struct PollContext<EK, ER, T, C: 'static> where EK: KvEngine, ER: KvEngine {
pub global_stat: GlobalStoreStat,
pub store_stat: LocalStoreStat,
pub engines: KvEngines<EK, ER>,
pub kv_wb: RocksWriteBatch,
pub raft_wb: RocksWriteBatch,
pub kv_wb: EK::WriteBatch,
pub raft_wb: ER::WriteBatch,
pub pending_count: usize,
pub sync_log: bool,
pub has_ready: bool,
Expand All @@ -273,18 +273,18 @@ pub struct PollContext<EK, ER, T, C: 'static> where EK: KvEngine, ER: KvEngine {
pub node_start_time: Option<Instant>,
}

impl<EK, ER, T, C> HandleRaftReadyContext<RocksWriteBatch, RocksWriteBatch> for PollContext<EK, ER, T, C> where EK: KvEngine, ER: KvEngine {
fn wb_mut(&mut self) -> (&mut RocksWriteBatch, &mut RocksWriteBatch) {
impl<EK, ER, T, C> HandleRaftReadyContext<EK::WriteBatch, ER::WriteBatch> for PollContext<EK, ER, T, C> where EK: KvEngine, ER: KvEngine {
fn wb_mut(&mut self) -> (&mut EK::WriteBatch, &mut ER::WriteBatch) {
(&mut self.kv_wb, &mut self.raft_wb)
}

#[inline]
fn kv_wb_mut(&mut self) -> &mut RocksWriteBatch {
fn kv_wb_mut(&mut self) -> &mut EK::WriteBatch {
&mut self.kv_wb
}

#[inline]
fn raft_wb_mut(&mut self) -> &mut RocksWriteBatch {
fn raft_wb_mut(&mut self) -> &mut ER::WriteBatch {
&mut self.raft_wb
}

Expand Down

0 comments on commit cb5f064

Please sign in to comment.