Search in sources :

Example 1 with GetJobPipelineRequest

use of org.apache.beam.model.jobmanagement.v1.JobApi.GetJobPipelineRequest in project beam by apache.

the class InMemoryJobService method getPipeline.

@Override
public void getPipeline(GetJobPipelineRequest request, StreamObserver<GetJobPipelineResponse> responseObserver) {
    LOG.trace("{} {}", GetJobPipelineRequest.class.getSimpleName(), request);
    String invocationId = request.getJobId();
    try {
        JobInvocation invocation = getInvocation(invocationId);
        RunnerApi.Pipeline pipeline = invocation.getPipeline();
        GetJobPipelineResponse response = GetJobPipelineResponse.newBuilder().setPipeline(pipeline).build();
        responseObserver.onNext(response);
        responseObserver.onCompleted();
    } catch (StatusRuntimeException | StatusException e) {
        responseObserver.onError(e);
    } catch (Exception e) {
        String errMessage = String.format("Encountered Unexpected Exception for Invocation %s", invocationId);
        LOG.error(errMessage, e);
        responseObserver.onError(Status.INTERNAL.withCause(e).asException());
    }
}
Also used : GetJobPipelineRequest(org.apache.beam.model.jobmanagement.v1.JobApi.GetJobPipelineRequest) RunnerApi(org.apache.beam.model.pipeline.v1.RunnerApi) StatusException(org.apache.beam.vendor.grpc.v1p43p2.io.grpc.StatusException) GetJobPipelineResponse(org.apache.beam.model.jobmanagement.v1.JobApi.GetJobPipelineResponse) StatusRuntimeException(org.apache.beam.vendor.grpc.v1p43p2.io.grpc.StatusRuntimeException) StatusRuntimeException(org.apache.beam.vendor.grpc.v1p43p2.io.grpc.StatusRuntimeException) StatusException(org.apache.beam.vendor.grpc.v1p43p2.io.grpc.StatusException)

Aggregations

GetJobPipelineRequest (org.apache.beam.model.jobmanagement.v1.JobApi.GetJobPipelineRequest)1 GetJobPipelineResponse (org.apache.beam.model.jobmanagement.v1.JobApi.GetJobPipelineResponse)1 RunnerApi (org.apache.beam.model.pipeline.v1.RunnerApi)1 StatusException (org.apache.beam.vendor.grpc.v1p43p2.io.grpc.StatusException)1 StatusRuntimeException (org.apache.beam.vendor.grpc.v1p43p2.io.grpc.StatusRuntimeException)1