-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPARK-3639 | Removed settings master in examples #2536
Closed
aniketbhatnagar
wants to merge
3
commits into
apache:master
from
aniketbhatnagar:Kinesis-Examples-Master-Unset
Closed
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,10 @@ import org.apache.log4j.Level | |
* org.apache.spark.examples.streaming.KinesisWordCountASL mySparkStream \ | ||
* https://kinesis.us-east-1.amazonaws.com | ||
* | ||
* | ||
* Note that number of workers/threads should be 1 more thread than the number of receivers. | ||
* This leaves one thread available for actually processing the data. | ||
* | ||
* There is a companion helper class below called KinesisWordCountProducerASL which puts | ||
* dummy data onto the Kinesis stream. | ||
* Usage instructions for KinesisWordCountProducerASL are provided in that class definition. | ||
|
@@ -97,17 +101,12 @@ private object KinesisWordCountASL extends Logging { | |
/* In this example, we're going to create 1 Kinesis Worker/Receiver/DStream for each shard. */ | ||
val numStreams = numShards | ||
|
||
/* | ||
* numSparkThreads should be 1 more thread than the number of receivers. | ||
* This leaves one thread available for actually processing the data. | ||
*/ | ||
val numSparkThreads = numStreams + 1 | ||
|
||
|
||
/* Setup the and SparkConfig and StreamingContext */ | ||
/* Spark Streaming batch interval */ | ||
val batchInterval = Milliseconds(2000) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remove random new lines here? |
||
val sparkConfig = new SparkConf().setAppName("KinesisWordCount") | ||
.setMaster(s"local[$numSparkThreads]") | ||
val ssc = new StreamingContext(sparkConfig, batchInterval) | ||
|
||
/* Kinesis checkpoint interval. Same as batchInterval for this example. */ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"should be 1 more than the number of receivers"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean this example can't run with
--master local
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this example may not run with --master local if number of cores in the machine are not more than number of shards in the Kinesis stream. I think this is fine because same is the case when running in the standalone or yarn cluster