Skip to content

Commit 61d254c

Browse files
committed
Moved validation before running workload in several threads
1 parent db41c93 commit 61d254c

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

ydb/library/workload/abstract/workload_query_generator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ class TWorkloadParams {
178178
}
179179
virtual TString GetWorkloadName() const = 0;
180180

181+
virtual void Validate() const {};
181182
public:
182183
ui64 BulkSize = 10000;
183184
std::string DbPath;

ydb/library/workload/log/log.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ void TLogWorkloadParams::Validate() const {
445445
if (dateFromPassed && dateToPassed && *TimestampDateFrom >= *TimestampDateTo) {
446446
throw yexception() << "Invalid interval [`date-from`, `date-to`)";
447447
}
448-
448+
449449
return;
450450
}
451451

@@ -505,8 +505,6 @@ void TLogWorkloadParams::ConfigureOpts(NLastGetopt::TOpts& opts, const ECommandT
505505
}
506506

507507
THolder<IWorkloadQueryGenerator> TLogWorkloadParams::CreateGenerator() const {
508-
Validate();
509-
510508
return MakeHolder<TLogGenerator>(this);
511509
}
512510

ydb/library/workload/log/log.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class TLogWorkloadParams : public TWorkloadParams {
3737
YDB_READONLY(EStoreType, StoreType, EStoreType::Row);
3838
TWorkloadDataInitializer::TList CreateDataInitializers() const override;
3939

40+
void Validate() const override;
4041
private:
41-
void Validate() const;
4242
void ConfigureOptsFillData(NLastGetopt::TOpts& opts);
4343
void ConfigureOptsColumns(NLastGetopt::TOpts& opts);
4444
};

ydb/public/lib/ydb_cli/commands/ydb_workload.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,7 @@ int TWorkloadCommand::RunWorkload(NYdbWorkload::IWorkloadQueryGenerator& workloa
279279
StopTime = StartTime + TDuration::Seconds(TotalSec);
280280

281281
NPar::LocalExecutor().RunAdditionalThreads(Threads);
282-
// bool invalidParams = false;
283-
// До разделения на потоки сделать валидацию.
284-
282+
285283
auto futures = NPar::LocalExecutor().ExecRangeWithFutures([this, &workloadGen, type](int id) {
286284
try {
287285
WorkerFn(id, workloadGen, type);
@@ -353,6 +351,7 @@ int TWorkloadCommandRun::Run(TConfig& config) {
353351
PrepareForRun(config);
354352
Params.DbPath = config.Database;
355353
auto workloadGen = Params.CreateGenerator();
354+
Params.Validate();
356355
return RunWorkload(*workloadGen, Type);
357356
}
358357

0 commit comments

Comments
 (0)