forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
workflow.pb.go
378 lines (338 loc) · 14.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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: workflow.proto
package workflow // import "vitess.io/vitess/go/vt/proto/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 fileDescriptor_workflow_cc5eebeb403313d8, []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 fileDescriptor_workflow_cc5eebeb403313d8, []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,proto3" 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,proto3" json:"factory_name,omitempty"`
// name is the display name of the workflow.
Name string `protobuf:"bytes,3,opt,name=name,proto3" 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,proto3,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,proto3" 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,proto3" 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,proto3" json:"end_time,omitempty"`
// create_time is set when the workflow is created.
CreateTime int64 `protobuf:"varint,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Workflow) Reset() { *m = Workflow{} }
func (m *Workflow) String() string { return proto.CompactTextString(m) }
func (*Workflow) ProtoMessage() {}
func (*Workflow) Descriptor() ([]byte, []int) {
return fileDescriptor_workflow_cc5eebeb403313d8, []int{0}
}
func (m *Workflow) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Workflow.Unmarshal(m, b)
}
func (m *Workflow) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Workflow.Marshal(b, m, deterministic)
}
func (dst *Workflow) XXX_Merge(src proto.Message) {
xxx_messageInfo_Workflow.Merge(dst, src)
}
func (m *Workflow) XXX_Size() int {
return xxx_messageInfo_Workflow.Size(m)
}
func (m *Workflow) XXX_DiscardUnknown() {
xxx_messageInfo_Workflow.DiscardUnknown(m)
}
var xxx_messageInfo_Workflow proto.InternalMessageInfo
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
}
func (m *Workflow) GetCreateTime() int64 {
if m != nil {
return m.CreateTime
}
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,proto3" 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,proto3" json:"tasks,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// 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,proto3" json:"settings,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *WorkflowCheckpoint) Reset() { *m = WorkflowCheckpoint{} }
func (m *WorkflowCheckpoint) String() string { return proto.CompactTextString(m) }
func (*WorkflowCheckpoint) ProtoMessage() {}
func (*WorkflowCheckpoint) Descriptor() ([]byte, []int) {
return fileDescriptor_workflow_cc5eebeb403313d8, []int{1}
}
func (m *WorkflowCheckpoint) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_WorkflowCheckpoint.Unmarshal(m, b)
}
func (m *WorkflowCheckpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_WorkflowCheckpoint.Marshal(b, m, deterministic)
}
func (dst *WorkflowCheckpoint) XXX_Merge(src proto.Message) {
xxx_messageInfo_WorkflowCheckpoint.Merge(dst, src)
}
func (m *WorkflowCheckpoint) XXX_Size() int {
return xxx_messageInfo_WorkflowCheckpoint.Size(m)
}
func (m *WorkflowCheckpoint) XXX_DiscardUnknown() {
xxx_messageInfo_WorkflowCheckpoint.DiscardUnknown(m)
}
var xxx_messageInfo_WorkflowCheckpoint proto.InternalMessageInfo
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,proto3" json:"id,omitempty"`
State TaskState `protobuf:"varint,2,opt,name=state,proto3,enum=workflow.TaskState" json:"state,omitempty"`
// attributes includes the parameters the task needs.
Attributes map[string]string `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Task) Reset() { *m = Task{} }
func (m *Task) String() string { return proto.CompactTextString(m) }
func (*Task) ProtoMessage() {}
func (*Task) Descriptor() ([]byte, []int) {
return fileDescriptor_workflow_cc5eebeb403313d8, []int{2}
}
func (m *Task) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Task.Unmarshal(m, b)
}
func (m *Task) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Task.Marshal(b, m, deterministic)
}
func (dst *Task) XXX_Merge(src proto.Message) {
xxx_messageInfo_Task.Merge(dst, src)
}
func (m *Task) XXX_Size() int {
return xxx_messageInfo_Task.Size(m)
}
func (m *Task) XXX_DiscardUnknown() {
xxx_messageInfo_Task.DiscardUnknown(m)
}
var xxx_messageInfo_Task proto.InternalMessageInfo
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.RegisterMapType((map[string]string)(nil), "workflow.WorkflowCheckpoint.SettingsEntry")
proto.RegisterMapType((map[string]*Task)(nil), "workflow.WorkflowCheckpoint.TasksEntry")
proto.RegisterType((*Task)(nil), "workflow.Task")
proto.RegisterMapType((map[string]string)(nil), "workflow.Task.AttributesEntry")
proto.RegisterEnum("workflow.WorkflowState", WorkflowState_name, WorkflowState_value)
proto.RegisterEnum("workflow.TaskState", TaskState_name, TaskState_value)
}
func init() { proto.RegisterFile("workflow.proto", fileDescriptor_workflow_cc5eebeb403313d8) }
var fileDescriptor_workflow_cc5eebeb403313d8 = []byte{
// 517 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x6f, 0x8b, 0xd3, 0x4e,
0x10, 0xfe, 0x25, 0x6d, 0xae, 0xe9, 0xa4, 0x97, 0x2b, 0xf3, 0x3b, 0x30, 0x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