Ejemplo n.º 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)
Ejemplo n.º 2
0
 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))
Ejemplo n.º 3
0
 def get_job_by_id(self, job_id: str) -> SparkJob:
     return get_job_by_id(job_id, self)
Ejemplo n.º 4
0
 def CancelJob(self, request, context):
     """Stop a single job"""
     job = get_job_by_id(request.job_id, client=self.client)
     job.cancel()
     return CancelJobResponse()