Example #1
0
 def get_job_by_id(self, job_id: str) -> SparkJob:
     if not self._use_job_service:
         return get_job_by_id(job_id, self)
     else:
         request = GetJobRequest(job_id=job_id)
         response = self._job_service.GetJob(request)
         return get_remote_job_from_proto(self._job_service,
                                          self._extra_grpc_params,
                                          response.job)
Example #2
0
 def list_jobs(self, include_terminated: bool) -> List[SparkJob]:
     if not self._use_job_service:
         return list_jobs(include_terminated, self)
     else:
         request = ListJobsRequest(include_terminated=include_terminated)
         response = self._job_service.ListJobs(request)
         return [
             get_remote_job_from_proto(self._job_service,
                                       self._extra_grpc_params, job)
             for job in response.jobs
         ]