pub fn start_merge(&self, segment_ids: &[SegmentId]) -> TantivyResult<Vec<SegmentEntry>> {
        let registers_lock = self.read();
        let mut segment_entries = vec![];
        if registers_lock.uncommitted.contains_all(segment_ids) {
            for segment_id in segment_ids {
                let segment_entry = registers_lock.uncommitted
                    .get(segment_id)
                    .expect("Segment id not found {}. Should never happen because of the contains all if-block.");
                segment_entries.push(segment_entry);
            }
        } else if registers_lock.committed.contains_all(segment_ids) {
            for segment_id in segment_ids {
                let segment_entry = registers_lock.committed
                    .get(segment_id)
                    .expect("Segment id not found {}. Should never happen because of the contains all if-block.");
                segment_entries.push(segment_entry);
            }
        } else {
            let error_msg = "Merge operation sent for segments that are not \
                             all uncommited or commited."
                .to_string();
            return Err(TantivyError::InvalidArgument(error_msg));
        }
        Ok(segment_entries)
    }
/// Marks a list of segments as in merge.
///
/// Returns an error if some segments are missing, or if
/// the `segment_ids` are not either all committed or all
/// uncommitted.
Marks a list of segments as in merge.
Returns an error if some segments are missing, or if
the `segment_ids` are not either all committed or all
uncommitted.
Marks a list of segments as in merge . Returns an error if some segments are missing or if the ` segment_ids ` are not either all committed or all uncommitted .
pub fn start_merge(&self, segment_ids: &[SegmentId]) -> TantivyResult<Vec<SegmentEntry>> {
        let registers_lock = self.read();
        let mut segment_entries = vec![];
        if registers_lock.uncommitted.contains_all(segment_ids) {
            for segment_id in segment_ids {
                let segment_entry = registers_lock.uncommitted
                    .get(segment_id)
                    .expect("Segment id not found {}. Should never happen because of the contains all if-block.");
                segment_entries.push(segment_entry);
            }
        } else if registers_lock.committed.contains_all(segment_ids) {
            for segment_id in segment_ids {
                let segment_entry = registers_lock.committed
                    .get(segment_id)
                    .expect("Segment id not found {}. Should never happen because of the contains all if-block.");
                segment_entries.push(segment_entry);
            }
        } else {
            let error_msg = "Merge operation sent for segments that are not \
                             all uncommited or commited."
                .to_string();
            return Err(TantivyError::InvalidArgument(error_msg));
        }
        Ok(segment_entries)
    }
pub fn start_merge ( & self , segment_ids : & [ SegmentId ] ) -> TantivyResult < Vec < SegmentEntry > > { let registers_lock = self . read ( ) ; let mut segment_entries = vec ! [ ] ; if registers_lock . uncommitted . contains_all ( segment_ids ) { for segment_id in segment_ids { let segment_entry = registers_lock . uncommitted . get ( segment_id ) . expect ( " " ) ; segment_entries . push ( segment_entry ) ; } } else if registers_lock . committed . contains_all ( segment_ids ) { for segment_id in segment_ids { let segment_entry = registers_lock . committed . get ( segment_id ) . expect ( " " ) ; segment_entries . push ( segment_entry ) ; } } else { let error_msg = " \
 " . to_string ( ) ; return Err ( TantivyError :: InvalidArgument ( error_msg ) ) ; } Ok ( segment_entries ) }
Marks a list of segments as in merge.
Marks a list of segments as in merge .
&self
segment_ids
&[SegmentId]
&self
segment_ids
&[SegmentId]