blob: 42a3a8d32291ff2c4930312efcc4f21035d19045 (
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
43
44
45
46
47
48
|
#include <yql/essentials/core/yql_execution.h>
#include <util/generic/hash.h>
#include <util/system/spinlock.h>
namespace NYql::NProgressMerger {
//////////////////////////////////////////////////////////////////////////////
// TNodeProgressBase
//////////////////////////////////////////////////////////////////////////////
class TNodeProgressBase {
public:
using EState = TOperationProgress::EState;
TNodeProgressBase(const TOperationProgress& p);
TNodeProgressBase(
const TOperationProgress& p,
TInstant startedAt,
TInstant finishedAt,
const TVector<TOperationProgress::TStage>& stages);
bool MergeWith(const TOperationProgress& p);
void Abort();
bool IsUnfinished() const;
bool IsDirty() const;
void SetDirty(bool dirty);
protected:
TOperationProgress Progress_;
TInstant StartedAt_;
TInstant FinishedAt_;
TVector<TOperationProgress::TStage> Stages_;
private:
bool Dirty_;
};
//////////////////////////////////////////////////////////////////////////////
// ITaskProgressMerger
//////////////////////////////////////////////////////////////////////////////
struct ITaskProgressMerger {
virtual ~ITaskProgressMerger() = default;
virtual void MergeWith(const TOperationProgress& progress) = 0;
virtual void AbortAllUnfinishedNodes() = 0;
};
} // namespace NProgressMerger
|