fn dump_mvccs_infos(
        &self,
        from: Vec<u8>,
        to: Vec<u8>,
        mut limit: u64,
        cfs: Vec<&str>,
        start_ts: Option<u64>,
        commit_ts: Option<u64>,
    ) {
        if !from.starts_with(b"z") || (!to.is_empty() && !to.starts_with(b"z")) {
            eprintln!("from and to should start with \"z\"");
            process::exit(-1);
        }
        if !to.is_empty() && to < from {
            eprintln!("\"to\" must be greater than \"from\"");
            process::exit(-1);
        }

        let point_query = to.is_empty() && limit == 0;
        if point_query {
            limit = 1;
        }

        let scan_future = self.get_mvcc_infos(from.clone(), to, limit).for_each(
            move |(key, mvcc)| {
                if point_query && key != from {
                    println!("no mvcc infos for {}", escape(&from));
                }

                println!("key: {}", escape(&key));
                if cfs.contains(&CF_LOCK) && mvcc.has_lock() {
                    let lock_info = mvcc.get_lock();
                    if start_ts.map_or(true, |ts| lock_info.get_start_ts() == ts) {
                        println!("\tlock cf value: {:?}", lock_info);
                    }
                }
                if cfs.contains(&CF_DEFAULT) {
                    for value_info in mvcc.get_values() {
                        if commit_ts.map_or(true, |ts| value_info.get_start_ts() == ts) {
                            println!("\tdefault cf value: {:?}", value_info);
                        }
                    }
                }
                if cfs.contains(&CF_WRITE) {
                    for write_info in mvcc.get_writes() {
                        if start_ts.map_or(true, |ts| write_info.get_start_ts() == ts)
                            && commit_ts.map_or(true, |ts| write_info.get_commit_ts() == ts)
                        {
                            println!("\t write cf value: {:?}", write_info);
                        }
                    }
                }
                println!();
                future::ok::<(), String>(())
            },
        );
        if let Err(e) = scan_future.wait() {
            eprintln!("{}", e);
            process::exit(-1);
        }
    }
/// Dump mvcc infos for a given key range. The given `from` and `to` must
/// be raw key with `z` prefix. Both `to` and `limit` are empty value means
/// what we want is point query instead of range scan.
Dump mvcc infos for a given key range.
Dump mvcc infos for a given key range .
fn dump_mvccs_infos(
        &self,
        from: Vec<u8>,
        to: Vec<u8>,
        mut limit: u64,
        cfs: Vec<&str>,
        start_ts: Option<u64>,
        commit_ts: Option<u64>,
    ) {
        if !from.starts_with(b"z") || (!to.is_empty() && !to.starts_with(b"z")) {
            eprintln!("from and to should start with \"z\"");
            process::exit(-1);
        }
        if !to.is_empty() && to < from {
            eprintln!("\"to\" must be greater than \"from\"");
            process::exit(-1);
        }
        let point_query = to.is_empty() && limit == 0;
        if point_query {
            limit = 1;
        }
        let scan_future = self.get_mvcc_infos(from.clone(), to, limit).for_each(
            move |(key, mvcc)| {
                if point_query && key != from {
                    println!("no mvcc infos for {}", escape(&from));
                }
                println!("key: {}", escape(&key));
                if cfs.contains(&CF_LOCK) && mvcc.has_lock() {
                    let lock_info = mvcc.get_lock();
                    if start_ts.map_or(true, |ts| lock_info.get_start_ts() == ts) {
                        println!("\tlock cf value: {:?}", lock_info);
                    }
                }
                if cfs.contains(&CF_DEFAULT) {
                    for value_info in mvcc.get_values() {
                        if commit_ts.map_or(true, |ts| value_info.get_start_ts() == ts) {
                            println!("\tdefault cf value: {:?}", value_info);
                        }
                    }
                }
                if cfs.contains(&CF_WRITE) {
                    for write_info in mvcc.get_writes() {
                        if start_ts.map_or(true, |ts| write_info.get_start_ts() == ts)
                            && commit_ts.map_or(true, |ts| write_info.get_commit_ts() == ts)
                        {
                            println!("\t write cf value: {:?}", write_info);
                        }
                    }
                }
                println!();
                future::ok::<(), String>(())
            },
        );
        if let Err(e) = scan_future.wait() {
            eprintln!("{}", e);
            process::exit(-1);
        }
    }
fn dump_mvccs_infos ( & self , from : Vec < u8 > , to : Vec < u8 > , mut limit : u64 , cfs : Vec < & str > , start_ts : Option < u64 > , commit_ts : Option < u64 > , ) { if ! from . starts_with ( b" " ) || ( ! to . is_empty ( ) && ! to . starts_with ( b" " ) ) { eprintln ! ( " \" \" " ) ; process :: exit ( - 1 ) ; } if ! to . is_empty ( ) && to < from { eprintln ! ( " \" \" \" \" " ) ; process :: exit ( - 1 ) ; } let point_query = to . is_empty ( ) && limit == 0 ; if point_query { limit = 1 ; } let scan_future = self . get_mvcc_infos ( from . clone ( ) , to , limit ) . for_each ( move | ( key , mvcc ) | { if point_query && key != from { println ! ( " " escape ( from ) ) ; } println ! ( " " escape ( key ) ) ; if cfs . contains ( & CF_LOCK ) && mvcc . has_lock ( ) { let lock_info = mvcc . get_lock ( ) ; if start_ts . map_or ( true , | ts | lock_info . get_start_ts ( ) == ts ) { println ! ( " \t " lock_info ) ; } } if cfs . contains ( & CF_DEFAULT ) { for value_info in mvcc . get_values ( ) { if commit_ts . map_or ( true , | ts | value_info . get_start_ts ( ) == ts ) { println ! ( " \t " value_info ) ; } } } if cfs . contains ( & CF_WRITE ) { for write_info in mvcc . get_writes ( ) { if start_ts . map_or ( true , | ts | write_info . get_start_ts ( ) == ts ) && commit_ts . map_or ( true , | ts | write_info . get_commit_ts ( ) == ts ) { println ! ( " \t " write_info ) ; } } } println ! ( ) ; future :: ok :: < ( ) , String > ( ( ) ) } , ) ; if let Err ( e ) = scan_future . wait ( ) { eprintln ! ( " " e ) ; process :: exit ( - 1 ) ; } }
Dump mvcc infos for a given key range.
Dump mvcc infos for a given key range .
&self
from
Vec<u8>
to
Vec<u8>
limit
u64
cfs
Vec<&str>
start_ts
Option<u64>
commit_ts
Option<u64>