Package org.apache.beam.fn.harness
Class ExternalWorkerService
- java.lang.Object
-
- org.apache.beam.model.fnexecution.v1.BeamFnExternalWorkerPoolGrpc.BeamFnExternalWorkerPoolImplBase
-
- org.apache.beam.fn.harness.ExternalWorkerService
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.apache.beam.model.fnexecution.v1.BeamFnExternalWorkerPoolGrpc.AsyncService,org.apache.beam.sdk.fn.server.FnService,org.apache.beam.vendor.grpc.v1p69p0.io.grpc.BindableService
public class ExternalWorkerService extends org.apache.beam.model.fnexecution.v1.BeamFnExternalWorkerPoolGrpc.BeamFnExternalWorkerPoolImplBase implements org.apache.beam.sdk.fn.server.FnServiceImplements the BeamFnExternalWorkerPool service by starting a fresh SDK harness for each request.
-
-
Constructor Summary
Constructors Constructor Description ExternalWorkerService(org.apache.beam.sdk.options.PipelineOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static voidmain(java.lang.String[] args)Worker pool entry point.org.apache.beam.sdk.fn.server.GrpcFnServer<ExternalWorkerService>start()voidstartWorker(org.apache.beam.model.fnexecution.v1.BeamFnApi.StartWorkerRequest request, org.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.StartWorkerResponse> responseObserver)voidstopWorker(org.apache.beam.model.fnexecution.v1.BeamFnApi.StopWorkerRequest request, org.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.StopWorkerResponse> responseObserver)-
Methods inherited from class org.apache.beam.model.fnexecution.v1.BeamFnExternalWorkerPoolGrpc.BeamFnExternalWorkerPoolImplBase
bindService
-
-
-
-
Method Detail
-
startWorker
public void startWorker(org.apache.beam.model.fnexecution.v1.BeamFnApi.StartWorkerRequest request, org.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.StartWorkerResponse> responseObserver)- Specified by:
startWorkerin interfaceorg.apache.beam.model.fnexecution.v1.BeamFnExternalWorkerPoolGrpc.AsyncService
-
stopWorker
public void stopWorker(org.apache.beam.model.fnexecution.v1.BeamFnApi.StopWorkerRequest request, org.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.StopWorkerResponse> responseObserver)- Specified by:
stopWorkerin interfaceorg.apache.beam.model.fnexecution.v1.BeamFnExternalWorkerPoolGrpc.AsyncService
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceorg.apache.beam.sdk.fn.server.FnService
-
start
public org.apache.beam.sdk.fn.server.GrpcFnServer<ExternalWorkerService> start() throws java.lang.Exception
- Throws:
java.lang.Exception
-
main
public static void main(java.lang.String[] args)
Worker pool entry point.The worker pool exposes an RPC service that is used with EXTERNAL environment to start and stop the SDK workers.
The worker pool uses threads for parallelism;
This entry point is used by the Java SDK container in worker pool mode and expects the following environment variables:
- PIPELINE_OPTIONS: A serialized form of
PipelineOptions. It needs to be known up-front and matches the running job. SeePipelineOptionsfor further details.
- PIPELINE_OPTIONS: A serialized form of
-
-