Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,12 @@ object KinesisUtils {
checkpointInterval: Duration,
storageLevel: StorageLevel
): ReceiverInputDStream[Array[Byte]] = {
ssc.receiverStream(
new KinesisReceiver(kinesisAppName, streamName, endpointUrl, validateRegion(regionName),
initialPositionInStream, checkpointInterval, storageLevel, None))
// Setting scope to override receiver stream's scope of "receiver stream"
ssc.withNamedScope("kinesis stream") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it would be good to add a comment explaining why this is necessary (there is no KinesisInputDStream or the like)

ssc.receiverStream(
new KinesisReceiver(kinesisAppName, streamName, endpointUrl, validateRegion(regionName),
initialPositionInStream, checkpointInterval, storageLevel, None))
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class StreamingContext private[streaming] (
*
* Note: Return statements are NOT allowed in the given body.
*/
private def withNamedScope[U](name: String)(body: => U): U = {
private[streaming] def withNamedScope[U](name: String)(body: => U): U = {
RDDOperationScope.withScope(sc, name, allowNesting = false, ignoreParent = false)(body)
}

Expand Down