#pragma once

#include <saas/deploy_manager/scripts/common/script.h>
#include <saas/deploy_manager/scripts/common/scripts_helper.h>
#include <saas/library/daemon_base/actions_engine/controller_script.h>
#include <saas/deploy_manager/scripts/cluster/cluster_task.h>
#include <util/thread/pool.h>

#define RESHARD_TASK_TYPE "RESHARD_TASK"

namespace NRTYDeploy {

    class TReshardTask : public TClusterTask {
    private:
        NSearchMapParser::TShardIndex ShardMin;
        NSearchMapParser::TShardIndex ShardMax;
        ui32 NewPartsCount;
    public:
        TReshardTask(
            NSearchMapParser::TShardIndex shardMin, NSearchMapParser::TShardIndex shardMax, ui32 newPartsCount,
            const TClusterTask::TCgiContext& context, NRTYDeploy::ICommonData* commonData);
        virtual void DoBuildTask() override;
    };

}

