examples-scala | Stream Processing with Apache Flink - Scala Examples
kandi X-RAY | examples-scala Summary
kandi X-RAY | examples-scala Summary
Stream Processing with Apache Flink - Scala Examples
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of examples-scala
examples-scala Key Features
examples-scala Examples and Code Snippets
Community Discussions
Trending Discussions on examples-scala
QUESTION
I am working through the book Stream Processing with Apache Flink
by Fabian Hueske and Vasiliki Kalavri.
The book includes an example Flink application and I want to figure out how to run the file. It is a scala file located here in their github repo.
Must I turn it into a JAR file before I run it? If so, how do I convert the file to JAR?
...ANSWER
Answered 2022-Jan-20 at 21:29Except for SQL queries submitted with Flink‘s SQL client, a user needs to package a JAR file. Usually, a Flink program file can be packaged using a Maven or Gradle project:
QUESTION
I am trying to run the first example from the oreilly book "Stream Processing with Apache Flink" and from the flink project. Each gives different errors
Example from the book gies NoClassDefFound error Example from flink project gives java.net.ConnectException: Connection refused (Connection refused) but does create a flink job, see screenshot.
Detail below
Book example
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError:scala/runtime/java8/JFunction1$mcVI$sp at io.github.streamingwithflink.chapter1.AverageSensorReadings$$anon$3.createSerializer(AverageSensorReadings.scala:50)
The instructions from the book are:
download flink-1.7.1-bin-scala_2.12.tgz
extract
- start cluster ./bin/start-cluster.sh
- open flink's web UI http://localhost:8081
this all works fine
- Download the jar file that includes examples in this book
- run example
ANSWER
Answered 2020-Apr-06 at 21:59I tried to reproduce the failing AverageSensorReadings
example, but it was working on my setup. I'll try look deeper into it tomorrow.
Regarding the SocketWindowWordCount
example, the error message indicates that the Flink job failed to open a connection to the socket on port 9000. You need to open the socket before you start the job. You can do this for example with netcat:
QUESTION
As described in this post I have been unable to successfully run any code from the book "Stream Processing with Apache Flink, including the precompiled jar.
It is not my practice to use an IDE but I thought I would try to use IntelliJ as Chapter 3 "Run and Debug Flink Applications in an IDE" describes how to do that specifically for the code for this book.
The book describes a project import process that I have not found a way to use. It describes setting options on import, for example select Maven. I have not found a way to set any options on import.
I am able to import a project and run code. The code fails, looks like with missing dependency. Maybe because it isn't a Maven project?
Here are steps to reproduce
git clone https://github.com/streaming-with-flink/examples-scala.git
Start IntelliJ
Choose "Open or Import" and Select the "examples-scala/" folder. The project imports with no chance to select options.
Now I have a project
Browse to AverageSensorReadings class, open, and run.
Errors with
java.lang.NoClassDefFoundError: org/apache/flink/api/common/typeinfo/TypeInformation
How can I run this code in IntelliJ?
...ANSWER
Answered 2020-Apr-15 at 16:40I see that flink dependencies have provided
scope in Maven - this means that thay are not included into the classpath when you running the application. Most likely the application is meant to be run on environment where these dependencies already exist (e.g. Hadoop). To be able to run it from from IDE set Include dependencies with "Provided" scope option in Run Configuration:
QUESTION
I'm implementing a custom NSQ sink for Flink. I have it working as a subclass of RichSinkFunction
, but I'd like to get the write-ahead log implementation working for extra data integrity.
Using O'Reilly's WriteAheadSinkExample available here, I attempted to implement my own:
...ANSWER
Answered 2020-Feb-11 at 13:34The issue here is most certainly the fact that You never call the open()
method of the superclass. This will cause some of the variables to be uninitialized.
This should be solved by calling the super.open()
inside Your open()
method.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install examples-scala
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page