drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::internal::io_cache_st Class Reference
Collaboration diagram for drizzled::internal::io_cache_st:
[legend]

Public Types

typedef int(* IO_CACHE_CALLBACK) (io_cache_st *)

Public Member Functions

int get ()
 Read one byte when buffer is empty.
int block_write (const void *, size_t, my_off_t)
void close_cached_file ()
bool real_open_cached_file ()
int end_io_cache ()
 Free an io_cache_st object.
int init_io_cache (int file, size_t cachesize, cache_type type, my_off_t seek_offset, bool use_async_io, myf cache_myflags)
 Initialize an io_cache_st object.
void init_functions ()
bool reinit_io_cache (cache_type type_arg, my_off_t seek_offset, bool use_async_io, bool clear_cache)
 Reset the cache.
void setup_io_cache ()
 Setup internal pointers inside io_cache_st.
bool open_cached_file (const char *dir, const char *prefix, size_t cache_size, myf cache_myflags)
int flush (int need_append_buffer_lock=1)
void clear ()
bool inited () const
my_off_t tell () const
int read (void *Buffer0, size_t Count)
int write (const void *Buffer0, size_t Count)

Public Attributes

my_off_t pos_in_file
my_off_t end_of_file
unsigned char * read_pos
unsigned char * read_end
unsigned char * buffer
unsigned char * request_pos
unsigned char * write_buffer
unsigned char * append_read_pos
unsigned char * write_pos
unsigned char * write_end
unsigned char ** current_pos
unsigned char ** current_end
int(* read_function )(io_cache_st *, unsigned char *, size_t)
int(* write_function )(io_cache_st *, const unsigned char *, size_t)
cache_type type
int error
IO_CACHE_CALLBACK pre_read
IO_CACHE_CALLBACK post_read
IO_CACHE_CALLBACK pre_close
void * arg
char * file_name
char * dir
char * prefix
int file
int seek_not_done
size_t buffer_length
size_t read_length
myf myflags
bool alloced_buffer

Detailed Description

Definition at line 30 of file iocache.h.

Member Typedef Documentation

◆ IO_CACHE_CALLBACK

typedef int(* drizzled::internal::io_cache_st::IO_CACHE_CALLBACK) (io_cache_st *)

Definition at line 33 of file iocache.h.

Constructor & Destructor Documentation

◆ io_cache_st()

drizzled::internal::io_cache_st::io_cache_st ( )
inline

Definition at line 128 of file iocache.h.

Member Function Documentation

◆ block_write()

int drizzled::internal::io_cache_st::block_write ( const void * Buffer,
size_t Count,
my_off_t pos )

Definition at line 595 of file mf_iocache.cc.

◆ clear()

void drizzled::internal::io_cache_st::clear ( )
inline

Definition at line 173 of file iocache.h.

◆ close_cached_file()

void drizzled::internal::io_cache_st::close_cached_file ( )

Definition at line 74 of file iocache.cc.

◆ end_io_cache()

int drizzled::internal::io_cache_st::end_io_cache ( )

Free an io_cache_st object.

@detail It's currently safe to call this if one has called init_io_cache() on the 'info' object, even if init_io_cache() failed. This function is also safe to call twice with the same handle.

Parameters
infoio_cache_st Handle to free
Return values
0ok
#Error

Definition at line 685 of file mf_iocache.cc.

◆ flush()

int drizzled::internal::io_cache_st::flush ( int need_append_buffer_lock = 1)

Definition at line 666 of file mf_iocache.cc.

◆ get()

int drizzled::internal::io_cache_st::get ( )

Read one byte when buffer is empty.

Definition at line 473 of file mf_iocache.cc.

◆ init_functions()

void drizzled::internal::io_cache_st::init_functions ( )

Definition at line 137 of file mf_iocache.cc.

◆ init_io_cache()

int drizzled::internal::io_cache_st::init_io_cache ( int file_arg,
size_t cachesize,
cache_type type,
my_off_t seek_offset,
bool use_async_io,
myf cache_myflags )

Initialize an io_cache_st object.

Parameters
fileFile that should be associated with the handler If == -1 then real_open_cached_file() will be called when it's time to open file.
cachesizeSize of buffer to allocate for read/write If == 0 then use my_default_record_cache_size
typeType of cache
seek_offsetWhere cache should start reading/writing
use_async_ioSet to 1 if we should use async_io (if avaiable)
cache_myflagsBitmap of different flags MY_WME | MY_FAE | MY_NABP | MY_FNABP | MY_DONT_CHECK_FILESIZE
Return values
0success
#error

Definition at line 174 of file mf_iocache.cc.

◆ inited()

bool drizzled::internal::io_cache_st::inited ( ) const
inline

Definition at line 178 of file iocache.h.

◆ open_cached_file()

bool drizzled::internal::io_cache_st::open_cached_file ( const char * dir,
const char * prefix,
size_t cache_size,
myf cache_myflags )

Definition at line 37 of file iocache.cc.

◆ read()

int drizzled::internal::io_cache_st::read ( void * Buffer0,
size_t Count )
inline

Definition at line 188 of file iocache.h.

◆ real_open_cached_file()

bool drizzled::internal::io_cache_st::real_open_cached_file ( )

Definition at line 60 of file iocache.cc.

◆ reinit_io_cache()

bool drizzled::internal::io_cache_st::reinit_io_cache ( cache_type type_arg,
my_off_t seek_offset,
bool use_async_io,
bool clear_cache )

Reset the cache.

@detail Use this to reset cache to re-start reading or to change the type between READ_CACHE <-> WRITE_CACHE If we are doing a reinit of a cache where we have the start of the file in the cache, we are reusing this memory without flushing it to disk.

Definition at line 280 of file mf_iocache.cc.

◆ setup_io_cache()

void drizzled::internal::io_cache_st::setup_io_cache ( )

Setup internal pointers inside io_cache_st.

This is called on automatically on init or reinit of io_cache_st It must be called externally if one moves or copies an io_cache_st object.

Parameters
infoCache handler to setup

Definition at line 121 of file mf_iocache.cc.

◆ tell()

my_off_t drizzled::internal::io_cache_st::tell ( ) const
inline

Definition at line 183 of file iocache.h.

◆ write()

int drizzled::internal::io_cache_st::write ( const void * Buffer0,
size_t Count )
inline

Definition at line 198 of file iocache.h.

Member Data Documentation

◆ alloced_buffer

bool drizzled::internal::io_cache_st::alloced_buffer

Definition at line 126 of file iocache.h.

◆ append_read_pos

unsigned char* drizzled::internal::io_cache_st::append_read_pos

Definition at line 59 of file iocache.h.

◆ arg

void* drizzled::internal::io_cache_st::arg

Definition at line 103 of file iocache.h.

◆ buffer

unsigned char* drizzled::internal::io_cache_st::buffer

Definition at line 47 of file iocache.h.

◆ buffer_length

size_t drizzled::internal::io_cache_st::buffer_length

Definition at line 116 of file iocache.h.

◆ current_end

unsigned char ** drizzled::internal::io_cache_st::current_end

Definition at line 71 of file iocache.h.

◆ current_pos

unsigned char** drizzled::internal::io_cache_st::current_pos

Definition at line 71 of file iocache.h.

◆ dir

char* drizzled::internal::io_cache_st::dir

Definition at line 105 of file iocache.h.

◆ end_of_file

my_off_t drizzled::internal::io_cache_st::end_of_file

Definition at line 42 of file iocache.h.

◆ error

int drizzled::internal::io_cache_st::error

Definition at line 92 of file iocache.h.

◆ file

int drizzled::internal::io_cache_st::file

Definition at line 106 of file iocache.h.

◆ file_name

char* drizzled::internal::io_cache_st::file_name

Definition at line 104 of file iocache.h.

◆ myflags

myf drizzled::internal::io_cache_st::myflags

Definition at line 119 of file iocache.h.

◆ pos_in_file

my_off_t drizzled::internal::io_cache_st::pos_in_file

Definition at line 36 of file iocache.h.

◆ post_read

IO_CACHE_CALLBACK drizzled::internal::io_cache_st::post_read

Definition at line 101 of file iocache.h.

◆ pre_close

IO_CACHE_CALLBACK drizzled::internal::io_cache_st::pre_close

Definition at line 102 of file iocache.h.

◆ pre_read

IO_CACHE_CALLBACK drizzled::internal::io_cache_st::pre_read

Definition at line 100 of file iocache.h.

◆ prefix

char * drizzled::internal::io_cache_st::prefix

Definition at line 105 of file iocache.h.

◆ read_end

unsigned char* drizzled::internal::io_cache_st::read_end

Definition at line 46 of file iocache.h.

◆ read_function

int(* drizzled::internal::io_cache_st::read_function) (io_cache_st *,unsigned char *, size_t)

Definition at line 80 of file iocache.h.

◆ read_length

size_t drizzled::internal::io_cache_st::read_length

Definition at line 118 of file iocache.h.

◆ read_pos

unsigned char* drizzled::internal::io_cache_st::read_pos

Definition at line 44 of file iocache.h.

◆ request_pos

unsigned char* drizzled::internal::io_cache_st::request_pos

Definition at line 49 of file iocache.h.

◆ seek_not_done

int drizzled::internal::io_cache_st::seek_not_done

Definition at line 114 of file iocache.h.

◆ type

cache_type drizzled::internal::io_cache_st::type

Definition at line 91 of file iocache.h.

◆ write_buffer

unsigned char* drizzled::internal::io_cache_st::write_buffer

Definition at line 52 of file iocache.h.

◆ write_end

unsigned char* drizzled::internal::io_cache_st::write_end

Definition at line 63 of file iocache.h.

◆ write_function

int(* drizzled::internal::io_cache_st::write_function) (io_cache_st *,const unsigned char *, size_t)

Definition at line 85 of file iocache.h.

◆ write_pos

unsigned char* drizzled::internal::io_cache_st::write_pos

Definition at line 61 of file iocache.h.


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