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)
def GetJob(self, request, context): """Get details of a single job""" job = get_job_by_id(request.job_id, client=self.client) return GetJobResponse(job=_job_to_proto(job))
def get_job_by_id(self, job_id: str) -> SparkJob: return get_job_by_id(job_id, self)
def CancelJob(self, request, context): """Stop a single job""" job = get_job_by_id(request.job_id, client=self.client) job.cancel() return CancelJobResponse()