forked from numaproj/numaflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
7-reduce-sliding-window.yaml
60 lines (60 loc) · 1.48 KB
/
7-reduce-sliding-window.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
50
51
52
53
54
55
56
57
58
59
60
apiVersion: numaflow.numaproj.io/v1alpha1
kind: Pipeline
metadata:
name: reduce-sliding-pipeline
spec:
limits:
readBatchSize: 50
vertices:
- name: in
containerTemplate:
env:
- name: NUMAFLOW_DEBUG
value: "true" # DO NOT forget the double quotes!!!
source:
http: {}
- name: map
containerTemplate:
env:
- name: NUMAFLOW_DEBUG
value: "true" # DO NOT forget the double quotes!!!
scale:
min: 1
max: 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:v0.5.0
- name: reduce-sliding
partitions: 2
udf:
container:
# compute the sum
image: quay.io/numaio/numaflow-go/reduce-sum:v0.5.0
groupBy:
window:
sliding:
length: 60s
slide: 10s
keyed: true
storage:
persistentVolumeClaim:
volumeSize: 10Gi
accessMode: ReadWriteOnce
containerTemplate:
env:
- name: NUMAFLOW_DEBUG
value: "true" # DO NOT forget the double quotes!!!
- name: sink
scale:
min: 1
max: 5
sink:
log: {}
edges:
- from: in
to: map
- from: map
to: reduce-sliding
- from: reduce-sliding
to: sink