pranavbhandari24 commented on code in PR #26444:
URL: https://github.com/apache/beam/pull/26444#discussion_r1196709490


##########
it/common/src/main/java/org/apache/beam/it/common/PipelineLauncher.java:
##########
@@ -0,0 +1,422 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.it.common;
+
+import static org.apache.beam.it.common.utils.PipelineUtils.createJobName;
+
+import com.google.api.services.dataflow.model.Job;
+import com.google.auto.value.AutoValue;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import javax.annotation.Nullable;
+import org.apache.beam.sdk.Pipeline;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap;
+import 
org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableSet;
+
+/** Client for working with Cloud Dataflow. */
+public interface PipelineLauncher {
+  /** Enum representing Apache Beam SDKs. */
+  enum Sdk {
+    JAVA("JAVA"),
+    PYTHON("PYTHON"),
+    GO("GO");
+
+    private final String text;
+
+    Sdk(String text) {
+      this.text = text;
+    }
+
+    @Override
+    public String toString() {
+      return text;
+    }
+  }
+
+  /** Enum representing known Dataflow job states. */
+  enum JobState {
+    UNKNOWN("JOB_STATE_UNKNOWN"),
+    STOPPED("JOB_STATE_STOPPED"),
+    RUNNING("JOB_STATE_RUNNING"),
+    DONE("JOB_STATE_DONE"),
+    FAILED("JOB_STATE_FAILED"),
+    CANCELLED("JOB_STATE_CANCELLED"),
+    UPDATED("JOB_STATE_UPDATED"),
+    DRAINING("JOB_STATE_DRAINING"),
+    DRAINED("JOB_STATE_DRAINED"),
+    PENDING("JOB_STATE_PENDING"),
+    CANCELLING("JOB_STATE_CANCELLING"),
+    QUEUED("JOB_STATE_QUEUED"),
+    RESOURCE_CLEANING_UP("JOB_STATE_RESOURCE_CLEANING_UP");
+
+    private static final String DATAFLOW_PREFIX = "JOB_STATE_";
+
+    /** States that indicate the job is getting ready to run. */
+    public static final ImmutableSet<JobState> PENDING_STATES = 
ImmutableSet.of(PENDING, QUEUED);

Review Comment:
   I couldn't find it in the DataflowRunner code base, and I'm not sure if it 
makes sense to add this in that code base if it is only going to be used here?
   
   Either way, I'd like to move the framework to beam from the Templates repo 
before making such changes to make the migration simpler. 



-- 
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]

Reply via email to