Package org.apache.beam.sdk.fn.server
Class GrpcFnServer<ServiceT extends FnService>
java.lang.Object
org.apache.beam.sdk.fn.server.GrpcFnServer<ServiceT>
- All Implemented Interfaces:
AutoCloseable
A
gRPC Server which manages a single FnService. The lifetime of the
service is bound to the GrpcFnServer.-
Method Summary
Modifier and TypeMethodDescriptionstatic List<GrpcFnServer<? extends FnService>> allocatePortAndCreateFor(List<? extends FnService> services, ServerFactory factory) CreateGrpcFnServers for the providedFnServices running on an arbitrary port.static <ServiceT extends FnService>
GrpcFnServer<ServiceT> allocatePortAndCreateFor(ServiceT service, ServerFactory factory) Create aGrpcFnServerfor the providedFnServicerunning on an arbitrary port.voidclose()static List<GrpcFnServer<? extends FnService>> create(List<? extends FnService> services, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint, ServerFactory factory) CreateGrpcFnServers for the providedFnServices running on a specified port.static <ServiceT extends FnService>
GrpcFnServer<ServiceT> create(ServiceT service, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint) Deprecated.This create function is used for Dataflow migration purpose only.static <ServiceT extends FnService>
GrpcFnServer<ServiceT> create(ServiceT service, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint, ServerFactory factory) Create aGrpcFnServerfor the providedFnServicewhich will run at the endpoint specified in theEndpoints.ApiServiceDescriptor.org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptorGet anEndpoints.ApiServiceDescriptordescribing the endpoint thisGrpcFnServeris bound to.org.apache.beam.vendor.grpc.v1p69p0.io.grpc.ServerGet the underlyingServercontained by thisGrpcFnServer.Get the service exposed by thisGrpcFnServer.
-
Method Details
-
allocatePortAndCreateFor
public static <ServiceT extends FnService> GrpcFnServer<ServiceT> allocatePortAndCreateFor(ServiceT service, ServerFactory factory) throws IOException Create aGrpcFnServerfor the providedFnServicerunning on an arbitrary port.- Throws:
IOException
-
allocatePortAndCreateFor
public static List<GrpcFnServer<? extends FnService>> allocatePortAndCreateFor(List<? extends FnService> services, ServerFactory factory) throws IOException CreateGrpcFnServers for the providedFnServices running on an arbitrary port.- Throws:
IOException
-
create
public static List<GrpcFnServer<? extends FnService>> create(List<? extends FnService> services, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint, ServerFactory factory) throws IOException CreateGrpcFnServers for the providedFnServices running on a specified port.- Throws:
IOException
-
create
public static <ServiceT extends FnService> GrpcFnServer<ServiceT> create(ServiceT service, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint, ServerFactory factory) throws IOException Create aGrpcFnServerfor the providedFnServicewhich will run at the endpoint specified in theEndpoints.ApiServiceDescriptor.- Throws:
IOException
-
create
@Deprecated public static <ServiceT extends FnService> GrpcFnServer<ServiceT> create(ServiceT service, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint) Deprecated.This create function is used for Dataflow migration purpose only. -
getApiServiceDescriptor
public org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor getApiServiceDescriptor()Get anEndpoints.ApiServiceDescriptordescribing the endpoint thisGrpcFnServeris bound to. -
getService
Get the service exposed by thisGrpcFnServer. -
getServer
public org.apache.beam.vendor.grpc.v1p69p0.io.grpc.Server getServer()Get the underlyingServercontained by thisGrpcFnServer. -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-