pub fn insert(
        &mut self,
        region_id: u64,
        start_key: Vec<u8>,
        end_key: Vec<u8>,
        timeout: time::Instant,
    ) {
        if !self.find_overlap_ranges(&start_key, &end_key).is_empty() {
            panic!(
                "[region {}] register deleting data in [{}, {}) failed due to overlap",
                region_id,
                escape(&start_key),
                escape(&end_key),
            );
        }
        let info = StalePeerInfo {
            region_id,
            end_key,
            timeout,
        };
        self.ranges.insert(start_key, info);
    }
// before an insert is called, must call drain_overlap_ranges to clean the overlap range
before an insert is called, must call drain_overlap_ranges to clean the overlap range
before an insert is called must call drain_overlap_ranges to clean the overlap range
pub fn insert(
        &mut self,
        region_id: u64,
        start_key: Vec<u8>,
        end_key: Vec<u8>,
        timeout: time::Instant,
    ) {
        if !self.find_overlap_ranges(&start_key, &end_key).is_empty() {
            panic!(
                "[region {}] register deleting data in [{}, {}) failed due to overlap",
                region_id,
                escape(&start_key),
                escape(&end_key),
            );
        }
        let info = StalePeerInfo {
            region_id,
            end_key,
            timeout,
        };
        self.ranges.insert(start_key, info);
    }
pub fn insert ( & mut self , region_id : u64 , start_key : Vec < u8 > , end_key : Vec < u8 > , timeout : time :: Instant , ) { if ! self . find_overlap_ranges ( & start_key , & end_key ) . is_empty ( ) { panic ! ( " " region_id escape ( start_key ) escape ( end_key ) ) ; } let info = StalePeerInfo { region_id , end_key , timeout , } ; self . ranges . insert ( start_key , info ) ; }
before an insert is called, must call drain_overlap_ranges to clean the overlap range
before an insert is called must call drain_overlap_ranges to clean the overlap range
&mut self
region_id
u64
start_key
Vec<u8>
end_key
Vec<u8>
timeout
time::Instant