Skip to content

Commit d41cc86

Browse files
authored
chore: changes for sdf-beta9 (#382)
Co-authored-by: Luis Moreno <[email protected]>
1 parent 6852206 commit d41cc86

File tree

9 files changed

+113
-19
lines changed

9 files changed

+113
-19
lines changed

sdf/SDF_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sdf-beta8
1+
sdf-beta9

sdf/_embeds/install-sdf.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fvm install sdf-beta8
1+
fvm install sdf-beta9

sdf/cli/worker/connect.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: connect
3+
sidebar_position: 20
4+
---
5+
6+
# `sdf worker connect`
7+
8+
The `sdf worker connect` enters an [interactive shell] that allows you to interact with the worker and its dataflows.
9+
10+
[interactive shell]: ../deploy.mdx#deploy-interactive-shell

sdf/cli/worker/create.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: create
3+
sidebar_position: 10
34
---
45

56
# `sdf worker create`

sdf/cli/worker/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The `sdf worker` contains all the subcommands needed for [Deployment].
1111
### `sdf worker` commands
1212

1313
* [sdf worker create] - to create host worker
14+
* [sdf worker connect] - to connect to current worker
1415
* [sdf worker list] - to list cluster workers
1516
* [sdf worker register] - to register remote worker
1617
* [sdf worker unregister] - to unregister remote worker
@@ -19,6 +20,7 @@ The `sdf worker` contains all the subcommands needed for [Deployment].
1920

2021
[Deployment]: deployment.mdx
2122
[sdf worker create]: create.mdx
23+
[sdf worker connect]: connect
2224
[sdf worker list]: list.mdx
2325
[sdf worker register]: register.mdx
2426
[sdf worker unregister]: unregister.mdx

sdf/concepts/smartmodule-sdf.mdx

Lines changed: 0 additions & 5 deletions
This file was deleted.

sdf/how-to/scheduling.mdx

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: Scheduling events
3+
description: Stateful Dataflow schedule configuration.
4+
sidebar_position: 1100
5+
---
6+
7+
:::info
8+
**schedule** requires using `apiVersion: 0.6.0` or higher in your dataflow configuration.
9+
:::
10+
11+
The `schedule` configuration defines recurring events that can be used as input sources for your services, enabling time-based automation.
12+
13+
14+
### Structure:
15+
16+
```yaml
17+
apiVersion: 0.6.0 # Requires 0.6.0 or higher
18+
...
19+
schedule:
20+
<event-name>:
21+
cron: "<cron-expression>"
22+
```
23+
24+
### Using Scheduled Events as Service Inputs:
25+
26+
```yaml
27+
services:
28+
<service-name>:
29+
sources:
30+
- type: schedule
31+
id: <event-name>
32+
```
33+
34+
35+
## Schedule configuration fields
36+
37+
- `<event-name>`: (String, required) A unique identifier for the scheduled event. This name is used to reference the event in service configurations.
38+
- `cron`: (String, required) A cron expression that defines the schedule. The expression follows the standard Unix cron format:
39+
```
40+
* * * * *
41+
- - - - -
42+
| | | | |
43+
| | | | +----- day of week (0 - 7) (Sunday=0 or 7)
44+
| | | +------- month (1 - 12)
45+
| | +--------- day of month (1 - 31)
46+
| +----------- hour (0 - 23)
47+
+------------- minute (0 - 59)
48+
```
49+
For more details on cron expressions, refer to online cron expression generators and documentation.
50+
51+
## Example:
52+
53+
This dataflow will produce a record to the `output` topic once per day at 8:00 AM
54+
55+
```yaml
56+
apiVersion: 0.6.0
57+
meta:
58+
name: schedule
59+
version: 0.1.0
60+
namespace: example
61+
# default config
62+
config:
63+
converter: json
64+
consumer:
65+
default_starting_offset:
66+
value: 0
67+
position: End
68+
topics:
69+
output:
70+
name: time-events
71+
schema:
72+
value:
73+
type: i64
74+
schedule:
75+
daily-report:
76+
cron: "0 8 * * *" # Trigger at 8:00 AM daily
77+
services:
78+
produce-daily:
79+
sources:
80+
- type: schedule
81+
id: daily-report
82+
sinks:
83+
- type: topic
84+
id: output
85+
```

sdf/how-to/tumbling_window.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Tumbling Window"
3-
description: "Tumbling Window"
3+
description: "Learn how to use tumbling windows in SDF to aggregate data over fixed time intervals."
44
sidebar_position: 1100
55
---
66

@@ -61,14 +61,16 @@ tumbling:
6161
```
6262
The above configuration sets the duration of the window to discrete 15 second blocks.
6363
64-
#### 2. Assigning an idleness time (optional)
64+
#### 2. Assigning an `idleness` time and `grace-period` (optional)
6565

6666
```YAML
6767
watermark:
6868
idleness: 60s
69+
grace-period: 3s
6970
```
7071

71-
With the above configuration, the system will wait for 60 seconds of inactivity (no new data) before closing a window. This allows a 60-second grace period for late-arriving events.
72+
- `watermark.idleness: 60s`: This specifies that if there's no new data for 60 seconds, the window will be closed. This handles late-arriving events
73+
- `watermark.grace-period: 3s`: This allows a 3 second grace period for out-of-order events. If an event arrives within this grace period after the window's end, it will still be included in the window's calculation. This prevents the dropping of slightly late events due to network delays or other factors.
7274

7375
#### 3. Assigning a timestamp
7476

sdf/whatsnew.mdx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar_position: 20
77
import CodeBlock from '@theme/CodeBlock';
88
import InstallFvm from '!!raw-loader!./_embeds/install-sdf.bash';
99

10-
# Beta 8
10+
# Beta 9
1111

1212
## Upgrading
1313

@@ -26,19 +26,18 @@ For upgrading Infinyon Cloud (remote) workers, please contact [InfinyOn support]
2626

2727
### CLI changes
2828

29-
- Show df command now also returns the last restart time.
30-
- Do not ignore deployment when the dataflow is the same.
29+
- SDF interactive shell not longer exits on ctrl-c
30+
- Introduced the `--clear-all` and `--clear-state` options to the dataflow restart command, allowing users to clear the dataflow state before restarting.
3131

32-
### Improvements
32+
### New features
3333

34-
- Updated fluvio version which includes better reconnection support for consumers.
34+
- Added capability to schedule events using CRON format.
35+
- Added grace period configuration to window watermark, in order to support allowing out of order events.
3536

36-
### Features
37+
### Logging and Debugging Enhancements
3738

38-
- Added support for idleness on window based services.
39+
- Enhanced the sdf log -v command to include record offset and partition information.
3940

4041
## InfinyOn Support
4142

4243
For any questions or issues, please contact InfinyOn support at [email protected] or https://discordapp.com/invite/bBG2dTz
43-
44-
[idleness]: concepts/window-processing.mdx#idleness

0 commit comments

Comments
 (0)