progress_merger.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include <ydb/library/yql/core/yql_execution.h>
  3. #include <ydb/library/yql/core/progress_merger/progress_merger.h>
  4. #include <library/cpp/yson/writer.h>
  5. namespace NYT::NYqlPlugin {
  6. using namespace NYql::NProgressMerger;
  7. using namespace NYson;
  8. //////////////////////////////////////////////////////////////////////////////
  9. class TNodeProgress : public TNodeProgressBase {
  10. public:
  11. TNodeProgress(const NYql::TOperationProgress& p);
  12. void Serialize(::NYson::TYsonWriter& yson) const;
  13. };
  14. //////////////////////////////////////////////////////////////////////////////
  15. class TProgressMerger : public ITaskProgressMerger {
  16. public:
  17. void MergeWith(const NYql::TOperationProgress& progress) override;
  18. void AbortAllUnfinishedNodes() override;
  19. bool HasChangesSinceLastFlush() const;
  20. TString ToYsonString();
  21. private:
  22. bool HasChanges_ = false;
  23. THashMap<ui32, TNodeProgress> NodesMap_;
  24. };
  25. //////////////////////////////////////////////////////////////////////////////
  26. } // namespace NYT::NYqlPlugin