pub fn rewrite_key(&mut self, key: Vec<u8>, gate: Option<FileSeq>, seq: FileSeq) {
        self.global_stats.add(LogQueue::Rewrite, 1);
        if let Some(origin) = self.kvs.get_mut(&key) {
            if origin.1.queue == LogQueue::Append {
                if let Some(gate) = gate {
                    if origin.1.seq <= gate {
                        origin.1 = FileId {
                            queue: LogQueue::Rewrite,
                            seq,
                        };
                        self.global_stats.delete(LogQueue::Append, 1);
                        return;
                    }
                }
            } else {
                assert!(origin.1.seq <= seq);
                origin.1.seq = seq;
            }
        }
        self.global_stats.delete(LogQueue::Rewrite, 1);
    }
/// Rewrites a key by marking its location to the `seq`-th log file in
/// rewrite queue. No-op if the key does not exist.
///
/// When `gate` is present, only append data no newer than it will be
/// rewritten.
Rewrites a key by marking its location to the `seq`-th log file in
rewrite queue. No-op if the key does not exist.

When `gate` is present, only append data no newer than it will be
rewritten.
Rewrites a key by marking its location to the ` seq ` - th log file in rewrite queue . No - op if the key does not exist . When ` gate ` is present only append data no newer than it will be rewritten .
pub fn rewrite_key(&mut self, key: Vec<u8>, gate: Option<FileSeq>, seq: FileSeq) {
        self.global_stats.add(LogQueue::Rewrite, 1);
        if let Some(origin) = self.kvs.get_mut(&key) {
            if origin.1.queue == LogQueue::Append {
                if let Some(gate) = gate {
                    if origin.1.seq <= gate {
                        origin.1 = FileId {
                            queue: LogQueue::Rewrite,
                            seq,
                        };
                        self.global_stats.delete(LogQueue::Append, 1);
                        return;
                    }
                }
            } else {
                assert!(origin.1.seq <= seq);
                origin.1.seq = seq;
            }
        }
        self.global_stats.delete(LogQueue::Rewrite, 1);
    }
pub fn rewrite_key ( & mut self , key : Vec < u8 > , gate : Option < FileSeq > , seq : FileSeq ) { self . global_stats . add ( LogQueue :: Rewrite , 1 ) ; if let Some ( origin ) = self . kvs . get_mut ( & key ) { if origin . 1 . queue == LogQueue :: Append { if let Some ( gate ) = gate { if origin . 1 . seq <= gate { origin . 1 = FileId { queue : LogQueue :: Rewrite , seq , } ; self . global_stats . delete ( LogQueue :: Append , 1 ) ; return ; } } } else { assert ! ( origin 1 seq seq ) ; origin . 1 . seq = seq ; } } self . global_stats . delete ( LogQueue :: Rewrite , 1 ) ; }
Rewrites a key by marking its location to the `seq`-th log file in
rewrite queue.
Rewrites a key by marking its location to the ` seq ` - th log file in rewrite queue .
&mut self
key
Vec<u8>
gate
Option<FileSeq>
seq
FileSeq