stankiewicz commented on code in PR #39020:
URL: https://github.com/apache/beam/pull/39020#discussion_r3614874624
##########
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/MonitoringUtil.java:
##########
@@ -221,17 +221,19 @@ public static State toState(@Nullable String stateName) {
return State.CANCELLED;
case "JOB_STATE_UPDATED":
return State.UPDATED;
+ case "JOB_STATE_DRAINING":
+ return State.DRAINING;
Review Comment:
add there change to include `draining` state as well, e.g.
```
/** Finds the id for the running job of the given name. */
private String getJobIdFromName(String jobName) {
try {
ListJobsResponse listResult;
String token = null;
do {
listResult = dataflowClient.listJobs(token);
token = listResult.getNextPageToken();
for (Job job : listResult.getJobs()) {
if (job.getName().equals(jobName)
&&
(MonitoringUtil.toState(job.getCurrentState()).equals(State.RUNNING)
||
MonitoringUtil.toState(job.getCurrentState()).equals(State.DRAINING))) {
return job.getId();
}
}
} while (token != null);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]