Skip to content

Commit 4fddbc6

Browse files
committed
Add ddst_dict_init api support for rocksdb dd
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent 5fdafcc commit 4fddbc6

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

storage/rocksdb/ha_rocksdb.cc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#include "sql/dd/dictionary.h" // dd::Dictionary
5757
#include "sql/debug_sync.h"
5858
#include "sql/json_dom.h"
59+
#include "sql/plugin_table.h"
5960
#include "sql/sql_audit.h"
6061
#include "sql/sql_class.h"
6162
#include "sql/sql_lex.h"
@@ -3257,6 +3258,11 @@ std::string dump_ingest_external_file_options(
32573258
return s.str();
32583259
}
32593260

3261+
static bool rocksdb_ddse_dict_init(dict_init_mode_t dict_init_mode,
3262+
uint version,
3263+
List<const dd::Object_table> *tables,
3264+
List<const Plugin_tablespace> *tablespaces);
3265+
32603266
/*
32613267
Very short (functor-like) interface to be passed to
32623268
Rdb_transaction::walk_tx_list()
@@ -7432,6 +7438,8 @@ static int rocksdb_init_internal(void *const p) {
74327438
rocksdb_hton->clone_interface.clone_apply = rocksdb_clone_apply;
74337439
rocksdb_hton->clone_interface.clone_apply_end = rocksdb_clone_apply_end;
74347440

7441+
rocksdb_hton->ddse_dict_init = rocksdb_ddse_dict_init;
7442+
74357443
rocksdb_hton->flags = HTON_SUPPORTS_EXTENDED_KEYS | HTON_CAN_RECREATE;
74367444

74377445
rocksdb_hton->partition_flags = rocksdb_partition_flags;
@@ -19020,6 +19028,28 @@ static bool parse_fault_injection_params(
1902019028
return false;
1902119029
}
1902219030

19031+
static bool rocksdb_ddse_dict_init(
19032+
dict_init_mode_t dict_init_mode, uint,
19033+
[[maybe_unused]] List<const dd::Object_table> *tables,
19034+
List<const Plugin_tablespace> *tablespaces) {
19035+
// TODO: Remove assert(false); once we add the full rocksdb dd support
19036+
assert(false);
19037+
19038+
assert(tables);
19039+
assert(tables->is_empty());
19040+
assert(tablespaces);
19041+
assert(tablespaces->is_empty());
19042+
19043+
assert(dict_init_mode == DICT_INIT_CREATE_FILES ||
19044+
dict_init_mode == DICT_INIT_CHECK_FILES);
19045+
19046+
static Plugin_tablespace dd_space(rocksdb_dd_space_name, "", "", "",
19047+
rocksdb_hton_name);
19048+
tablespaces->push_back(&dd_space);
19049+
19050+
return false;
19051+
}
19052+
1902319053
} // namespace myrocks
1902419054

1902519055
/*

storage/rocksdb/rdb_global.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ static_assert(HA_ERR_ROCKSDB_FIRST > HA_ERR_LAST,
357357
#define HA_ERR_ROCKSDB_LAST HA_ERR_ROCKSDB_TMP_TABLE_COMMIT_FAILED
358358

359359
const char *const rocksdb_hton_name = "ROCKSDB";
360+
const char *const rocksdb_dd_space_name = "mysql";
360361

361362
using Index_id = uint32_t;
362363

0 commit comments

Comments
 (0)