pub fn apply_replayed_rewrite_writes(&self, log_items: LogItemDrain) {
        for item in log_items {
            let raft = item.raft_group_id;
            let memtable = self.get_or_insert(raft);
            match item.content {
                LogItemContent::EntryIndexes(entries_to_add) => {
                    memtable.write().append_rewrite(entries_to_add.0);
                }
                LogItemContent::Command(Command::Clean) => {
                    self.remove(raft, false /* record_tombstone */);
                }
                LogItemContent::Command(Command::Compact { index }) => {
                    memtable.write().compact_to(index);
                }
                LogItemContent::Kv(kv) => match kv.op_type {
                    OpType::Put => {
                        let value = kv.value.unwrap();
                        memtable.write().put(kv.key, value, kv.file_id.unwrap());
                    }
                    OpType::Del => {
                        let key = kv.key;
                        memtable.write().delete(key.as_slice());
                    }
                },
            }
        }
    }
/// Applies changes from log items that are replayed from a rewrite queue.
/// Assumes it haven't applied any append data.
///
/// This method is only used for recovery.
Applies changes from log items that are replayed from a rewrite queue.
Assumes it haven't applied any append data.

This method is only used for recovery.
Applies changes from log items that are replayed from a rewrite queue . Assumes it haven ' t applied any append data . This method is only used for recovery .
pub fn apply_replayed_rewrite_writes(&self, log_items: LogItemDrain) {
        for item in log_items {
            let raft = item.raft_group_id;
            let memtable = self.get_or_insert(raft);
            match item.content {
                LogItemContent::EntryIndexes(entries_to_add) => {
                    memtable.write().append_rewrite(entries_to_add.0);
                }
                LogItemContent::Command(Command::Clean) => {
                    self.remove(raft, false /* record_tombstone */);
                }
                LogItemContent::Command(Command::Compact { index }) => {
                    memtable.write().compact_to(index);
                }
                LogItemContent::Kv(kv) => match kv.op_type {
                    OpType::Put => {
                        let value = kv.value.unwrap();
                        memtable.write().put(kv.key, value, kv.file_id.unwrap());
                    }
                    OpType::Del => {
                        let key = kv.key;
                        memtable.write().delete(key.as_slice());
                    }
                },
            }
        }
    }
pub fn apply_replayed_rewrite_writes ( & self , log_items : LogItemDrain ) { for item in log_items { let raft = item . raft_group_id ; let memtable = self . get_or_insert ( raft ) ; match item . content { LogItemContent :: EntryIndexes ( entries_to_add ) => { memtable . write ( ) . append_rewrite ( entries_to_add . 0 ) ; } LogItemContent :: Command ( Command :: Clean ) => { self . remove ( raft , false /* record_tombstone */ ) ; } LogItemContent :: Command ( Command :: Compact { index } ) => { memtable . write ( ) . compact_to ( index ) ; } LogItemContent :: Kv ( kv ) => match kv . op_type { OpType :: Put => { let value = kv . value . unwrap ( ) ; memtable . write ( ) . put ( kv . key , value , kv . file_id . unwrap ( ) ) ; } OpType :: Del => { let key = kv . key ; memtable . write ( ) . delete ( key . as_slice ( ) ) ; } } , } } }
Applies changes from log items that are replayed from a rewrite queue.
Applies changes from log items that are replayed from a rewrite queue .
&self
log_items
LogItemDrain