VictorPlusC commented on a change in pull request #17127:
URL: https://github.com/apache/beam/pull/17127#discussion_r839082028



##########
File path: sdks/python/apache_beam/runners/interactive/interactive_beam.py
##########
@@ -443,6 +448,31 @@ def cleanup(
       self.master_urls_to_pipelines.clear()
       self.master_urls_to_dashboards.clear()
 
+  def delete_cluster(self, id: str):
+    """Deletes the cluster with the given obfuscated identifier from the
+    Interactive Environment, as well as from Dataproc. Additionally, unassigns
+    the 'flink_master' pipeline option for all impacted pipelines.
+    """
+    clusters_data = ie.current_env().inspector.get_cluster_data()
+    pipelines = [
+        ie.current_env().pipeline_id_to_pipeline(pid)
+        for pid in clusters_data[id]['pipelines']
+    ]
+    for p in pipelines:
+      ie.current_env().clusters.cleanup(p)
+      p.options.view_as(FlinkRunnerOptions).flink_master = '[auto]'
+
+  def set_default_cluster(self, id: str):

Review comment:
       Similarly with delete_cluster(), I've now implemented this. Thanks.

##########
File path: sdks/python/apache_beam/runners/interactive/interactive_beam.py
##########
@@ -443,6 +448,31 @@ def cleanup(
       self.master_urls_to_pipelines.clear()
       self.master_urls_to_dashboards.clear()
 
+  def delete_cluster(self, id: str):
+    """Deletes the cluster with the given obfuscated identifier from the
+    Interactive Environment, as well as from Dataproc. Additionally, unassigns
+    the 'flink_master' pipeline option for all impacted pipelines.
+    """
+    clusters_data = ie.current_env().inspector.get_cluster_data()
+    pipelines = [
+        ie.current_env().pipeline_id_to_pipeline(pid)
+        for pid in clusters_data[id]['pipelines']
+    ]
+    for p in pipelines:
+      ie.current_env().clusters.cleanup(p)
+      p.options.view_as(FlinkRunnerOptions).flink_master = '[auto]'
+
+  def set_default_cluster(self, id: str):

Review comment:
       Similarly to delete_cluster(), I've now implemented this. Thanks.




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