public class GrpcFnServer<ServiceT extends FnService>
extends java.lang.Object
implements java.lang.AutoCloseable
gRPC Server
which manages a single FnService
. The lifetime of the
service is bound to the GrpcFnServer
.Modifier and Type | Method and Description |
---|---|
static java.util.List<GrpcFnServer<? extends FnService>> |
allocatePortAndCreateFor(java.util.List<? extends FnService> services,
ServerFactory factory)
Create
GrpcFnServer s for the provided FnService s running on an arbitrary port. |
static <ServiceT extends FnService> |
allocatePortAndCreateFor(ServiceT service,
ServerFactory factory)
Create a
GrpcFnServer for the provided FnService running on an arbitrary port. |
void |
close() |
static java.util.List<GrpcFnServer<? extends FnService>> |
create(java.util.List<? extends FnService> services,
org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint,
ServerFactory factory)
Create
GrpcFnServer s for the provided FnService s running on a specified port. |
static <ServiceT extends FnService> |
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> |
create(ServiceT service,
org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint,
ServerFactory factory)
Create a
GrpcFnServer for the provided FnService which will run at the endpoint
specified in the Endpoints.ApiServiceDescriptor . |
org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor |
getApiServiceDescriptor()
Get an
Endpoints.ApiServiceDescriptor describing the endpoint this GrpcFnServer is bound
to. |
org.apache.beam.vendor.grpc.v1p43p2.io.grpc.Server |
getServer()
Get the underlying
Server contained by this GrpcFnServer . |
ServiceT |
getService()
Get the service exposed by this
GrpcFnServer . |
public static <ServiceT extends FnService> GrpcFnServer<ServiceT> allocatePortAndCreateFor(ServiceT service, ServerFactory factory) throws java.io.IOException
GrpcFnServer
for the provided FnService
running on an arbitrary port.java.io.IOException
public static java.util.List<GrpcFnServer<? extends FnService>> allocatePortAndCreateFor(java.util.List<? extends FnService> services, ServerFactory factory) throws java.io.IOException
GrpcFnServer
s for the provided FnService
s running on an arbitrary port.java.io.IOException
public static java.util.List<GrpcFnServer<? extends FnService>> create(java.util.List<? extends FnService> services, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint, ServerFactory factory) throws java.io.IOException
GrpcFnServer
s for the provided FnService
s running on a specified port.java.io.IOException
public static <ServiceT extends FnService> GrpcFnServer<ServiceT> create(ServiceT service, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint, ServerFactory factory) throws java.io.IOException
GrpcFnServer
for the provided FnService
which will run at the endpoint
specified in the Endpoints.ApiServiceDescriptor
.java.io.IOException
@Deprecated public static <ServiceT extends FnService> GrpcFnServer<ServiceT> create(ServiceT service, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint)
public org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor getApiServiceDescriptor()
Endpoints.ApiServiceDescriptor
describing the endpoint this GrpcFnServer
is bound
to.public ServiceT getService()
GrpcFnServer
.public org.apache.beam.vendor.grpc.v1p43p2.io.grpc.Server getServer()
Server
contained by this GrpcFnServer
.public void close() throws java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception