Skip to content

Commit

Permalink
correct docs
Browse files Browse the repository at this point in the history
  • Loading branch information
davitbzh committed Aug 23, 2023
1 parent 288f2f9 commit 0ce2ac5
Showing 1 changed file with 8 additions and 35 deletions.
43 changes: 8 additions & 35 deletions python/hopsworks/flink_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get_jobs(self):
flink_cluster = flink_cluster_api.get_cluster(name="myFlinkCluster")
# get all executions(This will return empty list of no execution is running on this Flink cluster)
executions = flink_job.get_executions()
executions = flink_cluster.get_executions()
# select 1st execution
execution = executions[0]
Expand Down Expand Up @@ -108,7 +108,7 @@ def get_job(self, job_id):
flink_cluster = flink_cluster_api.get_cluster(name="myFlinkCluster")
# get all executions(This will return empty list of no execution is running on this Flink cluster)
executions = flink_job.get_executions()
executions = flink_cluster.get_executions()
# select 1st execution
execution = executions[0]
Expand All @@ -128,33 +128,6 @@ def get_job(self, job_id):

return self._flink_cluster_api._get_job(self, job_id)

def stop_execution(self):
"""Stop specific execution of the flink cluster.
```python
# log in to hopsworks
import hopsworks
project = hopsworks.login()
# fetch flink cluster handle
flink_cluster_api = project.get_flink_cluster_api()
flink_cluster = flink_cluster_api.get_cluster(name="myFlinkCluster")
# get all executions(This will return empty list of no execution is running on this Flink cluster)
executions = flink_job.get_executions()
# select 1st execution
execution = executions[0]
# stop this execution
execution.stop_execution()
```
# Raises
`RestAPIError`: If unable to stop the execution
"""
self._flink_cluster_api._stop_execution(self)

def stop_job(self, job_id):
"""Stop specific job of the specific execution of the flink cluster.
```python
Expand All @@ -168,7 +141,7 @@ def stop_job(self, job_id):
flink_cluster = flink_cluster_api.get_cluster(name="myFlinkCluster")
# get all executions(This will return empty list of no execution is running on this Flink cluster)
executions = flink_job.get_executions()
executions = flink_cluster.get_executions()
# select 1st execution
execution = executions[0]
Expand Down Expand Up @@ -197,7 +170,7 @@ def get_jars(self):
flink_cluster = flink_cluster_api.get_cluster(name="myFlinkCluster")
# get all executions(This will return empty list of no execution is running on this Flink cluster)
executions = flink_job.get_executions()
executions = flink_cluster.get_executions()
# select 1st execution
execution = executions[0]
Expand Down Expand Up @@ -225,7 +198,7 @@ def upload_jar(self, jar_file):
flink_cluster = flink_cluster_api.get_cluster(name="myFlinkCluster")
# get all executions(This will return empty list of no execution is running on this Flink cluster)
executions = flink_job.get_executions()
executions = flink_cluster.get_executions()
# select 1st execution
execution = executions[0]
Expand Down Expand Up @@ -255,7 +228,7 @@ def submit_job(self, jar_id, main_class, job_arguments=None):
flink_cluster = flink_cluster_api.get_cluster(name="myFlinkCluster")
# get all executions(This will return empty list of no execution is running on this Flink cluster)
executions = flink_job.get_executions()
executions = flink_cluster.get_executions()
# select 1st execution
execution = executions[0]
Expand Down Expand Up @@ -297,7 +270,7 @@ def job_state(self, job_id):
flink_cluster = flink_cluster_api.get_cluster(name="myFlinkCluster")
# get all executions(This will return empty list of no execution is running on this Flink cluster)
executions = flink_job.get_executions()
executions = flink_cluster.get_executions()
# select 1st execution
execution = executions[0]
Expand Down Expand Up @@ -331,7 +304,7 @@ def stop(self):
flink_cluster = flink_cluster_api.get_cluster(name="myFlinkCluster")
# get all executions(This will return empty list of no execution is running on this Flink cluster)
executions = flink_job.get_executions()
executions = flink_cluster.get_executions()
# select 1st execution
execution = executions[0]
Expand Down

0 comments on commit 0ce2ac5

Please sign in to comment.