Skip to content

Commit

Permalink
YQL-17542 remove unused abstraction (ydb-platform#1184)
Browse files Browse the repository at this point in the history
  • Loading branch information
zverevgeny authored Jan 24, 2024
1 parent f78fb7b commit f711ded
Showing 1 changed file with 11 additions and 26 deletions.
37 changes: 11 additions & 26 deletions ydb/library/yql/providers/dq/task_runner/tasks_runner_local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,13 @@ class TLocalTaskRunner: public ITaskRunner {

/*______________________________________________________________________________________________*/

class TAbstractFactory: public IProxyFactory {
class TLocalFactory: public IProxyFactory {
public:
TAbstractFactory(const NKikimr::NMiniKQL::IFunctionRegistry* functionRegistry,
TLocalFactory(const NKikimr::NMiniKQL::IFunctionRegistry* functionRegistry,
NKikimr::NMiniKQL::TComputationNodeFactory compFactory,
TTaskTransformFactory taskTransformFactory,
std::shared_ptr<NKikimr::NMiniKQL::TComputationPatternLRUCache> patternCache)
std::shared_ptr<NKikimr::NMiniKQL::TComputationPatternLRUCache> patternCache,
bool terminateOnError)
: DeterministicMode(!!GetEnv("YQL_DETERMINISTIC_MODE"))
, RandomProvider(
DeterministicMode
Expand All @@ -210,6 +211,7 @@ class TAbstractFactory: public IProxyFactory {
: CreateDefaultTimeProvider())
, FunctionRegistry(functionRegistry)
, TaskTransformFactory(std::move(taskTransformFactory))
, TerminateOnError(terminateOnError)
{
ExecutionContext.FuncRegistry = FunctionRegistry;
ExecutionContext.ComputationFactory = compFactory;
Expand All @@ -218,29 +220,6 @@ class TAbstractFactory: public IProxyFactory {
ExecutionContext.PatternCache = patternCache;
}

protected:
bool DeterministicMode;
TIntrusivePtr<IRandomProvider> RandomProvider;
TIntrusivePtr<ITimeProvider> TimeProvider;
const NKikimr::NMiniKQL::IFunctionRegistry* FunctionRegistry;
TTaskTransformFactory TaskTransformFactory;

NDq::TDqTaskRunnerContext ExecutionContext;
};

/*______________________________________________________________________________________________*/

class TLocalFactory: public TAbstractFactory {
public:
TLocalFactory(const NKikimr::NMiniKQL::IFunctionRegistry* functionRegistry,
NKikimr::NMiniKQL::TComputationNodeFactory compFactory,
TTaskTransformFactory taskTransformFactory,
std::shared_ptr<NKikimr::NMiniKQL::TComputationPatternLRUCache> patternCache,
bool terminateOnError)
: TAbstractFactory(functionRegistry, compFactory, taskTransformFactory, patternCache)
, TerminateOnError(terminateOnError)
{ }

ITaskRunner::TPtr GetOld(const TDqTaskSettings& task, const TString& traceId) override {
return new TLocalTaskRunner(task, Get(task, NDqProto::DQ_STATS_MODE_BASIC, traceId));
}
Expand Down Expand Up @@ -287,6 +266,12 @@ class TLocalFactory: public TAbstractFactory {
}

private:
bool DeterministicMode;
TIntrusivePtr<IRandomProvider> RandomProvider;
TIntrusivePtr<ITimeProvider> TimeProvider;
const NKikimr::NMiniKQL::IFunctionRegistry* FunctionRegistry;
TTaskTransformFactory TaskTransformFactory;
NDq::TDqTaskRunnerContext ExecutionContext;
const bool TerminateOnError;
};

Expand Down

0 comments on commit f711ded

Please sign in to comment.