-
Notifications
You must be signed in to change notification settings - Fork 462
Expand file tree
/
Copy pathJobState.php
More file actions
178 lines (170 loc) · 6.87 KB
/
JobState.php
File metadata and controls
178 lines (170 loc) · 6.87 KB
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
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/dataflow/v1beta3/jobs.proto
namespace Google\Cloud\Dataflow\V1beta3;
use UnexpectedValueException;
/**
* Describes the overall state of a
* [google.dataflow.v1beta3.Job][google.dataflow.v1beta3.Job].
*
* Protobuf type <code>google.dataflow.v1beta3.JobState</code>
*/
class JobState
{
/**
* The job's run state isn't specified.
*
* Generated from protobuf enum <code>JOB_STATE_UNKNOWN = 0;</code>
*/
const JOB_STATE_UNKNOWN = 0;
/**
* `JOB_STATE_STOPPED` indicates that the job has not
* yet started to run.
*
* Generated from protobuf enum <code>JOB_STATE_STOPPED = 1;</code>
*/
const JOB_STATE_STOPPED = 1;
/**
* `JOB_STATE_RUNNING` indicates that the job is currently running.
*
* Generated from protobuf enum <code>JOB_STATE_RUNNING = 2;</code>
*/
const JOB_STATE_RUNNING = 2;
/**
* `JOB_STATE_DONE` indicates that the job has successfully completed.
* This is a terminal job state. This state may be set by the Cloud Dataflow
* service, as a transition from `JOB_STATE_RUNNING`. It may also be set via a
* Cloud Dataflow `UpdateJob` call, if the job has not yet reached a terminal
* state.
*
* Generated from protobuf enum <code>JOB_STATE_DONE = 3;</code>
*/
const JOB_STATE_DONE = 3;
/**
* `JOB_STATE_FAILED` indicates that the job has failed. This is a
* terminal job state. This state may only be set by the Cloud Dataflow
* service, and only as a transition from `JOB_STATE_RUNNING`.
*
* Generated from protobuf enum <code>JOB_STATE_FAILED = 4;</code>
*/
const JOB_STATE_FAILED = 4;
/**
* `JOB_STATE_CANCELLED` indicates that the job has been explicitly
* cancelled. This is a terminal job state. This state may only be
* set via a Cloud Dataflow `UpdateJob` call, and only if the job has not
* yet reached another terminal state.
*
* Generated from protobuf enum <code>JOB_STATE_CANCELLED = 5;</code>
*/
const JOB_STATE_CANCELLED = 5;
/**
* `JOB_STATE_UPDATED` indicates that the job was successfully updated,
* meaning that this job was stopped and another job was started, inheriting
* state from this one. This is a terminal job state. This state may only be
* set by the Cloud Dataflow service, and only as a transition from
* `JOB_STATE_RUNNING`.
*
* Generated from protobuf enum <code>JOB_STATE_UPDATED = 6;</code>
*/
const JOB_STATE_UPDATED = 6;
/**
* `JOB_STATE_DRAINING` indicates that the job is in the process of draining.
* A draining job has stopped pulling from its input sources and is processing
* any data that remains in-flight. This state may be set via a Cloud Dataflow
* `UpdateJob` call, but only as a transition from `JOB_STATE_RUNNING`. Jobs
* that are draining may only transition to `JOB_STATE_DRAINED`,
* `JOB_STATE_CANCELLED`, or `JOB_STATE_FAILED`.
*
* Generated from protobuf enum <code>JOB_STATE_DRAINING = 7;</code>
*/
const JOB_STATE_DRAINING = 7;
/**
* `JOB_STATE_DRAINED` indicates that the job has been drained.
* A drained job terminated by stopping pulling from its input sources and
* processing any data that remained in-flight when draining was requested.
* This state is a terminal state, may only be set by the Cloud Dataflow
* service, and only as a transition from `JOB_STATE_DRAINING`.
*
* Generated from protobuf enum <code>JOB_STATE_DRAINED = 8;</code>
*/
const JOB_STATE_DRAINED = 8;
/**
* `JOB_STATE_PENDING` indicates that the job has been created but is not yet
* running. Jobs that are pending may only transition to `JOB_STATE_RUNNING`,
* or `JOB_STATE_FAILED`.
*
* Generated from protobuf enum <code>JOB_STATE_PENDING = 9;</code>
*/
const JOB_STATE_PENDING = 9;
/**
* `JOB_STATE_CANCELLING` indicates that the job has been explicitly cancelled
* and is in the process of stopping. Jobs that are cancelling may only
* transition to `JOB_STATE_CANCELLED` or `JOB_STATE_FAILED`.
*
* Generated from protobuf enum <code>JOB_STATE_CANCELLING = 10;</code>
*/
const JOB_STATE_CANCELLING = 10;
/**
* `JOB_STATE_QUEUED` indicates that the job has been created but is being
* delayed until launch. Jobs that are queued may only transition to
* `JOB_STATE_PENDING` or `JOB_STATE_CANCELLED`.
*
* Generated from protobuf enum <code>JOB_STATE_QUEUED = 11;</code>
*/
const JOB_STATE_QUEUED = 11;
/**
* `JOB_STATE_RESOURCE_CLEANING_UP` indicates that the batch job's associated
* resources are currently being cleaned up after a successful run.
* Currently, this is an opt-in feature, please reach out to Cloud support
* team if you are interested.
*
* Generated from protobuf enum <code>JOB_STATE_RESOURCE_CLEANING_UP = 12;</code>
*/
const JOB_STATE_RESOURCE_CLEANING_UP = 12;
/**
* `JOB_STATE_PAUSING` is not implemented yet.
*
* Generated from protobuf enum <code>JOB_STATE_PAUSING = 13;</code>
*/
const JOB_STATE_PAUSING = 13;
/**
* `JOB_STATE_PAUSED` is not implemented yet.
*
* Generated from protobuf enum <code>JOB_STATE_PAUSED = 14;</code>
*/
const JOB_STATE_PAUSED = 14;
private static $valueToName = [
self::JOB_STATE_UNKNOWN => 'JOB_STATE_UNKNOWN',
self::JOB_STATE_STOPPED => 'JOB_STATE_STOPPED',
self::JOB_STATE_RUNNING => 'JOB_STATE_RUNNING',
self::JOB_STATE_DONE => 'JOB_STATE_DONE',
self::JOB_STATE_FAILED => 'JOB_STATE_FAILED',
self::JOB_STATE_CANCELLED => 'JOB_STATE_CANCELLED',
self::JOB_STATE_UPDATED => 'JOB_STATE_UPDATED',
self::JOB_STATE_DRAINING => 'JOB_STATE_DRAINING',
self::JOB_STATE_DRAINED => 'JOB_STATE_DRAINED',
self::JOB_STATE_PENDING => 'JOB_STATE_PENDING',
self::JOB_STATE_CANCELLING => 'JOB_STATE_CANCELLING',
self::JOB_STATE_QUEUED => 'JOB_STATE_QUEUED',
self::JOB_STATE_RESOURCE_CLEANING_UP => 'JOB_STATE_RESOURCE_CLEANING_UP',
self::JOB_STATE_PAUSING => 'JOB_STATE_PAUSING',
self::JOB_STATE_PAUSED => 'JOB_STATE_PAUSED',
];
public static function name($value)
{
if (!isset(self::$valueToName[$value])) {
throw new UnexpectedValueException(sprintf(
'Enum %s has no name defined for value %s', __CLASS__, $value));
}
return self::$valueToName[$value];
}
public static function value($name)
{
$const = __CLASS__ . '::' . strtoupper($name);
if (!defined($const)) {
throw new UnexpectedValueException(sprintf(
'Enum %s has no value defined for name %s', __CLASS__, $name));
}
return constant($const);
}
}