Skip to content

[SPARK-8743] [Streaming]: Deregister Codahale metrics for streaming when StreamingContext is closed #7362

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

Closed
wants to merge 7 commits into from

Conversation

nssalian
Copy link

The issue link: https://issues.apache.org/jira/browse/SPARK-8743
Deregister Codahale metrics for streaming when StreamingContext is closed

Design:
Adding the method calls in the appropriate start() and stop () methods for the StreamingContext

Actions in the PullRequest:

  1. Added the registerSource method call to the start method for the Streaming Context.
  2. Added the removeSource method to the stop method.
  3. Added comments for both 1 and 2 and comment to show initialization of the StreamingSource
  4. Added a test case to check for both registration and de-registration of metrics

Previous closed PR for reference: #7250

…est to check the registration and de-registration
@nssalian
Copy link
Author

@tdas and @srowen, the new PR for the JIRA.

Thank you.

@@ -192,11 +192,8 @@ class StreamingContext private[streaming] (
None
}

/** Register streaming source to metrics system */
/* Initializing a streamingSource to register metrics */
Copy link
Member

Choose a reason for hiding this comment

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

Not a big deal, but I don't see why this was changed

Copy link
Author

Choose a reason for hiding this comment

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

It previously held the block of code that did the registration.
Here it simply initializes the streamingSource since the registration is moved into start()

@nssalian
Copy link
Author

Added the changes and ran ./dev/scalastyle and ~test-only *StreamingContextSuite.
Both passed.

@SparkQA
Copy link

SparkQA commented Jul 13, 2015

Test build #1060 has finished for PR 7362 at commit 0e8007a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@nssalian
Copy link
Author

@tdas does this PR need more improvement?

val streamingSource = StreamingContextSuite.getStreamingSource(ssc)
assert(sources.contains(streamingSource))
assert(ssc.getState() === StreamingContextState.ACTIVE)
Thread.sleep(100)
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason why you added this sleep?

Copy link
Author

Choose a reason for hiding this comment

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

Removed it. Added it during my runs.

Thanks.

@tdas
Copy link
Contributor

tdas commented Jul 13, 2015

LGTM, minus a nit on the Thread.sleep(). If there is no need for it please remove it. We dont want to increase unit test runtime unnecessarily.

@nssalian
Copy link
Author

@tdas Removed it.
Thank you for the review.

@tdas
Copy link
Contributor

tdas commented Jul 13, 2015

Jenkins, this is ok to test.

@andrewor14
Copy link
Contributor

Jenkins, slow test please

@SparkQA
Copy link

SparkQA commented Jul 13, 2015

Test build #37155 has finished for PR 7362 at commit 7d998a3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@tdas
Copy link
Contributor

tdas commented Jul 13, 2015

LGTM! Merging this in master and branch 1.4. Thanks!

@SparkQA
Copy link

SparkQA commented Jul 13, 2015

Test build #3 has finished for PR 7362 at commit 7d998a3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

nssalian pushed a commit that referenced this pull request Jul 13, 2015
…en StreamingContext is closed

The issue link: https://issues.apache.org/jira/browse/SPARK-8743
Deregister Codahale metrics for streaming when StreamingContext is closed

Design:
Adding the method calls in the appropriate start() and stop () methods for the StreamingContext

Actions in the PullRequest:
1) Added the registerSource method call to the start method for the Streaming Context.
2) Added the removeSource method to the stop method.
3) Added comments for both 1 and 2 and comment to show initialization of the StreamingSource
4) Added a test case to check for both registration and de-registration of metrics

Previous closed PR for reference: #7250

Author: Neelesh Srinivas Salian <[email protected]>

Closes #7362 from nssalian/branch-SPARK-8743 and squashes the following commits:

7d998a3 [Neelesh Srinivas Salian] Removed the Thread.sleep() call
8b26397 [Neelesh Srinivas Salian] Moved the scalatest.{} import
0e8007a [Neelesh Srinivas Salian] moved import org.apache.spark{} to correct place
daedaa5 [Neelesh Srinivas Salian] Corrected Ordering of imports
8873180 [Neelesh Srinivas Salian] Removed redundancy in imports
59227a4 [Neelesh Srinivas Salian] Changed the ordering of the imports to classify  scala and spark imports
d8cb577 [Neelesh Srinivas Salian] Added registerSource to start() and removeSource to stop(). Wrote a test to check the registration and de-registration
nssalian pushed a commit that referenced this pull request Jul 13, 2015
…en StreamingContext is closed

The issue link: https://issues.apache.org/jira/browse/SPARK-8743
Deregister Codahale metrics for streaming when StreamingContext is closed

Design:
Adding the method calls in the appropriate start() and stop () methods for the StreamingContext

Actions in the PullRequest:
1) Added the registerSource method call to the start method for the Streaming Context.
2) Added the removeSource method to the stop method.
3) Added comments for both 1 and 2 and comment to show initialization of the StreamingSource
4) Added a test case to check for both registration and de-registration of metrics

Previous closed PR for reference: #7250

Author: Neelesh Srinivas Salian <[email protected]>

Closes #7362 from nssalian/branch-SPARK-8743 and squashes the following commits:

7d998a3 [Neelesh Srinivas Salian] Removed the Thread.sleep() call
8b26397 [Neelesh Srinivas Salian] Moved the scalatest.{} import
0e8007a [Neelesh Srinivas Salian] moved import org.apache.spark{} to correct place
daedaa5 [Neelesh Srinivas Salian] Corrected Ordering of imports
8873180 [Neelesh Srinivas Salian] Removed redundancy in imports
59227a4 [Neelesh Srinivas Salian] Changed the ordering of the imports to classify  scala and spark imports
d8cb577 [Neelesh Srinivas Salian] Added registerSource to start() and removeSource to stop(). Wrote a test to check the registration and de-registration

(cherry picked from commit b7bcbe2)
Signed-off-by: Tathagata Das <[email protected]>
@tdas
Copy link
Contributor

tdas commented Jul 14, 2015

This has been merged. But for some reason the PR was not automatically closed. So could you close this PR. Thanks!

@nssalian
Copy link
Author

Closing. Thank you.

@nssalian nssalian closed this Jul 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants