Package io.numaproj.numaflow.function
Class FunctionServer
- java.lang.Object
-
- io.numaproj.numaflow.function.FunctionServer
-
public class FunctionServer extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description FunctionServer()
constructor to create function gRPC server.FunctionServer(io.grpc.ServerBuilder<?> serverBuilder, FunctionGRPCConfig grpcConfig)
FunctionServer(FunctionGRPCConfig grpcConfig)
constructor to create function gRPC server with gRPC config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FunctionServer
registerMapHandler(MapHandler mapHandler)
registers the map handler to the server.FunctionServer
registerMapTHandler(MapTHandler mapTHandler)
registers the mapT handler to the server.FunctionServer
registerReducerFactory(ReducerFactory<? extends ReduceHandler> reducerFactory)
registers the reducer factory to the server.void
start()
Starts the function server.void
stop()
Stop serving requests and shutdown resources.
-
-
-
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.
-
-