Skip to content

Commit 87f76c5

Browse files
sunshine-Chuninikep
authored andcommitted
Add ddst_dict_init api support for rocksdb ddse (facebook#1297)
Summary: Add ddst_dict_init handler api support for rocksdb dd Currently rocksdb ddst_dict_init() doesn't add any rocksdb specific tables and tablespace during ddse initialize. Pull Request resolved: facebook#1297 Test Plan: CI Differential Revision: D46700996
1 parent e2d3dd1 commit 87f76c5

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

storage/rocksdb/ha_rocksdb.cc

+1
Original file line numberDiff line numberDiff line change
@@ -7511,6 +7511,7 @@ static int rocksdb_init_internal(void *const p) {
75117511
rocksdb_hton->dict_get_server_version = rocksdb_dict_get_server_version;
75127512
rocksdb_hton->dict_set_server_version = rocksdb_dict_set_server_version;
75137513
rocksdb_hton->is_supported_system_table = rocksdb_is_supported_system_table;
7514+
rocksdb_hton->ddse_dict_init = rocksdb_ddse_dict_init;
75147515

75157516
rocksdb_hton->flags = HTON_SUPPORTS_EXTENDED_KEYS | HTON_CAN_RECREATE;
75167517

storage/rocksdb/rdb_native_dd.cc

+15
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
/* MyRocks header files */
2525
#include "ha_rocksdb.h"
26+
#include "sql/plugin_table.h"
2627
#include "storage/rocksdb/ha_rocksdb_proto.h"
2728
#include "storage/rocksdb/rdb_datadic.h"
2829

@@ -77,4 +78,18 @@ bool rocksdb_is_supported_system_table([[maybe_unused]] const char *db_name,
7778
return false;
7879
}
7980

81+
bool rocksdb_ddse_dict_init(
82+
[[maybe_unused]] dict_init_mode_t dict_init_mode, uint,
83+
[[maybe_unused]] List<const dd::Object_table> *tables,
84+
[[maybe_unused]] List<const Plugin_tablespace> *tablespaces) {
85+
assert(tables);
86+
assert(tables->is_empty());
87+
assert(tablespaces);
88+
assert(tablespaces->is_empty());
89+
90+
assert(dict_init_mode == DICT_INIT_CREATE_FILES ||
91+
dict_init_mode == DICT_INIT_CHECK_FILES);
92+
93+
return false;
94+
}
8095
} // namespace myrocks

storage/rocksdb/rdb_native_dd.h

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
/* MySQL header files */
2323
#include "sql/dd/object_id.h"
24+
#include "sql/handler.h"
2425

2526
namespace dd {
2627
class Table;
@@ -32,6 +33,9 @@ void rocksdb_dict_register_dd_table_id(dd::Object_id dd_table_id);
3233
bool rocksdb_dict_get_server_version(uint *version);
3334
bool rocksdb_dict_set_server_version();
3435
bool rocksdb_is_supported_system_table(const char *, const char *, bool);
36+
bool rocksdb_ddse_dict_init(dict_init_mode_t dict_init_mode, uint version,
37+
List<const dd::Object_table> *tables,
38+
List<const Plugin_tablespace> *tablespaces);
3539

3640
class native_dd {
3741
private:

0 commit comments

Comments
 (0)