forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
workflow.pb.go
305 lines (267 loc) · 11.2 KB
/
workflow.pb.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
// Code generated by protoc-gen-go.
// source: workflow.proto
// DO NOT EDIT!
/*
Package workflow is a generated protocol buffer package.
It is generated from these files:
workflow.proto
It has these top-level messages:
Workflow
WorkflowCheckpoint
Task
*/
package workflow
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// WorkflowState describes the state of a workflow.
// This constant should match the Node object described in
// web/vtctld2/src/app/workflows/node.ts as it is exposed as JSON to
// the Angular 2 web app.
type WorkflowState int32
const (
WorkflowState_NotStarted WorkflowState = 0
WorkflowState_Running WorkflowState = 1
WorkflowState_Done WorkflowState = 2
)
var WorkflowState_name = map[int32]string{
0: "NotStarted",
1: "Running",
2: "Done",
}
var WorkflowState_value = map[string]int32{
"NotStarted": 0,
"Running": 1,
"Done": 2,
}
func (x WorkflowState) String() string {
return proto.EnumName(WorkflowState_name, int32(x))
}
func (WorkflowState) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
type TaskState int32
const (
TaskState_TaskNotStarted TaskState = 0
TaskState_TaskRunning TaskState = 1
TaskState_TaskDone TaskState = 2
)
var TaskState_name = map[int32]string{
0: "TaskNotStarted",
1: "TaskRunning",
2: "TaskDone",
}
var TaskState_value = map[string]int32{
"TaskNotStarted": 0,
"TaskRunning": 1,
"TaskDone": 2,
}
func (x TaskState) String() string {
return proto.EnumName(TaskState_name, int32(x))
}
func (TaskState) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
// Workflow is the persisted state of a long-running workflow.
type Workflow struct {
// uuid is set when the workflow is created, and immutable after
// that.
Uuid string `protobuf:"bytes,1,opt,name=uuid" json:"uuid,omitempty"`
// factory_name is set with the name of the factory that created the
// job (and can also restart it). It is set at creation time, and
// immutable after that.
FactoryName string `protobuf:"bytes,2,opt,name=factory_name,json=factoryName" json:"factory_name,omitempty"`
// name is the display name of the workflow.
Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"`
// state describes the state of the job. A job is created as
// NotStarted, then the Workflow Manager picks it up and starts it,
// switching it to Running (and populating 'start_time'). The
// workflow can then fail over to a new Workflow Manager is
// necessary, and still be in Running state. When done, it goes to
// Done, 'end_time' is populated, and 'error' is set if there was an
// error.
State WorkflowState `protobuf:"varint,4,opt,name=state,enum=workflow.WorkflowState" json:"state,omitempty"`
// data is workflow-specific stored data. It is usually a binary
// proto-encoded data structure. It can vary throughout the
// execution of the workflow. It will not change after the workflow
// is Done.
Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
// error is set if the job finished with an error. This field only
// makes sense if 'state' is Done.
Error string `protobuf:"bytes,6,opt,name=error" json:"error,omitempty"`
// start_time is set when the workflow manager starts a workflow for
// the first time. This field only makes sense if 'state' is Running
// or Done.
StartTime int64 `protobuf:"varint,7,opt,name=start_time,json=startTime" json:"start_time,omitempty"`
// end_time is set when the workflow is finished.
// This field only makes sense if 'state' is Done.
EndTime int64 `protobuf:"varint,8,opt,name=end_time,json=endTime" json:"end_time,omitempty"`
}
func (m *Workflow) Reset() { *m = Workflow{} }
func (m *Workflow) String() string { return proto.CompactTextString(m) }
func (*Workflow) ProtoMessage() {}
func (*Workflow) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *Workflow) GetUuid() string {
if m != nil {
return m.Uuid
}
return ""
}
func (m *Workflow) GetFactoryName() string {
if m != nil {
return m.FactoryName
}
return ""
}
func (m *Workflow) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Workflow) GetState() WorkflowState {
if m != nil {
return m.State
}
return WorkflowState_NotStarted
}
func (m *Workflow) GetData() []byte {
if m != nil {
return m.Data
}
return nil
}
func (m *Workflow) GetError() string {
if m != nil {
return m.Error
}
return ""
}
func (m *Workflow) GetStartTime() int64 {
if m != nil {
return m.StartTime
}
return 0
}
func (m *Workflow) GetEndTime() int64 {
if m != nil {
return m.EndTime
}
return 0
}
type WorkflowCheckpoint struct {
// code_version is used to detect incompabilities between the version of the
// running workflow and the one which wrote the checkpoint. If they don't
// match, the workflow must not continue. The author of workflow must update
// this variable in their implementation when incompabilities are introduced.
CodeVersion int32 `protobuf:"varint,1,opt,name=code_version,json=codeVersion" json:"code_version,omitempty"`
// Task is the data structure that stores the execution status and the
// attributes of a task.
Tasks map[string]*Task `protobuf:"bytes,2,rep,name=tasks" json:"tasks,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
// settings includes workflow specific data, e.g. the resharding workflow
// would store the source shards and destination shards.
Settings map[string]string `protobuf:"bytes,3,rep,name=settings" json:"settings,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}
func (m *WorkflowCheckpoint) Reset() { *m = WorkflowCheckpoint{} }
func (m *WorkflowCheckpoint) String() string { return proto.CompactTextString(m) }
func (*WorkflowCheckpoint) ProtoMessage() {}
func (*WorkflowCheckpoint) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *WorkflowCheckpoint) GetCodeVersion() int32 {
if m != nil {
return m.CodeVersion
}
return 0
}
func (m *WorkflowCheckpoint) GetTasks() map[string]*Task {
if m != nil {
return m.Tasks
}
return nil
}
func (m *WorkflowCheckpoint) GetSettings() map[string]string {
if m != nil {
return m.Settings
}
return nil
}
type Task struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
State TaskState `protobuf:"varint,2,opt,name=state,enum=workflow.TaskState" json:"state,omitempty"`
// attributes includes the parameters the task needs.
Attributes map[string]string `protobuf:"bytes,3,rep,name=attributes" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
Error string `protobuf:"bytes,4,opt,name=error" json:"error,omitempty"`
}
func (m *Task) Reset() { *m = Task{} }
func (m *Task) String() string { return proto.CompactTextString(m) }
func (*Task) ProtoMessage() {}
func (*Task) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *Task) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *Task) GetState() TaskState {
if m != nil {
return m.State
}
return TaskState_TaskNotStarted
}
func (m *Task) GetAttributes() map[string]string {
if m != nil {
return m.Attributes
}
return nil
}
func (m *Task) GetError() string {
if m != nil {
return m.Error
}
return ""
}
func init() {
proto.RegisterType((*Workflow)(nil), "workflow.Workflow")
proto.RegisterType((*WorkflowCheckpoint)(nil), "workflow.WorkflowCheckpoint")
proto.RegisterType((*Task)(nil), "workflow.Task")
proto.RegisterEnum("workflow.WorkflowState", WorkflowState_name, WorkflowState_value)
proto.RegisterEnum("workflow.TaskState", TaskState_name, TaskState_value)
}
func init() { proto.RegisterFile("workflow.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 477 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xdb, 0x6e, 0xd3, 0x40,
0x10, 0x65, 0x7d, 0x69, 0x9c, 0x71, 0xea, 0x46, 0x43, 0x25, 0x4c, 0x24, 0x90, 0x89, 0x90, 0x30,
0x91, 0xc8, 0x43, 0x90, 0x10, 0x02, 0xb5, 0x12, 0xe2, 0x22, 0x9e, 0xfa, 0xe0, 0x54, 0xf0, 0x18,
0x6d, 0xe3, 0x6d, 0x59, 0xa5, 0xd9, 0xad, 0xd6, 0xeb, 0x56, 0xf9, 0x40, 0x7e, 0x81, 0x6f, 0xe0,
0x33, 0xd0, 0xee, 0xc6, 0x4e, 0x0c, 0x08, 0x89, 0xb7, 0x99, 0x39, 0x73, 0xce, 0x78, 0xf6, 0x8c,
0x21, 0xb9, 0x93, 0x6a, 0x75, 0x79, 0x2d, 0xef, 0xa6, 0x37, 0x4a, 0x6a, 0x89, 0x51, 0x93, 0x8f,
0x7f, 0x12, 0x88, 0xbe, 0x6e, 0x13, 0x44, 0x08, 0xea, 0x9a, 0x97, 0x29, 0xc9, 0x48, 0xde, 0x2f,
0x6c, 0x8c, 0x4f, 0x60, 0x70, 0x49, 0x97, 0x5a, 0xaa, 0xcd, 0x42, 0xd0, 0x35, 0x4b, 0x3d, 0x8b,
0xc5, 0xdb, 0xda, 0x19, 0x5d, 0x33, 0x43, 0xb3, 0x90, 0xef, 0x68, 0x26, 0xc6, 0x17, 0x10, 0x56,
0x9a, 0x6a, 0x96, 0x06, 0x19, 0xc9, 0x93, 0xd9, 0x83, 0x69, 0xfb, 0x05, 0xcd, 0xb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