aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Rutkovsky <alexander.rutkovsky@gmail.com>2022-05-05 22:28:11 +0300
committerAlexander Rutkovsky <alexander.rutkovsky@gmail.com>2022-05-05 22:28:11 +0300
commitccf0acb6e142673e89aaea39ead6064d1b078ed0 (patch)
treec8b2b44f2c3594bd9283ba0e5d93c65606f1e7d9
parent1f6e5abe9debdafb3ec154d40a11606599d4540e (diff)
downloadydb-ccf0acb6e142673e89aaea39ead6064d1b078ed0.tar.gz
Get rid of DefaultTabletTypes KIKIMR-14867
ref:2905bac87d7cf7e1da7c35f7a187883b33ea294f
-rw-r--r--ydb/core/base/appdata.cpp19
-rw-r--r--ydb/core/base/appdata.h22
-rw-r--r--ydb/core/driver_lib/run/kikimr_services_initializers.cpp28
-rw-r--r--ydb/core/testlib/tablet_helpers.cpp27
-rw-r--r--ydb/core/testlib/tenant_runtime.cpp15
-rw-r--r--ydb/core/testlib/test_client.cpp28
6 files changed, 48 insertions, 91 deletions
diff --git a/ydb/core/base/appdata.cpp b/ydb/core/base/appdata.cpp
index b2b77e9e88..e91a3b3d84 100644
--- a/ydb/core/base/appdata.cpp
+++ b/ydb/core/base/appdata.cpp
@@ -32,25 +32,6 @@ TAppData::TAppData(
, KikimrShouldContinue(kikimrShouldContinue)
{}
-TAppData::TDefaultTabletTypes::TDefaultTabletTypes()
- : SchemeShard(TTabletTypes::FLAT_SCHEMESHARD)
- , DataShard(TTabletTypes::FLAT_DATASHARD)
- , KeyValue(TTabletTypes::KEYVALUEFLAT)
- , PersQueue(TTabletTypes::PERSQUEUE)
- , PersQueueReadBalancer(TTabletTypes::PERSQUEUE_READ_BALANCER)
- , Dummy(TTabletTypes::TX_DUMMY)
- , Coordinator(TTabletTypes::FLAT_TX_COORDINATOR)
- , Mediator(TTabletTypes::TX_MEDIATOR)
- , Kesus(TTabletTypes::KESUS)
- , Hive(TTabletTypes::Hive)
- , SysViewProcessor(TTabletTypes::SysViewProcessor)
- , ColumnShard(TTabletTypes::COLUMNSHARD)
- , TestShard(TTabletTypes::TestShard)
- , SequenceShard(TTabletTypes::SequenceShard)
- , ReplicationController(TTabletTypes::ReplicationController)
-{
-}
-
TIntrusivePtr<IRandomProvider> TAppData::RandomProvider = CreateDefaultRandomProvider();
TIntrusivePtr<ITimeProvider> TAppData::TimeProvider = CreateDefaultTimeProvider();
diff --git a/ydb/core/base/appdata.h b/ydb/core/base/appdata.h
index fa0d5330ae..740266c6ef 100644
--- a/ydb/core/base/appdata.h
+++ b/ydb/core/base/appdata.h
@@ -99,28 +99,6 @@ struct TAppData {
NYdb::TDriver* YdbDriver = nullptr;
const NPDisk::IIoContextFactory* IoContextFactory = nullptr;
- struct TDefaultTabletTypes {
- TTabletTypes::EType SchemeShard;
- TTabletTypes::EType DataShard;
- TTabletTypes::EType KeyValue;
- TTabletTypes::EType PersQueue;
- TTabletTypes::EType PersQueueReadBalancer;
- TTabletTypes::EType Dummy;
- TTabletTypes::EType Coordinator;
- TTabletTypes::EType Mediator;
- TTabletTypes::EType Kesus;
- TTabletTypes::EType Hive;
- TTabletTypes::EType SysViewProcessor;
- TTabletTypes::EType ColumnShard;
- TTabletTypes::EType TestShard;
- TTabletTypes::EType SequenceShard;
- TTabletTypes::EType ReplicationController;
-
- TDefaultTabletTypes();
- };
-
- TDefaultTabletTypes DefaultTabletTypes;
-
static TIntrusivePtr<IRandomProvider> RandomProvider;
static TIntrusivePtr<ITimeProvider> TimeProvider;
TIntrusivePtr<IMonotonicTimeProvider> MonotonicTimeProvider;
diff --git a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp
index b2031e1f7e..832869da7e 100644
--- a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp
+++ b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp
@@ -945,33 +945,33 @@ void TLocalServiceInitializer::InitializeServices(
// setup local
TLocalConfig::TPtr localConfig(new TLocalConfig());
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.SchemeShard] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::SchemeShard] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&CreateFlatTxSchemeShard, TMailboxType::ReadAsFilled, appData->UserPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.DataShard] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::DataShard] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&CreateDataShard, TMailboxType::ReadAsFilled, appData->UserPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.KeyValue] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::KeyValue] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&CreateKeyValueFlat, TMailboxType::ReadAsFilled, appData->UserPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.PersQueue] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::PersQueue] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&CreatePersQueue, TMailboxType::ReadAsFilled, appData->UserPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.PersQueueReadBalancer] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::PersQueueReadBalancer] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&CreatePersQueueReadBalancer, TMailboxType::ReadAsFilled, appData->UserPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.Coordinator] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::Coordinator] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&CreateFlatTxCoordinator, TMailboxType::Revolving, importantPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.Mediator] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::Mediator] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&CreateTxMediator, TMailboxType::Revolving, importantPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.Kesus] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::Kesus] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&NKesus::CreateKesusTablet, TMailboxType::ReadAsFilled, appData->UserPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.Hive] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::Hive] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&CreateDefaultHive, TMailboxType::ReadAsFilled, importantPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.SysViewProcessor] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::SysViewProcessor] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&NSysView::CreateSysViewProcessor, TMailboxType::ReadAsFilled, appData->UserPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.TestShard] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::TestShard] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&NTestShard::CreateTestShard, TMailboxType::ReadAsFilled, appData->UserPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.ColumnShard] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::ColumnShard] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&CreateColumnShard, TMailboxType::ReadAsFilled, appData->UserPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.SequenceShard] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::SequenceShard] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&NSequenceShard::CreateSequenceShard, TMailboxType::ReadAsFilled, appData->UserPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
- localConfig->TabletClassInfo[appData->DefaultTabletTypes.ReplicationController] = TLocalConfig::TTabletClassInfo(
+ localConfig->TabletClassInfo[TTabletTypes::ReplicationController] = TLocalConfig::TTabletClassInfo(
new TTabletSetupInfo(&NReplication::CreateController, TMailboxType::ReadAsFilled, appData->UserPoolId, TMailboxType::ReadAsFilled, appData->SystemPoolId));
TTenantPoolConfig::TPtr tenantPoolConfig = new TTenantPoolConfig(Config.GetTenantPoolConfig(), localConfig);
diff --git a/ydb/core/testlib/tablet_helpers.cpp b/ydb/core/testlib/tablet_helpers.cpp
index ce5588e08d..a6d2616166 100644
--- a/ydb/core/testlib/tablet_helpers.cpp
+++ b/ydb/core/testlib/tablet_helpers.cpp
@@ -1153,41 +1153,40 @@ namespace NKikimr {
const auto type = ev->Get()->Record.GetTabletType();
const auto bootMode = ev->Get()->Record.GetTabletBootMode();
auto it = State->Tablets.find(key);
- const auto& defaultTabletTypes = AppData(ctx)->DefaultTabletTypes;
TActorId bootstrapperActorId;
if (it == State->Tablets.end()) {
if (bootMode == NKikimrHive::TABLET_BOOT_MODE_EXTERNAL) {
// don't boot anything
} else if (auto x = GetTabletCreationFunc(type)) {
bootstrapperActorId = Boot(ctx, type, x, DataGroupErasure);
- } else if (type == defaultTabletTypes.DataShard) {
+ } else if (type == TTabletTypes::DataShard) {
bootstrapperActorId = Boot(ctx, type, &CreateDataShard, DataGroupErasure);
- } else if (type == defaultTabletTypes.KeyValue) {
+ } else if (type == TTabletTypes::KeyValue) {
bootstrapperActorId = Boot(ctx, type, &CreateKeyValueFlat, DataGroupErasure);
- } else if (type == defaultTabletTypes.ColumnShard) {
+ } else if (type == TTabletTypes::ColumnShard) {
bootstrapperActorId = Boot(ctx, type, &CreateColumnShard, DataGroupErasure);
- } else if (type == defaultTabletTypes.PersQueue) {
+ } else if (type == TTabletTypes::PersQueue) {
bootstrapperActorId = Boot(ctx, type, &CreatePersQueue, DataGroupErasure);
- } else if (type == defaultTabletTypes.PersQueueReadBalancer) {
+ } else if (type == TTabletTypes::PersQueueReadBalancer) {
bootstrapperActorId = Boot(ctx, type, &CreatePersQueueReadBalancer, DataGroupErasure);
- } else if (type == defaultTabletTypes.Coordinator) {
+ } else if (type == TTabletTypes::Coordinator) {
bootstrapperActorId = Boot(ctx, type, &CreateFlatTxCoordinator, DataGroupErasure);
- } else if (type == defaultTabletTypes.Mediator) {
+ } else if (type == TTabletTypes::Mediator) {
bootstrapperActorId = Boot(ctx, type, &CreateTxMediator, DataGroupErasure);
- } else if (type == defaultTabletTypes.SchemeShard) {
+ } else if (type == TTabletTypes::SchemeShard) {
bootstrapperActorId = Boot(ctx, type, &CreateFlatTxSchemeShard, DataGroupErasure);
- } else if (type == defaultTabletTypes.Kesus) {
+ } else if (type == TTabletTypes::Kesus) {
bootstrapperActorId = Boot(ctx, type, &NKesus::CreateKesusTablet, DataGroupErasure);
- } else if (type == defaultTabletTypes.Hive) {
+ } else if (type == TTabletTypes::Hive) {
TFakeHiveState::TPtr state = State->AllocateSubHive();
bootstrapperActorId = Boot(ctx, type, [=](const TActorId& tablet, TTabletStorageInfo* info) {
return new TFakeHive(tablet, info, state, &TFakeHive::DefaultGetTabletCreationFunc);
}, DataGroupErasure);
- } else if (type == defaultTabletTypes.SysViewProcessor) {
+ } else if (type == TTabletTypes::SysViewProcessor) {
bootstrapperActorId = Boot(ctx, type, &NSysView::CreateSysViewProcessor, DataGroupErasure);
- } else if (type == defaultTabletTypes.SequenceShard) {
+ } else if (type == TTabletTypes::SequenceShard) {
bootstrapperActorId = Boot(ctx, type, &NSequenceShard::CreateSequenceShard, DataGroupErasure);
- } else if (type == defaultTabletTypes.ReplicationController) {
+ } else if (type == TTabletTypes::ReplicationController) {
bootstrapperActorId = Boot(ctx, type, &NReplication::CreateController, DataGroupErasure);
} else {
status = NKikimrProto::ERROR;
diff --git a/ydb/core/testlib/tenant_runtime.cpp b/ydb/core/testlib/tenant_runtime.cpp
index 974cc166d0..daade7f5a9 100644
--- a/ydb/core/testlib/tenant_runtime.cpp
+++ b/ydb/core/testlib/tenant_runtime.cpp
@@ -405,7 +405,6 @@ class TFakeHive : public TActor<TFakeHive>, public TTabletExecutedFlat {
const auto type = ev->Get()->Record.GetTabletType();
const auto bootMode = ev->Get()->Record.GetTabletBootMode();
auto it = State.Tablets.find(key);
- const auto& defaultTabletTypes = AppData(ctx)->DefaultTabletTypes;
TActorId bootstrapperActorId;
if (it == State.Tablets.end()) {
if (ev->Get()->Record.AllowedDomainsSize()) {
@@ -423,19 +422,19 @@ class TFakeHive : public TActor<TFakeHive>, public TTabletExecutedFlat {
}
if (bootMode == NKikimrHive::TABLET_BOOT_MODE_EXTERNAL) {
- } else if (type == defaultTabletTypes.Coordinator) {
+ } else if (type == TTabletTypes::Coordinator) {
bootstrapperActorId = Boot(ctx, type, &CreateFlatTxCoordinator, DataGroupErasure);
- } else if (type == defaultTabletTypes.Mediator) {
+ } else if (type == TTabletTypes::Mediator) {
bootstrapperActorId = Boot(ctx, type, &CreateTxMediator, DataGroupErasure);
- } else if (type == defaultTabletTypes.SchemeShard) {
+ } else if (type == TTabletTypes::SchemeShard) {
bootstrapperActorId = Boot(ctx, type, &CreateFlatTxSchemeShard, DataGroupErasure);
- } else if (type == defaultTabletTypes.Hive) {
+ } else if (type == TTabletTypes::Hive) {
bootstrapperActorId = Boot(ctx, type, &CreateDefaultHive, DataGroupErasure);
- } else if (type == defaultTabletTypes.SysViewProcessor) {
+ } else if (type == TTabletTypes::SysViewProcessor) {
bootstrapperActorId = Boot(ctx, type, &NSysView::CreateSysViewProcessor, DataGroupErasure);
- } else if (type == defaultTabletTypes.SequenceShard) {
+ } else if (type == TTabletTypes::SequenceShard) {
bootstrapperActorId = Boot(ctx, type, &NSequenceShard::CreateSequenceShard, DataGroupErasure);
- } else if (type == defaultTabletTypes.ReplicationController) {
+ } else if (type == TTabletTypes::ReplicationController) {
bootstrapperActorId = Boot(ctx, type, &NReplication::CreateController, DataGroupErasure);
} else {
status = NKikimrProto::ERROR;
diff --git a/ydb/core/testlib/test_client.cpp b/ydb/core/testlib/test_client.cpp
index b23300a1c0..9ee263e649 100644
--- a/ydb/core/testlib/test_client.cpp
+++ b/ydb/core/testlib/test_client.cpp
@@ -496,59 +496,59 @@ namespace Tests {
}
void TServer::SetupLocalConfig(TLocalConfig &localConfig, const NKikimr::TAppData &appData) {
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.Dummy] =
+ localConfig.TabletClassInfo[TTabletTypes::Dummy] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&CreateFlatDummyTablet, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.DataShard] =
+ localConfig.TabletClassInfo[TTabletTypes::DataShard] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&CreateDataShard, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.KeyValue] =
+ localConfig.TabletClassInfo[TTabletTypes::KeyValue] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&CreateKeyValueFlat, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.ColumnShard] =
+ localConfig.TabletClassInfo[TTabletTypes::ColumnShard] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&CreateColumnShard, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.PersQueue] =
+ localConfig.TabletClassInfo[TTabletTypes::PersQueue] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&CreatePersQueue, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.PersQueueReadBalancer] =
+ localConfig.TabletClassInfo[TTabletTypes::PersQueueReadBalancer] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&CreatePersQueueReadBalancer, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.Coordinator] =
+ localConfig.TabletClassInfo[TTabletTypes::Coordinator] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&CreateFlatTxCoordinator, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.Mediator] =
+ localConfig.TabletClassInfo[TTabletTypes::Mediator] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&CreateTxMediator, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.Kesus] =
+ localConfig.TabletClassInfo[TTabletTypes::Kesus] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&NKesus::CreateKesusTablet, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.SchemeShard] =
+ localConfig.TabletClassInfo[TTabletTypes::SchemeShard] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&CreateFlatTxSchemeShard, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.Hive] =
+ localConfig.TabletClassInfo[TTabletTypes::Hive] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&CreateDefaultHive, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.SysViewProcessor] =
+ localConfig.TabletClassInfo[TTabletTypes::SysViewProcessor] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&NSysView::CreateSysViewProcessorForTests, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.SequenceShard] =
+ localConfig.TabletClassInfo[TTabletTypes::SequenceShard] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&NSequenceShard::CreateSequenceShard, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));
- localConfig.TabletClassInfo[appData.DefaultTabletTypes.ReplicationController] =
+ localConfig.TabletClassInfo[TTabletTypes::ReplicationController] =
TLocalConfig::TTabletClassInfo(new TTabletSetupInfo(
&NReplication::CreateController, TMailboxType::Revolving, appData.UserPoolId,
TMailboxType::Revolving, appData.SystemPoolId));