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:
java.lang.AutoCloseable
public class GrpcFnServer<ServiceT extends FnService> extends java.lang.Object implements java.lang.AutoCloseableAgRPC Serverwhich manages a singleFnService. The lifetime of the service is bound to theGrpcFnServer.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.util.List<GrpcFnServer<? extends FnService>>allocatePortAndCreateFor(java.util.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 java.util.List<GrpcFnServer<? extends FnService>>create(java.util.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.ApiServiceDescriptorgetApiServiceDescriptor()Get anEndpoints.ApiServiceDescriptordescribing the endpoint thisGrpcFnServeris bound to.org.apache.beam.vendor.grpc.v1p48p1.io.grpc.ServergetServer()Get the underlyingServercontained by thisGrpcFnServer.ServiceTgetService()Get the service exposed by thisGrpcFnServer.
-
-
-
Method Detail
-
allocatePortAndCreateFor
public static <ServiceT extends FnService> GrpcFnServer<ServiceT> allocatePortAndCreateFor(ServiceT service, ServerFactory factory) throws java.io.IOException
Create aGrpcFnServerfor the providedFnServicerunning on an arbitrary port.- Throws:
java.io.IOException
-
allocatePortAndCreateFor
public static java.util.List<GrpcFnServer<? extends FnService>> allocatePortAndCreateFor(java.util.List<? extends FnService> services, ServerFactory factory) throws java.io.IOException
CreateGrpcFnServers for the providedFnServices running on an arbitrary port.- Throws:
java.io.IOException
-
create
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
CreateGrpcFnServers for the providedFnServices running on a specified port.- Throws:
java.io.IOException
-
create
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
Create aGrpcFnServerfor the providedFnServicewhich will run at the endpoint specified in theEndpoints.ApiServiceDescriptor.- Throws:
java.io.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
public ServiceT getService()
Get the service exposed by thisGrpcFnServer.
-
getServer
public org.apache.beam.vendor.grpc.v1p48p1.io.grpc.Server getServer()
Get the underlyingServercontained by thisGrpcFnServer.
-
close
public void close() throws java.lang.Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
-