streaming

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package streaming implement the flow framework to provide the sliding window, top-n aggregation, and etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(source flow.Source) flow.Flow

New returns a new streaming flow.

func NewTumblingTimeWindows

func NewTumblingTimeWindows(size time.Duration) flow.WindowAssigner

NewTumblingTimeWindows return tumbling-time windows.

Types

type TopNOption

type TopNOption func(aggregator *topNAggregatorGroup)

TopNOption is the option to set up a top-n aggregator group.

func OrderBy

func OrderBy(sort TopNSort) TopNOption

OrderBy sets the sorting order.

func WithGroupKeyExtractor added in v0.4.0

func WithGroupKeyExtractor(groupKeyExtractor func(flow.StreamRecord) string) TopNOption

WithGroupKeyExtractor extract group key from the StreamRecord.

func WithSortKeyExtractor

func WithSortKeyExtractor(sortKeyExtractor func(flow.StreamRecord) int64) TopNOption

WithSortKeyExtractor sets a closure to extract the sorting key.

type TopNSort

type TopNSort uint8

TopNSort defines the order of sorting.

const (
	DESC TopNSort = iota
	ASC
)

The available order of sorting.

type Tuple2

type Tuple2 struct {
	V1 interface{} `json:"v1"`
	V2 interface{} `json:"v2"`
}

Tuple2 is a tuple with 2 fields. Each field may be a separate type.

Directories

Path Synopsis
Package sources implements data sources to sink data into the flow framework.
Package sources implements data sources to sink data into the flow framework.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL