use of org.apache.beam.model.jobmanagement.v1.JobApi.GetJobsRequest in project beam by apache.
the class InMemoryJobService method getJobs.
@Override
public void getJobs(GetJobsRequest request, StreamObserver<GetJobsResponse> responseObserver) {
LOG.trace("{} {}", GetJobsRequest.class.getSimpleName(), request);
try {
List<JobInfo> result = new ArrayList<>();
for (JobInvocation invocation : invocations.values()) {
result.add(invocation.toProto());
}
GetJobsResponse response = GetJobsResponse.newBuilder().addAllJobInfo(result).build();
responseObserver.onNext(response);
responseObserver.onCompleted();
} catch (Exception e) {
LOG.error("Encountered Unexpected Exception", e);
responseObserver.onError(Status.INTERNAL.withCause(e).asException());
}
}
Aggregations