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) CreateGrpcFnServer
s for the providedFnService
s running on an arbitrary port.static <ServiceT extends FnService>
GrpcFnServer<ServiceT> allocatePortAndCreateFor
(ServiceT service, ServerFactory factory) Create aGrpcFnServer
for the providedFnService
running on an arbitrary port.void
close()
static List
<GrpcFnServer<? extends FnService>> create
(List<? extends FnService> services, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint, ServerFactory factory) CreateGrpcFnServer
s for the providedFnService
s 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 aGrpcFnServer
for the providedFnService
which will run at the endpoint specified in theEndpoints.ApiServiceDescriptor
.org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor
Get anEndpoints.ApiServiceDescriptor
describing the endpoint thisGrpcFnServer
is bound to.org.apache.beam.vendor.grpc.v1p69p0.io.grpc.Server
Get the underlyingServer
contained 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 aGrpcFnServer
for the providedFnService
running on an arbitrary port.- Throws:
IOException
-
allocatePortAndCreateFor
public static List<GrpcFnServer<? extends FnService>> allocatePortAndCreateFor(List<? extends FnService> services, ServerFactory factory) throws IOException CreateGrpcFnServer
s for the providedFnService
s 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 CreateGrpcFnServer
s for the providedFnService
s 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 aGrpcFnServer
for the providedFnService
which 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.ApiServiceDescriptor
describing the endpoint thisGrpcFnServer
is bound to. -
getService
Get the service exposed by thisGrpcFnServer
. -
getServer
public org.apache.beam.vendor.grpc.v1p69p0.io.grpc.Server getServer()Get the underlyingServer
contained by thisGrpcFnServer
. -
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-