Skip to content

Commit 5d2a52f

Browse files
committed
Added QueryServiceConfig into app data
1 parent 9808a23 commit 5d2a52f

File tree

9 files changed

+52
-11
lines changed

9 files changed

+52
-11
lines changed

ydb/core/base/appdata.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ struct TAppData::TImpl {
7171
NKikimrProto::TDataIntegrityTrailsConfig DataIntegrityTrailsConfig;
7272
NKikimrConfig::TDataErasureConfig DataErasureConfig;
7373
NKikimrConfig::THealthCheckConfig HealthCheckConfig;
74+
NKikimrConfig::TQueryServiceConfig QueryServiceConfig;
7475
};
7576

7677
TAppData::TAppData(
@@ -129,6 +130,7 @@ TAppData::TAppData(
129130
, DataIntegrityTrailsConfig(Impl->DataIntegrityTrailsConfig)
130131
, DataErasureConfig(Impl->DataErasureConfig)
131132
, HealthCheckConfig(Impl->HealthCheckConfig)
133+
, QueryServiceConfig(Impl->QueryServiceConfig)
132134
, KikimrShouldContinue(kikimrShouldContinue)
133135
, TracingConfigurator(MakeIntrusive<NJaegerTracing::TSamplingThrottlingConfigurator>(TimeProvider, RandomProvider))
134136
{}

ydb/core/base/appdata_fwd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ namespace NKikimrConfig {
7474
class TMemoryControllerConfig;
7575
class TFeatureFlags;
7676
class THealthCheckConfig;
77+
class TQueryServiceConfig;
7778
}
7879

7980
namespace NKikimrReplication {
@@ -244,6 +245,7 @@ struct TAppData {
244245
NKikimrProto::TDataIntegrityTrailsConfig& DataIntegrityTrailsConfig;
245246
NKikimrConfig::TDataErasureConfig& DataErasureConfig;
246247
NKikimrConfig::THealthCheckConfig& HealthCheckConfig;
248+
NKikimrConfig::TQueryServiceConfig& QueryServiceConfig;
247249
bool EnforceUserTokenRequirement = false;
248250
bool EnforceUserTokenCheckRequirement = false; // check token if it was specified
249251
bool AllowHugeKeyValueDeletes = true; // delete when all clients limit deletes per request

ydb/core/driver_lib/run/run.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,10 @@ void TKikimrRunner::InitializeAppData(const TKikimrRunConfig& runConfig)
12101210
AppData->HealthCheckConfig = runConfig.AppConfig.GetHealthCheckConfig();
12111211
}
12121212

1213+
if (runConfig.AppConfig.HasQueryServiceConfig()) {
1214+
AppData->QueryServiceConfig = runConfig.AppConfig.GetQueryServiceConfig();
1215+
}
1216+
12131217
// setup resource profiles
12141218
AppData->ResourceProfiles = new TResourceProfiles;
12151219
if (runConfig.AppConfig.GetBootstrapConfig().ResourceProfilesSize())

ydb/core/testlib/actors/test_runtime.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ namespace NActors {
179179
nodeAppData->AwsCompatibilityConfig = app0->AwsCompatibilityConfig;
180180
nodeAppData->S3ProxyResolverConfig = app0->S3ProxyResolverConfig;
181181
nodeAppData->GraphConfig = app0->GraphConfig;
182+
nodeAppData->QueryServiceConfig = app0->QueryServiceConfig;
182183
nodeAppData->EnableMvccSnapshotWithLegacyDomainRoot = app0->EnableMvccSnapshotWithLegacyDomainRoot;
183184
nodeAppData->IoContextFactory = app0->IoContextFactory;
184185
nodeAppData->SchemeOperationFactory = app0->SchemeOperationFactory;

ydb/core/testlib/basics/appdata.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ namespace NKikimr {
6565
app->AwsCompatibilityConfig = AwsCompatibilityConfig;
6666
app->S3ProxyResolverConfig = S3ProxyResolverConfig;
6767
app->GraphConfig = GraphConfig;
68+
app->QueryServiceConfig = QueryServiceConfig;
6869
app->InitFeatureFlags(FeatureFlags);
6970

7071
// This is a special setting active in test runtime only

ydb/core/testlib/basics/appdata.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ namespace NKikimr {
111111
NKikimrConfig::TGraphConfig GraphConfig;
112112
NKikimrConfig::TImmediateControlsConfig ImmediateControlsConfig;
113113
NKikimrResourceBroker::TResourceBrokerConfig ResourceBrokerConfig;
114+
NKikimrConfig::TQueryServiceConfig QueryServiceConfig;
114115
std::vector<TIntrusivePtr<NKikimr::TControlBoard>> Icb;
115116

116117
private:

ydb/core/testlib/test_client.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,9 @@ namespace Tests {
467467
if (Settings->AppConfig->HasResourceBrokerConfig()) {
468468
app.ResourceBrokerConfig = Settings->AppConfig->GetResourceBrokerConfig();
469469
}
470+
if (Settings->AppConfig->HasQueryServiceConfig()) {
471+
app.QueryServiceConfig = Settings->AppConfig->GetQueryServiceConfig();
472+
}
470473

471474
// forcibly turn on some feature flags
472475
app.FeatureFlags = Settings->FeatureFlags;

ydb/core/tx/schemeshard/schemeshard_impl.cpp

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4665,9 +4665,12 @@ void TSchemeShard::OnActivateExecutor(const TActorContext &ctx) {
46654665
EnableReplaceIfExistsForExternalEntities = appData->FeatureFlags.GetEnableReplaceIfExistsForExternalEntities();
46664666
EnableTempTables = appData->FeatureFlags.GetEnableTempTables();
46674667
EnableTableDatetime64 = appData->FeatureFlags.GetEnableTableDatetime64();
4668+
EnableResourcePoolsOnServerless = appData->FeatureFlags.GetEnableResourcePoolsOnServerless();
46684669
EnableVectorIndex = appData->FeatureFlags.GetEnableVectorIndex();
4670+
EnableExternalDataSourcesOnServerless = appData->FeatureFlags.GetEnableExternalDataSourcesOnServerless();
46694671
EnableParameterizedDecimal = appData->FeatureFlags.GetEnableParameterizedDecimal();
46704672
EnableDataErasure = appData->FeatureFlags.GetEnableDataErasure();
4673+
EnableExternalSourceSchemaInference = appData->FeatureFlags.GetEnableExternalSourceSchemaInference();
46714674

46724675
ConfigureCompactionQueues(appData->CompactionConfig, ctx);
46734676
ConfigureStatsBatching(appData->SchemeShardConfig, ctx);
@@ -4677,6 +4680,7 @@ void TSchemeShard::OnActivateExecutor(const TActorContext &ctx) {
46774680

46784681
ConfigureBackgroundCleaningQueue(appData->BackgroundCleaningConfig, ctx);
46794682
ConfigureDataErasureManager(appData->DataErasureConfig);
4683+
ConfigureQueryService(appData->QueryServiceConfig, ctx);
46804684

46814685
if (appData->ChannelProfiles) {
46824686
ChannelProfiles = appData->ChannelProfiles;
@@ -7258,17 +7262,8 @@ void TSchemeShard::ApplyConsoleConfigs(const NKikimrConfig::TAppConfig& appConfi
72587262
}
72597263

72607264
if (appConfig.HasQueryServiceConfig()) {
7261-
const auto& hostnamePatterns = appConfig.GetQueryServiceConfig().GetHostnamePatterns();
7262-
const auto& availableExternalDataSources = appConfig.GetQueryServiceConfig().GetAvailableExternalDataSources();
7263-
ExternalSourceFactory = NExternalSource::CreateExternalSourceFactory(
7264-
std::vector<TString>(hostnamePatterns.begin(), hostnamePatterns.end()),
7265-
nullptr,
7266-
appConfig.GetQueryServiceConfig().GetS3().GetGeneratorPathsLimit(),
7267-
nullptr,
7268-
appConfig.GetFeatureFlags().GetEnableExternalSourceSchemaInference(),
7269-
appConfig.GetQueryServiceConfig().GetS3().GetAllowLocalFiles(),
7270-
std::set<TString>(availableExternalDataSources.cbegin(), availableExternalDataSources.cend())
7271-
);
7265+
const auto& queryServiceConfig = appConfig.GetQueryServiceConfig();
7266+
ConfigureQueryService(queryServiceConfig, ctx);
72727267
}
72737268

72747269
if (appConfig.HasAuthConfig()) {
@@ -7314,6 +7309,7 @@ void TSchemeShard::ApplyConsoleConfigs(const NKikimrConfig::TFeatureFlags& featu
73147309
EnableExternalDataSourcesOnServerless = featureFlags.GetEnableExternalDataSourcesOnServerless();
73157310
EnableParameterizedDecimal = featureFlags.GetEnableParameterizedDecimal();
73167311
EnableDataErasure = featureFlags.GetEnableDataErasure();
7312+
EnableExternalSourceSchemaInference = featureFlags.GetEnableExternalSourceSchemaInference();
73177313
}
73187314

73197315
void TSchemeShard::ConfigureStatsBatching(const NKikimrConfig::TSchemeShardConfig& config, const TActorContext& ctx) {
@@ -7522,6 +7518,32 @@ void TSchemeShard::ConfigureAccountLockout(
75227518
<< ", AttemptResetDuration# " << accountLockoutInitializer.AttemptResetDuration);
75237519
}
75247520

7521+
void TSchemeShard::ConfigureQueryService(
7522+
const NKikimrConfig::TQueryServiceConfig& config,
7523+
const TActorContext& ctx)
7524+
{
7525+
const auto& hostnamePatterns = config.GetHostnamePatterns();
7526+
const auto& availableExternalDataSources = config.GetAvailableExternalDataSources();
7527+
const auto pathsLimit = config.GetS3().GetGeneratorPathsLimit();
7528+
const auto allowLocalFiles = config.GetS3().GetAllowLocalFiles();
7529+
ExternalSourceFactory = NExternalSource::CreateExternalSourceFactory(
7530+
std::vector<TString>(hostnamePatterns.begin(), hostnamePatterns.end()),
7531+
nullptr,
7532+
pathsLimit,
7533+
nullptr,
7534+
EnableExternalSourceSchemaInference,
7535+
allowLocalFiles,
7536+
std::set<TString>(availableExternalDataSources.cbegin(), availableExternalDataSources.cend())
7537+
);
7538+
7539+
LOG_NOTICE_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
7540+
"QueryService configured: HostnamePatterns# [" << Join(", ", hostnamePatterns) << "]"
7541+
<< ", AvailableExternalDataSources# [" << Join(", ", availableExternalDataSources) << "]"
7542+
<< ", PathsLimit# " << pathsLimit
7543+
<< ", EnableExternalSourceSchemaInference# " << (EnableExternalSourceSchemaInference ? "true" : "false")
7544+
<< ", AllowLocalFiles# " << (allowLocalFiles ? "true" : "false"));
7545+
}
7546+
75257547
void TSchemeShard::StartStopCompactionQueues() {
75267548
// note, that we don't need to check current state of compaction queue
75277549
if (IsServerlessDomain(TPath::Init(RootPathId(), this))) {

ydb/core/tx/schemeshard/schemeshard_impl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ class TSchemeShard
345345
bool EnableExternalDataSourcesOnServerless = false;
346346
bool EnableParameterizedDecimal = false;
347347
bool EnableDataErasure = false;
348+
bool EnableExternalSourceSchemaInference = false;
348349

349350
TShardDeleter ShardDeleter;
350351

@@ -511,6 +512,10 @@ class TSchemeShard
511512
const ::NKikimrProto::TAuthConfig& config,
512513
const TActorContext &ctx);
513514

515+
void ConfigureQueryService(
516+
const NKikimrConfig::TQueryServiceConfig& config,
517+
const TActorContext& ctx);
518+
514519
void StartStopCompactionQueues();
515520

516521
void WaitForTableProfiles(ui64 importId, ui32 itemIdx);

0 commit comments

Comments
 (0)