diff --git a/storage/eloq/eloq_catalog_factory.cpp b/storage/eloq/eloq_catalog_factory.cpp index 5a9eddf272b..23f1a619e3b 100644 --- a/storage/eloq/eloq_catalog_factory.cpp +++ b/storage/eloq/eloq_catalog_factory.cpp @@ -569,12 +569,8 @@ MariaCatalogFactory::CreateTableSchema(const txservice::TableName &table_name, const std::string &catalog_image, uint64_t version) { - if (table_name == txservice::Sequences::table_name_) - { - DLOG(INFO) << "===create sequence table schema"; - return std::make_unique( - table_name, catalog_image, version); - } + assert(table_name.Engine() == txservice::TableEngine::EloqSql); + return std::make_unique(table_name, catalog_image, version); } @@ -584,13 +580,7 @@ txservice::CcMap::uptr MariaCatalogFactory::CreatePkCcMap( const txservice::TableSchema *table_schema, bool ccm_has_full_entries, txservice::CcShard *shard, txservice::NodeGroupId cc_ng_id) { - if (table_name == txservice::Sequences::table_name_) - { - return std::make_unique< - txservice::TemplateCcMap>( - shard, cc_ng_id, table_name, table_schema->Version(), table_schema, - ccm_has_full_entries); - } + assert(table_name.Engine() == txservice::TableEngine::EloqSql); uint64_t key_version= table_schema->KeySchema()->SchemaTs(); return std::make_unique< @@ -722,13 +712,34 @@ MariaCatalogFactory::CreateTableStatistics( table_schema, std::move(sample_pool_map), ccs, cc_ng_id); } -txservice::TxKey MariaCatalogFactory::NegativeInfKey() +txservice::TxKey MariaCatalogFactory::NegativeInfKey() const { return txservice::TxKey(EloqKey::NegativeInfinity()); } -txservice::TxKey MariaCatalogFactory::PositiveInfKey() +txservice::TxKey MariaCatalogFactory::PositiveInfKey() const { return txservice::TxKey(EloqKey::PositiveInfinity()); } + +txservice::TxKey MariaCatalogFactory::CreateTxKey() const +{ + return txservice::TxKey(std::make_unique()); +} +txservice::TxKey MariaCatalogFactory::CreateTxKey(const char *data, + size_t size) const +{ + return txservice::TxKey( + std::make_unique(reinterpret_cast(data), size)); +} +const txservice::TxKey *MariaCatalogFactory::PackedNegativeInfinity() const +{ + return EloqKey::PackedNegativeInfinityTxKey(); +} +std::unique_ptr +MariaCatalogFactory::CreateTxRecord() const +{ + return std::make_unique(); +} + } // namespace MyEloq diff --git a/storage/eloq/eloq_catalog_factory.h b/storage/eloq/eloq_catalog_factory.h index ea6171d42b3..e55f91b870a 100644 --- a/storage/eloq/eloq_catalog_factory.h +++ b/storage/eloq/eloq_catalog_factory.h @@ -222,8 +222,13 @@ class MariaCatalogFactory : public txservice::CatalogFactory sample_pool_map, txservice::CcShard *ccs, txservice::NodeGroupId cc_ng_id) override; - txservice::TxKey NegativeInfKey() override; + txservice::TxKey NegativeInfKey() const override; - txservice::TxKey PositiveInfKey() override; + txservice::TxKey PositiveInfKey() const override; + + txservice::TxKey CreateTxKey() const override; + txservice::TxKey CreateTxKey(const char *data, size_t size) const override; + const txservice::TxKey *PackedNegativeInfinity() const override; + std::unique_ptr CreateTxRecord() const override; }; } // namespace MyEloq diff --git a/storage/eloq/ha_eloq.cc b/storage/eloq/ha_eloq.cc index f7587b4e105..0f0a7ea59ed 100644 --- a/storage/eloq/ha_eloq.cc +++ b/storage/eloq/ha_eloq.cc @@ -2306,18 +2306,6 @@ static int eloq_init_abort() DBUG_RETURN(1); } -static void RegisterFactory() -{ - txservice::TxKeyFactory::RegisterCreateTxKeyFunc(EloqKey::Create); - txservice::TxKeyFactory::RegisterCreateDefaultTxKeyFunc( - EloqKey::CreateDefault); - txservice::TxKeyFactory::RegisterNegInfTxKey(EloqKey::NegInfTxKey()); - txservice::TxKeyFactory::RegisterPosInfTxKey(EloqKey::PosInfTxKey()); - txservice::TxKeyFactory::RegisterPackedNegativeInfinity( - EloqKey::PackedNegativeInfinityTxKey()); - txservice::TxRecordFactory::RegisterCreateTxRecordFunc(EloqRecord::Create); -} - #if defined(DATA_STORE_TYPE_ELOQDSS_ELOQSTORE) /** * Configure EloqStore settings for the data store service @@ -2412,7 +2400,7 @@ static int eloq_init_func(void *p) PrintEloqConfig(); - RegisterFactory(); + CatalogFactory *catalog_factory[3]{&maria_catalog_factory, nullptr, nullptr}; sql_print_information("Eloq initializing."); @@ -2760,7 +2748,7 @@ static int eloq_init_func(void *p) data_store_service_->ConnectDataStore(std::move(dss_shards_map)); // setup data store service client storage_hd= std::make_unique( - ds_config, data_store_service_.get()); + catalog_factory, ds_config, data_store_service_.get()); if (!storage_hd->Connect()) { @@ -3218,8 +3206,6 @@ static int eloq_init_func(void *p) tx_service_common_labels["node_port"]= std::to_string(mysqld_port); tx_service_common_labels["node_id"]= std::to_string(node_id); - CatalogFactory *catalog_factory[3]{&maria_catalog_factory, nullptr, - nullptr}; tx_service= std::make_unique( catalog_factory, &MariaSystemHandler::Instance(), tx_service_conf, node_id, native_ng_id, &ng_configs, cluster_config_version, @@ -3238,9 +3224,6 @@ static int eloq_init_func(void *p) } else { - // Sequence table will use the same catalog factory as elosql table. - CatalogFactory *catalog_factory[4]{&maria_catalog_factory, nullptr, - nullptr, &maria_catalog_factory}; tx_service= std::make_unique( catalog_factory, &MariaSystemHandler::Instance(), tx_service_conf, node_id, native_ng_id, &ng_configs, cluster_config_version, diff --git a/storage/eloq/log_service b/storage/eloq/log_service index eec3b2ba995..a085920ce6a 160000 --- a/storage/eloq/log_service +++ b/storage/eloq/log_service @@ -1 +1 @@ -Subproject commit eec3b2ba995097cb98d5e1543d241a454b2a7fcc +Subproject commit a085920ce6a71106c75703ff14c36033bae449b5 diff --git a/storage/eloq/store_handler b/storage/eloq/store_handler index 6c5604a002e..b3e8d0e6638 160000 --- a/storage/eloq/store_handler +++ b/storage/eloq/store_handler @@ -1 +1 @@ -Subproject commit 6c5604a002e58aad45dfebd09b51ae150195b330 +Subproject commit b3e8d0e6638553e8000fb512db73c1f3704e09e4 diff --git a/storage/eloq/tx_service b/storage/eloq/tx_service index 575b5609f55..2bd068afeac 160000 --- a/storage/eloq/tx_service +++ b/storage/eloq/tx_service @@ -1 +1 @@ -Subproject commit 575b5609f555e4310a5a7a227b90fcac8e1103a7 +Subproject commit 2bd068afeac7e7621c15bd7ac718f6e96cd5ce73