fn cache(&mut self, buf: &[u8]) {
        loop {
            let ret = uio::pwrite(self.fd, buf, self.chunk.decompress_offset() as i64)
                .map_err(|_| last_error!());

            match ret {
                Ok(nr_write) => {
                    trace!(
                        "write {}(offset={}) bytes to cache file",
                        nr_write,
                        self.chunk.decompress_offset()
                    );
                    break;
                }
                Err(err) => {
                    // Retry if the IO is interrupted by signal.
                    if err.kind() != ErrorKind::Interrupted {
                        return;
                    }
                }
            }
        }

        self.set_ready();
    }
/// Persist a single chunk into local blob cache file. We have to write to the cache
/// file in unit of chunk size
Persist a single chunk into local blob cache file. We have to write to the cache
file in unit of chunk size
Persist a single chunk into local blob cache file . We have to write to the cache file in unit of chunk size
fn cache(&mut self, buf: &[u8]) {
        loop {
            let ret = uio::pwrite(self.fd, buf, self.chunk.decompress_offset() as i64)
                .map_err(|_| last_error!());
            match ret {
                Ok(nr_write) => {
                    trace!(
                        "write {}(offset={}) bytes to cache file",
                        nr_write,
                        self.chunk.decompress_offset()
                    );
                    break;
                }
                Err(err) => {
                    // Retry if the IO is interrupted by signal.
                    if err.kind() != ErrorKind::Interrupted {
                        return;
                    }
                }
            }
        }
        self.set_ready();
    }
fn cache ( & mut self , buf : & [ u8 ] ) { loop { let ret = uio :: pwrite ( self . fd , buf , self . chunk . decompress_offset ( ) as i64 ) . map_err ( | _ | last_error ! ( ) ) ; match ret { Ok ( nr_write ) => { trace ! ( " " nr_write self chunk decompress_offset ( ) ) ; break ; } Err ( err ) => { // Retry if the IO is interrupted by signal. if err . kind ( ) != ErrorKind :: Interrupted { return ; } } } } self . set_ready ( ) ; }
Persist a single chunk into local blob cache file.
Persist a single chunk into local blob cache file .
&mut self
buf
&[u8]
&mut self
buf
&[u8]