Documentation ¶
Overview ¶
Package info is used for the gRPC server to provide the information such as protocol, sdk version, language, etc, to the client.
The server information can be used by the client to determine:
- what is the right protocol to use (UDS or TCP)
- what is the numaflow sdk version used by the server
- what is language used by the server
The gRPC server (UDF, UDSink, etc.) is supposed to have a shared file system with the client (numa container).
Write() The gPRC server must use this function to write the correct ServerInfo when it starts.
Read() The client is supposed to call the function to read the server information, before it starts to communicate with the gRPC server.
WaitUntilReady() This function checks if the server info file is ready to read. The client (numa container) is supposed to call the function before it starts to Read() the server info file.
Index ¶
Constants ¶
const MapModeKey = "MAP_MODE"
MapModeKey is the key used in the server info metadata map to indicate which map mode is enabled.
Variables ¶
var END = fmt.Sprintf("%U__END__", '\\') // U+005C__END__
var MinimumNumaflowVersion = map[ContainerType]string{ Sourcer: "1.4.0-z", Sourcetransformer: "1.4.0-z", Sinker: "1.4.0-z", Mapper: "1.4.0-z", Reducestreamer: "1.4.0-z", Reducer: "1.4.0-z", Sessionreducer: "1.4.0-z", Sideinput: "1.4.0-z", Fbsinker: "1.4.0-z", }
MinimumNumaflowVersion is the minimum version of Numaflow required by the current SDK version To update this value, please follow the instructions for MINIMUM_NUMAFLOW_VERSION in https://github.com/numaproj/numaflow-rs/blob/main/src/shared.rs
Functions ¶
func WaitUntilReady ¶
WaitUntilReady waits until the server info is ready
func Write ¶
func Write(svrInfo *ServerInfo, opts ...Option) error
Write writes the server info to a file
Types ¶
type ContainerType ¶ added in v0.9.0
type ContainerType string
const ( Sourcer ContainerType = "sourcer" Sourcetransformer ContainerType = "sourcetransformer" Sinker ContainerType = "sinker" Mapper ContainerType = "mapper" Reducer ContainerType = "reducer" Reducestreamer ContainerType = "reducestreamer" Sessionreducer ContainerType = "sessionreducer" Sideinput ContainerType = "sideinput" Fbsinker ContainerType = "fb-sinker" )
the string content matches the corresponding server info file name. DO NOT change it unless the server info file name is changed.
type Option ¶
type Option func(*options)
func WithServerInfoFilePath ¶
WithServerInfoFilePath sets the server info file path
type ServerInfo ¶
type ServerInfo struct { Protocol Protocol `json:"protocol"` Language Language `json:"language"` MinimumNumaflowVersion string `json:"minimum_numaflow_version"` Version string `json:"version"` Metadata map[string]string `json:"metadata"` }
ServerInfo is the information about the server
func GetDefaultServerInfo ¶ added in v0.8.0
func GetDefaultServerInfo() *ServerInfo
GetDefaultServerInfo returns a ServerInfo object with the default fields populated for Go-SDK