pub fn snapshot_to_queryable_batch(
        &mut self,
        table_name: &str,
        tombstone: Option<Tombstone>,
    ) -> Option<QueryableBatch> {
        self.snapshot()
            .expect("This mutable batch snapshot error should be impossible.");

        let mut data = vec![];
        std::mem::swap(&mut data, &mut self.snapshots);

        let mut tombstones = vec![];
        if let Some(tombstone) = tombstone {
            tombstones.push(tombstone);
        }

        // only produce batch if there is any data
        if data.is_empty() {
            None
        } else {
            Some(QueryableBatch::new(table_name, data, tombstones))
        }
    }
/// Snapshots the buffer and make a QueryableBatch for all the snapshots
/// Both buffer and snapshots will be empty after this
Snapshots the buffer and make a QueryableBatch for all the snapshots
Both buffer and snapshots will be empty after this
Snapshots the buffer and make a QueryableBatch for all the snapshots Both buffer and snapshots will be empty after this
pub fn snapshot_to_queryable_batch(
        &mut self,
        table_name: &str,
        tombstone: Option<Tombstone>,
    ) -> Option<QueryableBatch> {
        self.snapshot()
            .expect("This mutable batch snapshot error should be impossible.");
        let mut data = vec![];
        std::mem::swap(&mut data, &mut self.snapshots);
        let mut tombstones = vec![];
        if let Some(tombstone) = tombstone {
            tombstones.push(tombstone);
        }
        // only produce batch if there is any data
        if data.is_empty() {
            None
        } else {
            Some(QueryableBatch::new(table_name, data, tombstones))
        }
    }
pub fn snapshot_to_queryable_batch ( & mut self , table_name : & str , tombstone : Option < Tombstone > , ) -> Option < QueryableBatch > { self . snapshot ( ) . expect ( " " ) ; let mut data = vec ! [ ] ; std :: mem :: swap ( & mut data , & mut self . snapshots ) ; let mut tombstones = vec ! [ ] ; if let Some ( tombstone ) = tombstone { tombstones . push ( tombstone ) ; } // only produce batch if there is any data if data . is_empty ( ) { None } else { Some ( QueryableBatch :: new ( table_name , data , tombstones ) ) } }
Snapshots the buffer and make a QueryableBatch for all the snapshots
Both buffer and snapshots will be empty after this
Snapshots the buffer and make a QueryableBatch for all the snapshots Both buffer and snapshots will be empty after this
&mut self
table_name
&str
tombstone
Option<Tombstone>
&mut self
table_name
&str
tombstone
Option<Tombstone>