Class GrpcFnServer<ServiceT extends FnService>

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class GrpcFnServer<ServiceT extends FnService>
    extends java.lang.Object
    implements java.lang.AutoCloseable
    A gRPC Server which manages a single FnService. The lifetime of the service is bound to the GrpcFnServer.
    • Method Detail

      • allocatePortAndCreateFor

        public static <ServiceT extends FnServiceGrpcFnServer<ServiceT> allocatePortAndCreateFor​(ServiceT service,
                                                                                                   ServerFactory factory)
                                                                                            throws java.io.IOException
        Create a GrpcFnServer for the provided FnService running 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
        Create GrpcFnServers for the provided FnServices 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
        Create GrpcFnServers for the provided FnServices running on a specified port.
        Throws:
        java.io.IOException
      • create

        public static <ServiceT extends FnServiceGrpcFnServer<ServiceT> create​(ServiceT service,
                                                                                 org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint,
                                                                                 ServerFactory factory)
                                                                          throws java.io.IOException
        Create a GrpcFnServer for the provided FnService which will run at the endpoint specified in the Endpoints.ApiServiceDescriptor.
        Throws:
        java.io.IOException
      • create

        @Deprecated
        public static <ServiceT extends FnServiceGrpcFnServer<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 an Endpoints.ApiServiceDescriptor describing the endpoint this GrpcFnServer is bound to.
      • getServer

        public org.apache.beam.vendor.grpc.v1p48p1.io.grpc.Server getServer()
        Get the underlying Server contained by this GrpcFnServer.
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception