diff options
author | Igor Babaev <igor@askmonty.org> | 2010-04-01 14:42:40 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2010-04-01 14:42:40 -0700 |
commit | 59baf97d56ab2a06fd6cde5509ba933c102fb203 (patch) | |
tree | 625ffa0a11551d7e7325decb504850d0bafe3139 /include/keycache.h | |
parent | ecba0ec8ed5c165966b29ed3f84158dd7b1bd544 (diff) | |
download | mariadb-git-59baf97d56ab2a06fd6cde5509ba933c102fb203.tar.gz |
Post-review fixes.
Diffstat (limited to 'include/keycache.h')
-rw-r--r-- | include/keycache.h | 89 |
1 files changed, 62 insertions, 27 deletions
diff --git a/include/keycache.h b/include/keycache.h index 8bfe6044ac5..f8dc1cc8a5d 100644 --- a/include/keycache.h +++ b/include/keycache.h @@ -37,7 +37,6 @@ C_MODE_START #define MAX_KEY_CACHE_PARTITIONS 64 - /* The structure to get statistical data about a key cache */ typedef struct st_key_cache_statistics @@ -53,6 +52,8 @@ typedef struct st_key_cache_statistics ulonglong writes; /* number of actual writes from buffers into files */ } KEY_CACHE_STATISTICS; +#define NO_LONG_KEY_CACHE_STAT_VARIABLES 3 + /* The type of a key cache object */ typedef enum key_cache_type { @@ -61,6 +62,55 @@ typedef enum key_cache_type } KEY_CACHE_TYPE; +typedef + int (*INIT_KEY_CACHE) + (void *, uint key_cache_block_size, + size_t use_mem, uint division_limit, uint age_threshold); +typedef + int (*RESIZE_KEY_CACHE) + (void *, uint key_cache_block_size, + size_t use_mem, uint division_limit, uint age_threshold); +typedef + void (*CHANGE_KEY_CACHE_PARAM) + (void *keycache_cb, + uint division_limit, uint age_threshold); +typedef + uchar* (*KEY_CACHE_READ) + (void *keycache_cb, + File file, my_off_t filepos, int level, + uchar *buff, uint length, + uint block_length, int return_buffer); +typedef + int (*KEY_CACHE_INSERT) + (void *keycache_cb, + File file, my_off_t filepos, int level, + uchar *buff, uint length); +typedef + int (*KEY_CACHE_WRITE) + (void *keycache_cb, + File file, void *file_extra, + my_off_t filepos, int level, + uchar *buff, uint length, + uint block_length, int force_write); +typedef + int (*FLUSH_KEY_BLOCKS) + (void *keycache_cb, + int file, void *file_extra, + enum flush_type type); +typedef + int (*RESET_KEY_CACHE_COUNTERS) + (const char *name, void *keycache_cb); +typedef + void (*END_KEY_CACHE) + (void *keycache_cb, my_bool cleanup); +typedef + void (*GET_KEY_CACHE_STATISTICS) + (void *keycache_cb, uint partition_no, + KEY_CACHE_STATISTICS *key_cache_stats); +typedef + ulonglong (*GET_KEY_CACHE_STAT_VALUE) + (void *keycache_cb, uint var_no); + /* An object of the type KEY_CACHE_FUNCS contains pointers to all functions from the key cache interface. @@ -74,32 +124,17 @@ typedef enum key_cache_type typedef struct st_key_cache_funcs { - int (*init) (void *, uint key_cache_block_size, - size_t use_mem, uint division_limit, uint age_threshold); - int (*resize) (void *, uint key_cache_block_size, - size_t use_mem, uint division_limit, uint age_threshold); - void (*change_param) (void *keycache_cb, - uint division_limit, uint age_threshold); - uchar* (*read) (void *keycache_cb, - File file, my_off_t filepos, int level, - uchar *buff, uint length, - uint block_length, int return_buffer); - int (*insert) (void *keycache_cb, - File file, my_off_t filepos, int level, - uchar *buff, uint length); - int (*write) (void *keycache_cb, - File file, void *file_extra, - my_off_t filepos, int level, - uchar *buff, uint length, - uint block_length, int force_write); - int (*flush) (void *keycache_cb, - int file, void *file_extra, - enum flush_type type); - int (*reset_counters) (const char *name, void *keycache_cb); - void (*end) (void *keycache_cb, my_bool cleanup); - void (*get_stats) (void *keycache_cb, uint partition_no, - KEY_CACHE_STATISTICS *key_cache_stats); - ulonglong (*get_stat_val) (void *keycache_cb, uint var_no); + INIT_KEY_CACHE init; + RESIZE_KEY_CACHE resize; + CHANGE_KEY_CACHE_PARAM change_param; + KEY_CACHE_READ read; + KEY_CACHE_INSERT insert; + KEY_CACHE_WRITE write; + FLUSH_KEY_BLOCKS flush; + RESET_KEY_CACHE_COUNTERS reset_counters; + END_KEY_CACHE end; + GET_KEY_CACHE_STATISTICS get_stats; + GET_KEY_CACHE_STAT_VALUE get_stat_val; } KEY_CACHE_FUNCS; |