Turi Create  4.0
turi::read_caching_device< T > Class Template Reference

#include <core/storage/fileio/read_caching_device.hpp>

Public Member Functions

std::streamsize optimal_buffer_size () const
 
std::streampos seek (std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode openmode)
 
size_t file_size () const
 
std::shared_ptr< std::istream > get_underlying_stream ()
 Not supported.
 

Detailed Description

template<typename T>
class turi::read_caching_device< T >

Can be wrapped around any device implement to provide read caching. This should be used only when the filesystem we are accessing is rather remote. It uses the block_cache to cache large blocks on the cache:// file system.

Before:

typedef boost::iostreams::stream<s3_device> s3_fstream;

After:

typedef boost::iostreams::stream<read_caching_device<s3_device> > s3_fstream;

It uses the block_cache to pro

Definition at line 42 of file read_caching_device.hpp.

Member Function Documentation

◆ file_size()

template<typename T >
size_t turi::read_caching_device< T >::file_size ( ) const
inline

Returns the file size of the opened file. Returns (size_t)(-1) if there is no file opened, or if there is an error obtaining the file size.

Definition at line 172 of file read_caching_device.hpp.

◆ optimal_buffer_size()

template<typename T >
std::streamsize turi::read_caching_device< T >::optimal_buffer_size ( ) const
inline

the optimal buffer size is 0.

Definition at line 99 of file read_caching_device.hpp.

◆ seek()

template<typename T >
std::streampos turi::read_caching_device< T >::seek ( std::streamoff  off,
std::ios_base::seekdir  way,
std::ios_base::openmode  openmode 
)
inline

Seeks to a different location.

Definition at line 148 of file read_caching_device.hpp.


The documentation for this class was generated from the following file: