fn flush(&mut self, field: &Fields) {
        // Already empty
        if self.num_items[*field as usize] == 0 {
            return;
        }

        // Flush already compressed data
        let compress_task = self.compressor.get_compr_block();

        // Skips prefilled blocks in the beginning of program execution
        if compress_task.uncompr_size != 0 {
            self.write_data_and_update_meta(&compress_task);
        }

        let mut buf = compress_task.buf;
        std::mem::swap(&mut buf, &mut self.chunks[*field as usize]);
        let uncompr_size = self.offsets[*field as usize];
        let codec = self.file_meta.get_field_codec(field);

        self.compressor.compress_block(
            self.blocks_nums[*field as usize],
            *field,
            self.num_items[*field as usize],
            uncompr_size,
            buf,
            *codec,
        );
        self.blocks_nums[*field as usize] += 1;

        self.offsets[*field as usize] = 0;
        self.num_items[*field as usize] = 0;
    }
/// This method only schedules field for compression, it doesn't immediately
/// flush it to writer.
This method only schedules field for compression, it doesn't immediately
flush it to writer.
This method only schedules field for compression it doesn ' t immediately flush it to writer .
fn flush(&mut self, field: &Fields) {
        // Already empty
        if self.num_items[*field as usize] == 0 {
            return;
        }
        // Flush already compressed data
        let compress_task = self.compressor.get_compr_block();
        // Skips prefilled blocks in the beginning of program execution
        if compress_task.uncompr_size != 0 {
            self.write_data_and_update_meta(&compress_task);
        }
        let mut buf = compress_task.buf;
        std::mem::swap(&mut buf, &mut self.chunks[*field as usize]);
        let uncompr_size = self.offsets[*field as usize];
        let codec = self.file_meta.get_field_codec(field);
        self.compressor.compress_block(
            self.blocks_nums[*field as usize],
            *field,
            self.num_items[*field as usize],
            uncompr_size,
            buf,
            *codec,
        );
        self.blocks_nums[*field as usize] += 1;
        self.offsets[*field as usize] = 0;
        self.num_items[*field as usize] = 0;
    }
fn flush ( & mut self , field : & Fields ) { // Already empty if self . num_items [ * field as usize ] == 0 { return ; } // Flush already compressed data let compress_task = self . compressor . get_compr_block ( ) ; // Skips prefilled blocks in the beginning of program execution if compress_task . uncompr_size != 0 { self . write_data_and_update_meta ( & compress_task ) ; } let mut buf = compress_task . buf ; std :: mem :: swap ( & mut buf , & mut self . chunks [ * field as usize ] ) ; let uncompr_size = self . offsets [ * field as usize ] ; let codec = self . file_meta . get_field_codec ( field ) ; self . compressor . compress_block ( self . blocks_nums [ * field as usize ] , * field , self . num_items [ * field as usize ] , uncompr_size , buf , * codec , ) ; self . blocks_nums [ * field as usize ] += 1 ; self . offsets [ * field as usize ] = 0 ; self . num_items [ * field as usize ] = 0 ; }
This method only schedules field for compression, it doesn't immediately
flush it to writer.
This method only schedules field for compression it doesn ' t immediately flush it to writer .
&mut self
field
&Fields
&mut self
field
&Fields