Navigation Menu

Skip to content

Commit

Permalink
Wrap handler::get_memory_buffer_size()
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 10, 2018
1 parent 222a3d8 commit 55889d5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
30 changes: 30 additions & 0 deletions ha_mroonga.cpp
Expand Up @@ -13157,6 +13157,36 @@ bool ha_mroonga::get_foreign_dup_key(char *child_table_name,
DBUG_RETURN(success);
}

longlong ha_mroonga::wrapper_get_memory_buffer_size() const
{
MRN_DBUG_ENTER_METHOD();
MRN_SET_WRAP_SHARE_KEY(share, table->s);
MRN_SET_WRAP_TABLE_KEY(this, table);
longlong size = wrap_handler->get_memory_buffer_size();
MRN_SET_BASE_SHARE_KEY(share, table->s);
MRN_SET_BASE_TABLE_KEY(this, table);
DBUG_RETURN(size);
}

longlong ha_mroonga::storage_get_memory_buffer_size() const
{
MRN_DBUG_ENTER_METHOD();
longlong size = handler::get_memory_buffer_size();
DBUG_RETURN(size);
}

longlong ha_mroonga::get_memory_buffer_size() const
{
MRN_DBUG_ENTER_METHOD();
longlong size;
if (share && share->wrapper_mode) {
size = wrapper_get_memory_buffer_size();
} else {
size = storage_get_memory_buffer_size();
}
DBUG_RETURN(size);
}

#ifdef MRN_HANDLER_HAVE_TABLE_CACHE_TYPE
uint8 ha_mroonga::wrapper_table_cache_type()
{
Expand Down
3 changes: 3 additions & 0 deletions ha_mroonga.hpp
Expand Up @@ -655,6 +655,7 @@ class ha_mroonga: public handler
void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share_arg) mrn_override;
double scan_time() mrn_override;
double read_time(uint index, uint ranges, ha_rows rows) mrn_override;
longlong get_memory_buffer_size() const mrn_override;
#ifdef MRN_HANDLER_HAVE_TABLE_CACHE_TYPE
uint8 table_cache_type();
#endif
Expand Down Expand Up @@ -1325,6 +1326,8 @@ class ha_mroonga: public handler
double storage_scan_time();
double wrapper_read_time(uint index, uint ranges, ha_rows rows);
double storage_read_time(uint index, uint ranges, ha_rows rows);
longlong wrapper_get_memory_buffer_size() const;
longlong storage_get_memory_buffer_size() const;
#ifdef MRN_HANDLER_HAVE_TABLE_CACHE_TYPE
uint8 wrapper_table_cache_type();
uint8 storage_table_cache_type();
Expand Down

0 comments on commit 55889d5

Please sign in to comment.