-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy path13-streaming-reduce-pipeline.yaml
49 lines (49 loc) · 1.37 KB
/
13-streaming-reduce-pipeline.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
apiVersion: numaflow.numaproj.io/v1alpha1
kind: Pipeline
metadata:
name: simple-streaming-reduce
spec:
watermark:
maxDelay: 30s
vertices:
- name: in
source:
http: {}
- name: atoi
scale:
min: 1
udf:
container:
# Tell the input number is even or odd, see https://github.com/numaproj/numaflow-go/tree/main/pkg/mapper/examples/even_odd
image: quay.io/numaio/numaflow-go/map-even-odd:stable
imagePullPolicy: Always
- name: compute-sum
partitions: 2
udf:
container:
# compute the sum, see https://github.com/numaproj/numaflow-go/tree/main/pkg/reducestreamer/examples/sum
# Writes output to next vertex if the sum is greater than 100, does not wait for the window to close.
image: quay.io/numaio/numaflow-go/reduce-stream-sum:stable
imagePullPolicy: Always
groupBy:
window:
fixed:
length: 600s
streaming: true # set streaming to true to enable reduce streamer
keyed: true
storage:
persistentVolumeClaim:
volumeSize: 1Gi
accessMode: ReadWriteOnce
- name: sink
scale:
min: 1
sink:
log: {}
edges:
- from: in
to: atoi
- from: atoi
to: compute-sum
- from: compute-sum
to: sink