mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
[t:4002] merging handlerton changes for HOT
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@38550 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
3bf3cd0d4f
commit
395c36d03c
3 changed files with 36 additions and 4 deletions
|
@ -342,6 +342,22 @@ int poll_fun(void *extra, float progress) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
struct hot_poll_fun_extra {
|
||||
uint current_table;
|
||||
uint num_tables;
|
||||
};
|
||||
|
||||
int hot_poll_fun(void *extra, float progress) {
|
||||
HOT_OPTIMIZE_CONTEXT context = (HOT_OPTIMIZE_CONTEXT)extra;
|
||||
if (context->thd->killed) {
|
||||
sprintf(context->write_status_msg, "The process has been killed, aborting hot optimize.");
|
||||
return ER_ABORTING_CONNECTION;
|
||||
}
|
||||
sprintf(context->write_status_msg, "Optimization of index %u of %u about %.lf%% done", context->current_table, context->num_tables, progress*100);
|
||||
thd_proc_info(context->thd, context->write_status_msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void loader_ai_err_fun(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra) {
|
||||
LOADER_CONTEXT context = (LOADER_CONTEXT)error_extra;
|
||||
|
@ -7689,12 +7705,16 @@ int ha_tokudb::optimize(THD * thd, HA_CHECK_OPT * check_opt) {
|
|||
if (error) {
|
||||
goto cleanup;
|
||||
}
|
||||
/*
|
||||
error = db->hot_optimize(db);
|
||||
struct hot_optimize_context hc;
|
||||
memset(&hc, 0, sizeof hc);
|
||||
hc.thd = thd;
|
||||
hc.ha = this;
|
||||
hc.current_table = i;
|
||||
hc.num_tables = curr_num_DBs;
|
||||
error = db->hot_optimize(db, hot_poll_fun, &hc);
|
||||
if (error) {
|
||||
goto cleanup;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
error = 0;
|
||||
|
|
|
@ -22,6 +22,14 @@ typedef struct loader_context {
|
|||
ha_tokudb* ha;
|
||||
} *LOADER_CONTEXT;
|
||||
|
||||
typedef struct hot_optimize_context {
|
||||
THD *thd;
|
||||
char write_status_msg[200];
|
||||
ha_tokudb *ha;
|
||||
uint current_table;
|
||||
uint num_tables;
|
||||
} *HOT_OPTIMIZE_CONTEXT;
|
||||
|
||||
//
|
||||
// This object stores table information that is to be shared
|
||||
// among all ha_tokudb objects.
|
||||
|
|
|
@ -1293,7 +1293,7 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) {
|
|||
SHOWVAL(cleaner_max_buffer_workdone);
|
||||
SHOWVAL(cleaner_min_buffer_workdone);
|
||||
SHOWVAL(cleaner_total_buffer_workdone);
|
||||
SHOWVAL(cleaner_num_leaves_unmerged);
|
||||
SHOWVAL(cleaner_num_dirtied_for_leaf_merge);
|
||||
SHOWVAL(flush_total);
|
||||
SHOWVAL(flush_in_memory);
|
||||
SHOWVAL(flush_needed_io);
|
||||
|
@ -1319,6 +1319,10 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) {
|
|||
SHOWVAL(dirty_leaf);
|
||||
SHOWVAL(dirty_nonleaf);
|
||||
SHOWVAL(balance_leaf);
|
||||
SHOWVAL(hot_num_started);
|
||||
SHOWVAL(hot_num_completed);
|
||||
SHOWVAL(hot_num_aborted);
|
||||
SHOWVAL(hot_max_root_flush_count);
|
||||
SHOWVAL(msg_bytes_in);
|
||||
SHOWVAL(msg_bytes_out);
|
||||
SHOWVAL(msg_bytes_curr);
|
||||
|
|
Loading…
Reference in a new issue