public class InMemoryJobService extends org.apache.beam.model.jobmanagement.v1.JobServiceGrpc.JobServiceImplBase implements FnService
JobInvoker
.
Job management is handled in-memory rather than any persistent storage, running the risk of leaking jobs if the InMemoryJobService crashes.
TODO: replace in-memory job management state with persistent solution.
Modifier and Type | Method and Description |
---|---|
void |
cancel(org.apache.beam.model.jobmanagement.v1.JobApi.CancelJobRequest request,
org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.CancelJobResponse> responseObserver) |
void |
close()
.
|
static InMemoryJobService |
create(org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor stagingServiceDescriptor,
java.util.function.Function<java.lang.String,java.lang.String> stagingServiceTokenProvider,
ThrowingConsumer<java.lang.String> cleanupJobFn,
JobInvoker invoker)
Creates an InMemoryJobService.
|
void |
describePipelineOptions(org.apache.beam.model.jobmanagement.v1.JobApi.DescribePipelineOptionsRequest request,
org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.DescribePipelineOptionsResponse> responseObserver) |
void |
getMessageStream(org.apache.beam.model.jobmanagement.v1.JobApi.JobMessagesRequest request,
org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.JobMessagesResponse> responseObserver) |
void |
getState(org.apache.beam.model.jobmanagement.v1.JobApi.GetJobStateRequest request,
org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.GetJobStateResponse> responseObserver) |
void |
getStateStream(org.apache.beam.model.jobmanagement.v1.JobApi.GetJobStateRequest request,
org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.GetJobStateResponse> responseObserver) |
void |
prepare(org.apache.beam.model.jobmanagement.v1.JobApi.PrepareJobRequest request,
org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.PrepareJobResponse> responseObserver) |
void |
run(org.apache.beam.model.jobmanagement.v1.JobApi.RunJobRequest request,
org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.RunJobResponse> responseObserver) |
bindService
public static InMemoryJobService create(org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor stagingServiceDescriptor, java.util.function.Function<java.lang.String,java.lang.String> stagingServiceTokenProvider, ThrowingConsumer<java.lang.String> cleanupJobFn, JobInvoker invoker)
stagingServiceDescriptor
- Endpoint for the staging service.stagingServiceTokenProvider
- Function mapping a preparationId to a staging service token.invoker
- A JobInvoker that will actually create the jobs.public void prepare(org.apache.beam.model.jobmanagement.v1.JobApi.PrepareJobRequest request, org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.PrepareJobResponse> responseObserver)
prepare
in class org.apache.beam.model.jobmanagement.v1.JobServiceGrpc.JobServiceImplBase
public void run(org.apache.beam.model.jobmanagement.v1.JobApi.RunJobRequest request, org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.RunJobResponse> responseObserver)
run
in class org.apache.beam.model.jobmanagement.v1.JobServiceGrpc.JobServiceImplBase
public void getState(org.apache.beam.model.jobmanagement.v1.JobApi.GetJobStateRequest request, org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.GetJobStateResponse> responseObserver)
getState
in class org.apache.beam.model.jobmanagement.v1.JobServiceGrpc.JobServiceImplBase
public void cancel(org.apache.beam.model.jobmanagement.v1.JobApi.CancelJobRequest request, org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.CancelJobResponse> responseObserver)
cancel
in class org.apache.beam.model.jobmanagement.v1.JobServiceGrpc.JobServiceImplBase
public void getStateStream(org.apache.beam.model.jobmanagement.v1.JobApi.GetJobStateRequest request, org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.GetJobStateResponse> responseObserver)
getStateStream
in class org.apache.beam.model.jobmanagement.v1.JobServiceGrpc.JobServiceImplBase
public void getMessageStream(org.apache.beam.model.jobmanagement.v1.JobApi.JobMessagesRequest request, org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.JobMessagesResponse> responseObserver)
getMessageStream
in class org.apache.beam.model.jobmanagement.v1.JobServiceGrpc.JobServiceImplBase
public void describePipelineOptions(org.apache.beam.model.jobmanagement.v1.JobApi.DescribePipelineOptionsRequest request, org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver<org.apache.beam.model.jobmanagement.v1.JobApi.DescribePipelineOptionsResponse> responseObserver)
describePipelineOptions
in class org.apache.beam.model.jobmanagement.v1.JobServiceGrpc.JobServiceImplBase
public void close() throws java.lang.Exception
FnService
There should be no more calls to any service method by the time a call to FnService.close()
begins. Specifically, this means that a Server
that this service is bound to should have
completed a call to the Server.shutdown()
method, and all future incoming calls will be rejected.