Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
DROP = fmt.Sprintf("%U__DROP__", '\\') // U+005C__DROP__
)
Functions ¶
Types ¶
type Datum ¶
type Datum interface { // Value returns the payload of the message. Value() []byte // EventTime returns the event time of the message. EventTime() time.Time // Watermark returns the watermark of the message. Watermark() time.Time // Headers returns the headers of the message. Headers() map[string]string }
Datum contains methods to get the payload information.
type IntervalWindow ¶
IntervalWindow contains methods to get the information for a given interval window.
func NewIntervalWindow ¶
func NewIntervalWindow(startTime time.Time, endTime time.Time) IntervalWindow
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is used to wrap the data return by reduce function
type Messages ¶
type Messages []Message
func MessagesBuilder ¶
func MessagesBuilder() Messages
MessagesBuilder returns an empty instance of Messages
type Metadata ¶
type Metadata interface {
IntervalWindow() IntervalWindow
}
Metadata contains methods to get the metadata for the reduce operation.
func NewMetadata ¶
func NewMetadata(window IntervalWindow) Metadata
type Option ¶
type Option func(*options)
Option is the interface to apply options.
func WithMaxMessageSize ¶
WithMaxMessageSize sets the server max receive message size and the server max send message size to the given size.
func WithServerInfoFilePath ¶
WithServerInfoFilePath sets the server info file path to the given path.
func WithSockAddr ¶
WithSockAddr start the server with the given sock addr. This is mainly used for testing purposes.
type Reducer ¶
type Reducer interface {
Reduce(ctx context.Context, keys []string, inputCh <-chan Datum, md Metadata) Messages
}
Reducer is the interface of reduce function implementation.
type ReducerCreator ¶ added in v0.6.0
type ReducerCreator interface { // Create creates a Reducer, will be invoked once for every keyed window. Create() Reducer }
ReducerCreator is the interface which is used to create a Reducer.
func SimpleCreatorWithReduceFn ¶ added in v0.6.0
func SimpleCreatorWithReduceFn(f func(context.Context, []string, <-chan Datum, Metadata) Messages) ReducerCreator
SimpleCreatorWithReduceFn creates a simple ReducerCreator for the given reduce function.