/// Returns the chunks in the requested sort order
Returns the chunks in the requested sort order
Returns the chunks in the requested sort order
pub fn chunks_sorted_by(&self, sort_rules: &SortOrder) -> Vec<Arc<RwLock<Chunk>>> {
        let mut chunks = self.chunks();
        match &sort_rules.sort {
            // The first write is technically not the created time but is in practice close enough
            Sort::CreatedAtTime => chunks.sort_by_cached_key(|x| x.read().time_of_first_write()),
            Sort::LastWriteTime => chunks.sort_by_cached_key(|x| x.read().time_of_last_write()),
            Sort::Column(_name, _data_type, _val) => {
                unimplemented!()
            }
        }
        if sort_rules.order == Order::Desc {
            chunks.reverse();
        }
        chunks
    }
pub fn chunks_sorted_by ( & self , sort_rules : & SortOrder ) -> Vec < Arc < RwLock < Chunk > > > { let mut chunks = self . chunks ( ) ; match & sort_rules . sort { // The first write is technically not the created time but is in practice close enough Sort :: CreatedAtTime => chunks . sort_by_cached_key ( | x | x . read ( ) . time_of_first_write ( ) ) , Sort :: LastWriteTime => chunks . sort_by_cached_key ( | x | x . read ( ) . time_of_last_write ( ) ) , Sort :: Column ( _name , _data_type , _val ) => { unimplemented ! ( ) } } if sort_rules . order == Order :: Desc { chunks . reverse ( ) ; } chunks }
Returns the chunks in the requested sort order
Returns the chunks in the requested sort order
&self
sort_rules
&SortOrder