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 |
| int drizzled::internal::io_cache_st::end_io_cache | ( | ) |
Free an io_cache_st object.
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.
| info | io_cache_st Handle to free |
| 0 | ok |
| # | Error |
Definition at line 685 of file mf_iocache.cc.
| 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.
| file | File that should be associated with the handler If == -1 then real_open_cached_file() will be called when it's time to open file. |
| cachesize | Size of buffer to allocate for read/write If == 0 then use my_default_record_cache_size |
| type | Type of cache |
| seek_offset | Where cache should start reading/writing |
| use_async_io | Set to 1 if we should use async_io (if avaiable) |
| cache_myflags | Bitmap of different flags MY_WME | MY_FAE | MY_NABP | MY_FNABP | MY_DONT_CHECK_FILESIZE |
| 0 | success |
| # | error |
Definition at line 174 of file mf_iocache.cc.
| 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.
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.
Referenced by drizzled::FileSort::merge_many_buff(), drizzled::read_buffpek_from_file(), drizzled::FileSort::run(), and drizzled::update_query().
| 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.
| info | Cache handler to setup |
Definition at line 121 of file mf_iocache.cc.
Referenced by drizzled::FileSort::merge_many_buff().