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 FunctionServerregisterMapHandler(MapHandler mapHandler)registers the map handler to the server.FunctionServerregisterMapTHandler(MapTHandler mapTHandler)registers the mapT handler to the server.FunctionServerregisterReducerFactory(ReducerFactory<? extends ReduceHandler> reducerFactory)registers the reducer factory to the server.voidstart()Starts the function server.voidstop()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.ExceptionStarts the function server.- Throws:
java.lang.Exception
-
stop
public void stop()
Stop serving requests and shutdown resources. Await termination on the main thread since the grpc library uses daemon threads.
-
-