This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
/
state.go
63 lines (51 loc) · 1.68 KB
/
state.go
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package handler
import (
"time"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
pluginCore "github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/core"
"github.com/flyteorg/flytestdlib/storage"
"github.com/flyteorg/flytepropeller/pkg/apis/flyteworkflow/v1alpha1"
)
// This is the legacy state structure that gets translated to node status
// TODO eventually we could just convert this to be binary node state encoded into the node status
type TaskNodeState struct {
PluginPhase pluginCore.Phase
PluginPhaseVersion uint32
PluginState []byte
PluginStateVersion uint32
BarrierClockTick uint32
LastPhaseUpdatedAt time.Time
PreviousNodeExecutionCheckpointURI storage.DataReference
}
type BranchNodeState struct {
FinalizedNodeID *v1alpha1.NodeID
Phase v1alpha1.BranchNodePhase
}
type DynamicNodePhase uint8
type DynamicNodeState struct {
Phase v1alpha1.DynamicNodePhase
Reason string
Error *core.ExecutionError
}
type WorkflowNodeState struct {
Phase v1alpha1.WorkflowNodePhase
Error *core.ExecutionError
}
type GateNodeState struct {
Phase v1alpha1.GateNodePhase
StartedAt time.Time
}
type NodeStateWriter interface {
PutTaskNodeState(s TaskNodeState) error
PutBranchNode(s BranchNodeState) error
PutDynamicNodeState(s DynamicNodeState) error
PutWorkflowNodeState(s WorkflowNodeState) error
PutGateNodeState(s GateNodeState) error
}
type NodeStateReader interface {
GetTaskNodeState() TaskNodeState
GetBranchNode() BranchNodeState
GetDynamicNodeState() DynamicNodeState
GetWorkflowNodeState() WorkflowNodeState
GetGateNodeState() GateNodeState
}