Class FunctionServer


  • public class FunctionServer
    extends java.lang.Object
    • Constructor Detail

      • FunctionServer

        public FunctionServer()
        constructor to create function gRPC server.
      • FunctionServer

        public FunctionServer​(FunctionGRPCConfig grpcConfig)
        constructor to create function gRPC server with gRPC config.
      • FunctionServer

        public FunctionServer​(io.grpc.ServerBuilder<?> serverBuilder,
                              FunctionGRPCConfig grpcConfig)
    • Method Detail

      • registerMapHandler

        public FunctionServer registerMapHandler​(MapHandler mapHandler)
        registers the map handler to the server.
        Parameters:
        mapHandler - handler to process the message.
        Returns:
        returns a new Function gRPC server.
      • registerMapTHandler

        public FunctionServer registerMapTHandler​(MapTHandler mapTHandler)
        registers the mapT handler to the server.
        Parameters:
        mapTHandler - handler to process the message and assign event time.
        Returns:
        returns a new Function gRPC server.
      • registerReducerFactory

        public FunctionServer registerReducerFactory​(ReducerFactory<? extends ReduceHandler> reducerFactory)
        registers the reducer factory to the server.
        Parameters:
        reducerFactory - which produces reduce handlers to perform reduce operation.
        Returns:
        returns a new Function gRPC server.
      • start

        public void start()
                   throws java.lang.Exception
        Starts the function server.
        Throws:
        java.lang.Exception - if there are any exceptions while processing the request.
      • stop

        public void stop()
        Stop serving requests and shutdown resources. Await termination on the main thread since the grpc library uses daemon threads.