diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f49a4e1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/flink-learn/.gitignore b/flink-learn/.gitignore new file mode 100644 index 0000000..d56d19a --- /dev/null +++ b/flink-learn/.gitignore @@ -0,0 +1,12 @@ +*.tgz +flink* +.idea +env +target +k8s +kafka* +learning +quickstart +.env +*.zip +sql diff --git a/flink-learn/1-quickstart/README.md b/flink-learn/1-quickstart/README.md new file mode 100644 index 0000000..15e4dbc --- /dev/null +++ b/flink-learn/1-quickstart/README.md @@ -0,0 +1,410 @@ +# Getting started with Apache Flink & FlinkSQL +With heavy adoption at both large and small companies, [Apache Flink](https://flink.apache.org/) has emerged as the clear winner in the stream processing war. However, many streaming engineers have been embedded in Apache Spark or Kafka Streams/ksqlDB ecosystems and do not have much experience with using Flink. + +## Agenda +- Gunnar introductions +- Redpanda introductions +- Hubert starts +- Questions +- Wrap up + +## Goal +This webinar is for engineers who are new and interested in Apache Flink and Flink SQL, and we’ll be demonstrating for you how you can get started with Apache Flink and Flink SQL. By the end of this webinar, you will have: +Created and configured a Flink application on your local machine that reads and writes data from one Redpanda topic to another topic. +Added a transformation to the Flink application that filters out unwanted data before it is sent to the desired Redpanda topic. + +Note: We’ll be using Java and SQL in this webinar, but you can also use Apache Flink in Scala and Python. + +## Prerequisites + +- Java 11 +- IntelliJ IDEA +- Apache Maven +- [Docker](https://docs.docker.com/get-docker/) +- [Redpanda and the rpk CLI](https://docs.redpanda.com/docs/platform/quickstart/) +- [Flink](https://flink.apache.org/downloads.html#apache-flink-1160) + +```bash +java -version +tar -xzf flink-*.tgz + +./bin/start-cluster.sh # start the flink cluster +./bin/stop-cluster.sh # stop the flink cluster +``` + +# Redpanda +In this webinar, we’ll be sending data to Redpanda, a Kafka-compatible and Zookeeperless streaming platform for mission critical workloads. We’ll set up Flink to read from one Redpanda topic, process that data, and then send it back to a different topic in Redpanda. You'll need to install Redpanda and it's CLI rpk, which can be found [here](https://docs.redpanda.com/docs/platform/quickstart/). + +```mermaid +flowchart LR; + +Redpanda-->Flink-->Redpanda +``` + +## Starting Up a Redpanda Cluster Locally +Do the following steps to start a local Redpanda cluster. +Start Redpanda using the `rpk` CLI. + +```bash +rpk container -n 3 start +``` + +The output should looks similar to this: +``` +Starting cluster +Waiting for the cluster to be ready... + NODE ID ADDRESS + 0 127.0.0.1:55834 + 2 127.0.0.1:55828 + 1 127.0.0.1:55832 + +Cluster started! You may use rpk to interact with it. E.g: + + rpk cluster info --brokers 127.0.0.1:55834,127.0.0.1:55828,127.0.0.1:55832 + +You may also set an environment variable with the comma-separated list of broker addresses: + + export REDPANDA_BROKERS="127.0.0.1:55834,127.0.0.1:55828,127.0.0.1:55832" + rpk cluster info + +``` +Create a `.env` file and paste the last line of the output excluding the `export` term. You will need to copy this file into the project directory created later in this README. + +```properties +REDPANDA_BROKERS=127.0.0.1:53348,127.0.0.1:53353,127.0.0.1:53354 +``` + +Pre-create the topics we will be using in the webinar. + +```bash +rpk topic create input-topic output-topic +``` + + + +# Flink Quickstart using Java +Create a project by running the following command. This creates a directory with a Java project that we will later import to IntelliJ. + +```bash +mvn archetype:generate \ + -DarchetypeGroupId=org.apache.flink \ + -DarchetypeArtifactId=flink-quickstart-java \ + -DarchetypeVersion=1.16.0 \ + -DgroupId=org.myorg.quickstart \ + -DartifactId=quickstart \ + -Dversion=0.1 \ + -Dpackage=org.myorg.quickstart \ + -DinteractiveMode=false +``` + +**NOTE**: Don't forget to copy the `.env` file into this directory. + +## Import your project into IntelliJ +To import your project into IntelliJ, do the following configuration steps. You will need to do some additional configuration in IntelliJ to get Flink working properly. Detailed information can be found [here](https://nightlies.apache.org/flink/flink-docs-master/docs/dev/configuration/maven/#importing-the-project-into-your-ide). Specifically, follow the instructions below. + +> Note on IntelliJ: To make the applications run within IntelliJ IDEA, it is necessary to tick the Include dependencies with "Provided" scope box in the run configuration. If this option is not available (possibly due to using an older IntelliJ IDEA version), then a workaround is to create a test that calls the application’s `main()` method. + +1. Navigate to the `DataStreamJob` file. Right click on the `DataStreamJob` code and select `Modify Run Configuration`. + + + + +2. Next click on `Modify options` and click on `Include dependencies with "Provided" scope`. + + +### WARNING +> If you forget to do this, you will get class loading errors when attempting to debug this class. + +## Set up the Streaming Execution Environment +The quickstart will create a skeleton code for you to get started. The first important line of code is creating an environment. + +```java +final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); +``` + +From Apache Flink Documentation: +>Typically, you only need to use getExecutionEnvironment(), since this will do the right thing depending on the context: if you are executing your program inside an IDE or as a regular Java program it will create a local environment that will execute your program on your local machine. If you created a JAR file from your program, and invoke it through the command line, the Flink cluster manager will execute your main method and getExecutionEnvironment() will return an execution environment for executing your program on a cluster. + + +## Checkpointing +Checkpoints allow Flink to recover state and positions in the streams to give the application the same semantics as a failure-free execution. + +```java +// start a checkpoint every 1000 ms +env.enableCheckpointing(1000); +// set mode to exactly-once (this is the default) +env.getCheckpointConfig().setCheckpointingMode(CheckpointingMode.EXACTLY_ONCE); +// make sure 500 ms of progress happen between checkpoints +env.getCheckpointConfig().setMinPauseBetweenCheckpoints(500); +// checkpoints have to complete within one minute, or are discarded +env.getCheckpointConfig().setCheckpointTimeout(60000); +// only two consecutive checkpoint failures are tolerated +env.getCheckpointConfig().setTolerableCheckpointFailureNumber(2); +// allow only one checkpoint to be in progress at the same time +env.getCheckpointConfig().setMaxConcurrentCheckpoints(1); +// enable externalized checkpoints which are retained +// after job cancellation +env.getCheckpointConfig().setExternalizedCheckpointCleanup( + CheckpointConfig.ExternalizedCheckpointCleanup.RETAIN_ON_CANCELLATION); +// enables the unaligned checkpoints. +// You should use unaligned checkpoints if your checkpointing durations are very high due to backpressure. +env.getCheckpointConfig().enableUnalignedCheckpoints(); +// sets the checkpoint storage where checkpoint snapshots will be written +env.getCheckpointConfig().setCheckpointStorage(String.format("file:///%s/cp",System.getProperty("user.dir"))); +``` + +For more information on unaligned checkpoints, click [here](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/state/checkpointing_under_backpressure/#unaligned-checkpoints). + +## Kafka Source +Since Redpanda is Kafka compliant, we can use the Kafka source connector to consume from Redpanda. + +1. Update the `pom.xml` with the Kafka connector library for Flink. Open the quickstart pom.xml. You will notice that it already has a dependency entry for Kafka that is commented. Uncomment it and rebuild the project. + +```xml + + +``` + +2. Next add the following imports: + +```java +import org.apache.flink.api.java.utils.ParameterTool; +import org.apache.flink.streaming.api.CheckpointingMode; +import org.apache.flink.streaming.api.environment.CheckpointConfig; +import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; +import org.apache.flink.api.common.eventtime.WatermarkStrategy; +import org.apache.flink.api.common.serialization.SimpleStringSchema; +import org.apache.flink.connector.base.DeliveryGuarantee; +import org.apache.flink.connector.kafka.sink.KafkaRecordSerializationSchema; +import org.apache.flink.connector.kafka.sink.KafkaSink; +import org.apache.flink.connector.kafka.source.KafkaSource; +import org.apache.flink.connector.kafka.source.enumerator.initializer.OffsetsInitializer; +import org.apache.flink.streaming.api.datastream.DataStreamSource; +import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator; +import org.apache.flink.streaming.api.functions.sink.PrintSink; +``` + +1. Create a secured source connector to Redpanda by copying and pasting the code below. It will read the properties from the .env file and create a Kafka source. + +```java +ParameterTool parameters = ParameterTool.fromPropertiesFile("./.env"); +String bootstrap_servers = parameters.get("REDPANDA_BROKERS"); +KafkaSource ksource = KafkaSource.builder() + .setBootstrapServers(bootstrap_servers) + .setTopics("input-topic") + .setGroupId("flink-test") + .setStartingOffsets(OffsetsInitializer.earliest()) + .setValueOnlyDeserializer(new SimpleStringSchema()) + .setProperty("acks", "all") + .build(); +``` + +## Create a stream from the Kafka source connector +Create a Kafka source by copying and pasting the code below. + +```java +DataStreamSource stream = env.fromSource( + ksource, + WatermarkStrategy.noWatermarks(), + "Redpanda Source" +); +``` + +**Note**: Creating the stream from the source connector may require a watermark depending on how the data is processed downstream. Flink provides watermarking to support late arriving data. In this example, we are not providing any watermarks. + + +## Transformation +Now, let’s filter out records that we don’t care about. In this case, we’ll be filtering our records that only contain “foo”. The description for the filter function has been taken from Javadocs and pasted below. + +Javadoc: +> Applies a Filter transformation on a DataStream. The transformation calls a FilterFunction for each element of the DataStream and retains only those element for which the function returns true. `Elements for which the function returns false are filtered.` The user can also extend RichFilterFunction to gain access to other features provided by the org.apache.flink.api.common.functions.RichFunction interface. + +```java +SingleOutputStreamOperator filtered = stream.filter(string -> string.contains("foo")); +``` + +## Add a PrintSink for debugging +You can use the PrintSink to log your messages to the console in IntelliJ. The short-cut key stroke to find classes is: `⌥ ⏎`. + +```java +PrintSink sink = new PrintSink<>(true); + +filtered.sinkTo(sink); // add the print sink to the stream +``` + +## Send Data To Redpanda +From the rpk CLI, run the following commands to generate data to our Redpanda cluster. + +```bash +source .env +rpk topic produce input-topic --brokers $REDPANDA_BROKERS +``` + +```json +{ "ordertime": 1497014222380, "orderid": 20, "itemid": "foobar", "address": { "city": "Mountain View", "state": "CA", "zipcode": 94041 } } +``` + +## Kafka Sink +We will again use Redpanda as the destination for the filtered Redpanda records. Using the same credentials as in the source, we will now be sending the data back to Redpanda instead of printing it to the console. + +```java +KafkaSink sink = KafkaSink.builder() + .setBootstrapServers(bootstrap_servers) + .setRecordSerializer(KafkaRecordSerializationSchema.builder() + .setTopic("output-topic") + .setValueSerializationSchema(new SimpleStringSchema()) + .build() + ) + .setProperty("acks", "all") + .setDeliveryGuarantee(DeliveryGuarantee.AT_LEAST_ONCE) + .build(); + + +filtered.sinkTo(sink); // add the Kafka sink to the stream +``` + +## RPK Consumer +From the `rpk` CLI, start consuming records from the output topic. + +```bash +source .env +rpk topic consume output-topic --brokers $REDPANDA_BROKERS +``` + +Below is the expected output. + + + + +## Compile and build the application +To compile the application, perform the following steps. + +```bash +# build a shaded jar +mvn package + +# Run this command providing the correct paths. +../../flink-1.16.0/bin/flink run -c org.myorg.quickstart.DataStreamJob target/quickstart-0.1.jar +``` + +## Monitor Your Job +You can open the Flink Console at http://localhost:8081. + +## Stop Your Job +To stop your running job, you can use the Flink Console or run this command. + +```bash +./bin/flink stop +``` + + +# FlinkSQL Tutorial +In this part of the webinar, we will implement the same workflow using Flink SQL. Start the Flink cluster and then proceed to the [console](http://localhost:8081/#/overview). + +```bash +./bin/start-cluster.sh +``` + +To monitor the log you can either use the console or tail the log file. + +```bash +tail -f log/flink-hubertdulay-sql-client-*.log +``` + +## Start the SQL-CLIENT +Instead of using Java, we'll be submitting SQL to Flink. Start the SQL client using the command below. + +```bash +./bin/sql-client.sh embedded +``` + +## Create a Source Connector to Redpanda +Create a table that will serve as the source for the topic that we’ll be ingesting data from. In this example, the `address` field is a complex type. We will be using a `ROW<>` type to describe the address. + +```sql +-- { "ordertime": 1497014222380, "orderid": 100, "itemid": "foobar", "address": { "city": "hubert", "state": "CA", "zipcode": 94041 } } +CREATE TABLE input_topic ( + ordertime bigint, + orderid INT, + itemid string, + address ROW + ) WITH ( + 'connector' = 'kafka', + 'topic' = 'input-topic', + 'properties.bootstrap.servers' = '{{ BOOTSTRAP_SERVER }}', -- provide the bootstrap server + 'properties.group.id' = 'flinksql', + 'scan.startup.mode' = 'earliest-offset', + 'format' = 'json', + 'json.ignore-parse-errors' = 'true' +); + +``` + + + +Select from the table. The output show appear below. + +```sql +select * from input_topic; +``` + + + +## Transform filter and Sink to Redpanda +We create another table that filters the records and sends them to Redpanda. + +```sql +create table output_topic +WITH ( + 'connector' = 'kafka', + 'topic' = 'output-topic', + 'properties.bootstrap.servers' = '{{ BOOTSTRAP_SERVER }}', -- provide the bootstrap server + 'format' = 'json', + 'json.ignore-parse-errors' = 'true' +) +as select * from input_topic where itemid like '%foo%' OR address['city'] like '%foo%'; +``` + +Alternatively, you can put all of your SQL into a file and run it from the command line. + +```bash +./bin/sql-client.sh embedded -f ../webinar/sql/pipeline.sql +``` + +You should see your job submitted with the output below. + + + +If you run the `rpk` command to consume from the `output-topic`, you should see the records coming through. Also checkout the Flink console to see your job running. + + +# Summary +In this webinar, we installed Apache Flink and build a simple pipeline in Java and in SQL. We also used Redpanda to read and write streaming data. For more information about Apache Flink and how you can do this in Decodable, please reach out or support@decodable.co. diff --git a/flink-learn/1-quickstart/images/cli-output.png b/flink-learn/1-quickstart/images/cli-output.png new file mode 100644 index 0000000..b20ed1f Binary files /dev/null and b/flink-learn/1-quickstart/images/cli-output.png differ diff --git a/flink-learn/1-quickstart/images/create-run-config.png b/flink-learn/1-quickstart/images/create-run-config.png new file mode 100644 index 0000000..eacfd6f Binary files /dev/null and b/flink-learn/1-quickstart/images/create-run-config.png differ diff --git a/flink-learn/1-quickstart/images/edit-config.png b/flink-learn/1-quickstart/images/edit-config.png new file mode 100644 index 0000000..d408579 Binary files /dev/null and b/flink-learn/1-quickstart/images/edit-config.png differ diff --git a/flink-learn/1-quickstart/images/include.png b/flink-learn/1-quickstart/images/include.png new file mode 100644 index 0000000..4eac4cd Binary files /dev/null and b/flink-learn/1-quickstart/images/include.png differ diff --git a/flink-learn/1-quickstart/images/job-sql.png b/flink-learn/1-quickstart/images/job-sql.png new file mode 100644 index 0000000..42163ec Binary files /dev/null and b/flink-learn/1-quickstart/images/job-sql.png differ diff --git a/flink-learn/1-quickstart/images/output.png b/flink-learn/1-quickstart/images/output.png new file mode 100644 index 0000000..6dce4ab Binary files /dev/null and b/flink-learn/1-quickstart/images/output.png differ diff --git a/flink-learn/1-quickstart/java/pom.xml b/flink-learn/1-quickstart/java/pom.xml new file mode 100644 index 0000000..20185d0 --- /dev/null +++ b/flink-learn/1-quickstart/java/pom.xml @@ -0,0 +1,210 @@ + + + 4.0.0 + + org.myorg.quickstart + quickstart + 0.1 + jar + + Flink Quickstart Job + + + UTF-8 + 1.16.0 + 1.8 + 2.12 + ${target.java.version} + ${target.java.version} + 2.17.1 + + + + + apache.snapshots + Apache Development Snapshot Repository + https://repository.apache.org/content/repositories/snapshots/ + + false + + + true + + + + + + + + + org.apache.flink + flink-streaming-java + ${flink.version} + provided + + + org.apache.flink + flink-clients + ${flink.version} + provided + + + + + + org.apache.flink + flink-connector-kafka + ${flink.version} + + + + + + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j.version} + runtime + + + org.apache.logging.log4j + log4j-api + ${log4j.version} + runtime + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + runtime + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + ${target.java.version} + ${target.java.version} + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.1.1 + + + + package + + shade + + + false + + + org.apache.flink:flink-shaded-force-shading + com.google.code.findbugs:jsr305 + org.slf4j:* + org.apache.logging.log4j:* + + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + org.myorg.quickstart.DataStreamJob + + + + + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.apache.maven.plugins + maven-shade-plugin + [3.1.1,) + + shade + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + [3.1,) + + testCompile + compile + + + + + + + + + + + + + + diff --git a/flink-learn/README.md b/flink-learn/README.md new file mode 100644 index 0000000..7ceb3c1 --- /dev/null +++ b/flink-learn/README.md @@ -0,0 +1,6 @@ +# Flink Learn +This repo will contain examples of how to use Apache Flink and Flink SQL. + +| Project | Description | +| ----------- | ----------- | +| [quickstart](./1-quickstart/) | Getting started with Apache Flink and FlinkSQL with Redpanda |