Cashing of files with only does (sequential) read or writes of fixed- length records.
More...
|
void | setup_io_cache (IO_CACHE *info) |
|
static void | init_functions (IO_CACHE *info) |
|
int | init_io_cache_ext (IO_CACHE *info, File file, size_t cachesize, enum cache_type type, my_off_t seek_offset, bool use_async_io, myf cache_myflags, PSI_file_key file_key) |
|
int | init_io_cache (IO_CACHE *info, File file, size_t cachesize, enum cache_type type, my_off_t seek_offset, bool use_async_io, myf cache_myflags) |
|
bool | reinit_io_cache (IO_CACHE *info, enum cache_type type, my_off_t seek_offset, bool use_async_io, bool clear_cache) |
|
int | _my_b_read (IO_CACHE *info, uchar *Buffer, size_t Count) |
|
void | init_io_cache_share (IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, IO_CACHE *write_cache, uint num_threads) |
|
void | remove_io_thread (IO_CACHE *cache) |
|
static int | lock_io_cache (IO_CACHE *cache, my_off_t pos) |
|
static void | unlock_io_cache (IO_CACHE *cache) |
|
int | _my_b_read_r (IO_CACHE *cache, uchar *Buffer, size_t Count) |
|
static void | copy_to_read_buffer (IO_CACHE *write_cache, const uchar *write_buffer, size_t write_length) |
|
int | _my_b_seq_read (IO_CACHE *info, uchar *Buffer, size_t Count) |
|
int | _my_b_get (IO_CACHE *info) |
|
int | _my_b_write (IO_CACHE *info, const uchar *Buffer, size_t Count) |
|
int | my_b_append (IO_CACHE *info, const uchar *Buffer, size_t Count) |
|
int | my_b_safe_write (IO_CACHE *info, const uchar *Buffer, size_t Count) |
|
int | my_block_write (IO_CACHE *info, const uchar *Buffer, size_t Count, my_off_t pos) |
|
int | my_b_flush_io_cache (IO_CACHE *info, int need_append_buffer_lock) |
|
int | end_io_cache (IO_CACHE *info) |
|
my_off_t | mysql_encryption_file_seek (IO_CACHE *cache, my_off_t pos, int whence, myf flags) |
| This is a wrapper around mysql_file_seek. More...
|
|
size_t | mysql_encryption_file_read (IO_CACHE *cache, uchar *buffer, size_t count, myf flags) |
| This is a wrapper around mysql_file_read. More...
|
|
size_t | mysql_encryption_file_write (IO_CACHE *cache, const uchar *buffer, size_t count, myf flags) |
| This is a wrapper around mysql_file_write. More...
|
|
Cashing of files with only does (sequential) read or writes of fixed- length records.
A read isn't allowed to go over file-length. A read is ok if it ends at file-length and next read can try to read after file-length (and get a EOF-error). Possibly use of asyncronic io. macros for read and writes for faster io. Used instead of FILE when reading or writing whole files. This code makes mf_rec_cache obsolete (currently only used by ISAM). One can change info->pos_in_file to a higher value to skip bytes in the file if also info->read_pos is set to info->read_end. If called through open_cached_file(), then the temporary file will only be created if a write exceeds the file buffer or if one calls my_b_flush_io_cache().
If one uses SEQ_READ_APPEND, then two buffers are allocated, one for reading and another for writing. Reads are first done from disk and then done from the write buffer. This is an efficient way to read from a log file when one is writing to it at the same time. For this to work, the file has to be opened in append mode! Note that when one uses SEQ_READ_APPEND, one MUST write using my_b_append ! This is needed because we need to lock the mutex every time we access the write buffer.
TODO: When one SEQ_READ_APPEND and we are reading and writing at the same time, each time the write buffer gets full and it's written to disk, we will always do a disk read to read a part of the buffer from disk to the read buffer. This should be fixed so that when we do a my_b_flush_io_cache() and we have been reading the write buffer, we should transfer the rest of the write buffer to the read buffer before we start to reuse it.