aboutsummaryrefslogtreecommitdiffstats
path: root/ydb/tools/query_replay_yt/query_replay.cpp
blob: 1cbfedc05739ef2261d9ad634583a82f9f8576b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "query_replay.h"

#include <ydb/library/actors/core/actorsystem.h>
#include <ydb/library/actors/core/executor_pool_basic.h>
#include <ydb/library/actors/core/scheduler_basic.h>
#include <ydb/library/actors/core/log.h>
#include <ydb/library/actors/core/actor_bootstrapped.h>
#include <ydb/library/actors/util/should_continue.h>

#include <library/cpp/getopt/last_getopt.h>
#include <util/generic/xrange.h>


void TQueryReplayConfig::ParseConfig(int argc, const char** argv) {
    NLastGetopt::TOpts opts = NLastGetopt::TOpts::Default();

    opts.AddLongOption("cluster", "YT cluster").StoreResult(&Cluster).Required();
    opts.AddLongOption("src-path", "Source table path").StoreResult(&SrcPath).Required();
    opts.AddLongOption("dst-path", "Target table path").StoreResult(&DstPath).Required();
    opts.AddLongOption("threads", "Number of ActorSystem threads").StoreResult(&DstPath);

    NLastGetopt::TOptsParseResult parseResult(&opts, argc, argv);
}

THolder<TActorSystemSetup> BuildActorSystemSetup(ui32 threads, ui32 pools) {
    Y_ABORT_UNLESS(threads > 0 && threads < 100);
    Y_ABORT_UNLESS(pools > 0 && pools < 10);

    auto setup = MakeHolder<TActorSystemSetup>();

    setup->NodeId = 1;

    setup->ExecutorsCount = pools;
    setup->Executors.Reset(new TAutoPtr<IExecutorPool>[pools]);
    for (ui32 idx : xrange(pools)) {
        setup->Executors[idx] = new TBasicExecutorPool(idx, threads, 50);
    }

    setup->Scheduler = new TBasicSchedulerThread(TSchedulerConfig(512, 0));

    return setup;
}