You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example demonstrates how to write AVRO files to S3.
9
+
10
+
The example generates random stock price data using the DataGen connector and writes to S3 as AVRO files with
11
+
a bucketing in the format `year=yyyy/month=MM/day=dd/hour=HH/` and rotating files on checkpoint.
12
+
13
+
Note that FileSystem sink commit the writes on checkpoint. For this reason, checkpoint are programmatically enabled when running locally.
14
+
When running on Managed Flink checkpoints are controlled by the application configuration and enabled by default.
15
+
16
+
This application can be used in combination with the [S3AvroSource](../S3AvroSource) example application which read AVRO data with the same schema from S3.
17
+
18
+
## Prerequisites
19
+
20
+
* An S3 bucket for writing data. The application IAM Role must allow writing to the bucket
21
+
22
+
23
+
## Runtime Configuration
24
+
25
+
The application reads the runtime configuration from the Runtime Properties, when running on Amazon Managed Service for Apache Flink,
26
+
or, when running locally, from the [`resources/flink-application-properties-dev.json`](resources/flink-application-properties-dev.json) file located in the resources folder.
|`OutputBucket`|`bucket.name`| Name of the destination S3 bucket. |
33
+
|`OutputBucket`|`bucket.path`| Base path withing the bucket. |
34
+
35
+
To configure the application on Managed Service for Apache Flink, set up these parameter in the *Runtime properties*.
36
+
37
+
To configure the application for running locally, edit the [json file](resources/flink-application-properties-dev.json).
38
+
39
+
### Running in IntelliJ
40
+
41
+
You can run this example directly in IntelliJ, without any local Flink cluster or local Flink installation.
42
+
43
+
See [Running examples locally](../running-examples-locally.md) for details.
44
+
45
+
## AVRO Specific Record usage
46
+
47
+
The AVRO schema definition (`avdl` file) is included as part of the source code in the `./src/main/resources/avro` folder.
48
+
The AVRO Maven Plugin is used to generate the Java object `StockPrice` at compile time.
49
+
50
+
If IntelliJ cannot find the `StockPrice` class when you import the project:
51
+
1. Run `mvn generate-sources` manually once
52
+
2. Ensure that the IntelliJ module configuration, in Project settings, also includes `target/generated-sources/avro` as Sources. If IntelliJ does not auto-detect it, add the path manually
// Name of the local JSON resource with the application properties in the same format as they are received from the Amazon Managed Service for Apache Flink runtime
0 commit comments