Skip to content

Commit

Permalink
Add ddst_dict_init api support for rocksdb dd
Browse files Browse the repository at this point in the history
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
  • Loading branch information
sunshine-Chun committed Apr 24, 2023
1 parent 5fdafcc commit 66fa355
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions storage/rocksdb/ha_rocksdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include "sql/dd/dictionary.h" // dd::Dictionary
#include "sql/debug_sync.h"
#include "sql/json_dom.h"
#include "sql/plugin_table.h"
#include "sql/sql_audit.h"
#include "sql/sql_class.h"
#include "sql/sql_lex.h"
Expand Down Expand Up @@ -3257,6 +3258,11 @@ std::string dump_ingest_external_file_options(
return s.str();
}

static bool rocksdb_ddse_dict_init(dict_init_mode_t dict_init_mode,
uint version,
List<const dd::Object_table> *tables,
List<const Plugin_tablespace> *tablespaces);

/*
Very short (functor-like) interface to be passed to
Rdb_transaction::walk_tx_list()
Expand Down Expand Up @@ -7432,6 +7438,8 @@ static int rocksdb_init_internal(void *const p) {
rocksdb_hton->clone_interface.clone_apply = rocksdb_clone_apply;
rocksdb_hton->clone_interface.clone_apply_end = rocksdb_clone_apply_end;

rocksdb_hton->ddse_dict_init = rocksdb_ddse_dict_init;

rocksdb_hton->flags = HTON_SUPPORTS_EXTENDED_KEYS | HTON_CAN_RECREATE;

rocksdb_hton->partition_flags = rocksdb_partition_flags;
Expand Down Expand Up @@ -19020,6 +19028,22 @@ static bool parse_fault_injection_params(
return false;
}

static bool rocksdb_ddse_dict_init(
dict_init_mode_t dict_init_mode, [[maybe_unused]] uint version,
[[maybe_unused]] List<const dd::Object_table> *tables,
List<const Plugin_tablespace> *tablespaces) {
assert(tables && tables->is_empty());
assert(tablespaces && tablespaces->is_empty());

assert(dict_init_mode == DICT_INIT_CREATE_FILES ||
dict_init_mode == DICT_INIT_CHECK_FILES);

static Plugin_tablespace dd_space("mysql", "", "", "", rocksdb_hton_name);
tablespaces->push_back(&dd_space);

return false;
}

} // namespace myrocks

/*
Expand Down

0 comments on commit 66fa355

Please sign in to comment.