pub fn apply_append_writes(&self, log_items: LogItemDrain) {
        for item in log_items {
            let raft = item.raft_group_id;
            let memtable = self.get_or_insert(raft);
            fail_point!(
                "memtable_accessor::apply_append_writes::region_3",
                raft == 3,
                |_| {}
            );
            match item.content {
                LogItemContent::EntryIndexes(entries_to_add) => {
                    memtable.write().append(entries_to_add.0);
                }
                LogItemContent::Command(Command::Clean) => {
                    self.remove(raft, true /* 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 have been written to append queue.
Applies changes from log items that have been written to append queue.
Applies changes from log items that have been written to append queue .
pub fn apply_append_writes(&self, log_items: LogItemDrain) {
        for item in log_items {
            let raft = item.raft_group_id;
            let memtable = self.get_or_insert(raft);
            fail_point!(
                "memtable_accessor::apply_append_writes::region_3",
                raft == 3,
                |_| {}
            );
            match item.content {
                LogItemContent::EntryIndexes(entries_to_add) => {
                    memtable.write().append(entries_to_add.0);
                }
                LogItemContent::Command(Command::Clean) => {
                    self.remove(raft, true /* 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_append_writes ( & self , log_items : LogItemDrain ) { for item in log_items { let raft = item . raft_group_id ; let memtable = self . get_or_insert ( raft ) ; fail_point ! ( " " raft 3 { } ) ; match item . content { LogItemContent :: EntryIndexes ( entries_to_add ) => { memtable . write ( ) . append ( entries_to_add . 0 ) ; } LogItemContent :: Command ( Command :: Clean ) => { self . remove ( raft , true /* 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 have been written to append queue.
Applies changes from log items that have been written to append queue .
&self
log_items
LogItemDrain