Skip to content

Conversation

@tdas
Copy link
Contributor

@tdas tdas commented May 19, 2015

These missing cleaners lead to capturing unnecessary objects in closures, especially when using a spark streaming in spark-shell.

@tdas
Copy link
Contributor Author

tdas commented May 19, 2015

@andrewor14 Could you please take a look?

@AmplabJenkins
Copy link

Merged build triggered.

@AmplabJenkins
Copy link

Merged build started.

@SparkQA
Copy link

SparkQA commented May 19, 2015

Test build #33096 has started for PR 6268 at commit c1dc4cf.

Copy link
Contributor

Choose a reason for hiding this comment

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

This one's actually not necessary because it will be cleaned by reduceByKey later

@andrewor14
Copy link
Contributor

@tdas Most of the changes are actually not required, because they eventually get cleaned later through other methods. We established this rule in #5787.

So the only places that are actually required are: filter, combineByKey, mapValues, flatMapValues, and foreachRDD.

Additionally there are a few calls in updateStateByKey that need to be cleaned. In general, the following pattern needs cleaning:

def somePublicMethod(func: () => Int): Unit = {
  val cleanedF = sc.clean(func)
  new SomeRDD(this, (unused: Int) => cleanedF())
}

I've opened #6269 to describe what I mean.

@SparkQA
Copy link

SparkQA commented May 19, 2015

Test build #33096 has finished for PR 6268 at commit c1dc4cf.

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

@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/33096/
Test PASSed.

@tdas
Copy link
Contributor Author

tdas commented May 20, 2015

@andrewor14 I am closing this PR, yours is far better :)

@tdas tdas closed this May 20, 2015
asfgit pushed a commit that referenced this pull request May 20, 2015
… need cleaning

SPARK-7741 is the equivalent of SPARK-7237 in streaming. This is an alternative to #6268.

Author: Andrew Or <[email protected]>

Closes #6269 from andrewor14/clean-moar and squashes the following commits:

c51c9ab [Andrew Or] Add periods (trivial)
6c686ac [Andrew Or] Merge branch 'master' of github.com:apache/spark into clean-moar
79a435b [Andrew Or] Fix tests
d18c9f9 [Andrew Or] Merge branch 'master' of github.com:apache/spark into clean-moar
65ef07b [Andrew Or] Fix tests?
4b487a3 [Andrew Or] Add tests for closures passed to DStream operations
328139b [Andrew Or] Do not forget foreachRDD
5431f61 [Andrew Or] Clean streaming closures
72b7b73 [Andrew Or] Clean core closures

(cherry picked from commit 9b84443)
Signed-off-by: Tathagata Das <[email protected]>
asfgit pushed a commit that referenced this pull request May 20, 2015
… need cleaning

SPARK-7741 is the equivalent of SPARK-7237 in streaming. This is an alternative to #6268.

Author: Andrew Or <[email protected]>

Closes #6269 from andrewor14/clean-moar and squashes the following commits:

c51c9ab [Andrew Or] Add periods (trivial)
6c686ac [Andrew Or] Merge branch 'master' of github.com:apache/spark into clean-moar
79a435b [Andrew Or] Fix tests
d18c9f9 [Andrew Or] Merge branch 'master' of github.com:apache/spark into clean-moar
65ef07b [Andrew Or] Fix tests?
4b487a3 [Andrew Or] Add tests for closures passed to DStream operations
328139b [Andrew Or] Do not forget foreachRDD
5431f61 [Andrew Or] Clean streaming closures
72b7b73 [Andrew Or] Clean core closures
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request May 28, 2015
… need cleaning

SPARK-7741 is the equivalent of SPARK-7237 in streaming. This is an alternative to apache#6268.

Author: Andrew Or <[email protected]>

Closes apache#6269 from andrewor14/clean-moar and squashes the following commits:

c51c9ab [Andrew Or] Add periods (trivial)
6c686ac [Andrew Or] Merge branch 'master' of github.com:apache/spark into clean-moar
79a435b [Andrew Or] Fix tests
d18c9f9 [Andrew Or] Merge branch 'master' of github.com:apache/spark into clean-moar
65ef07b [Andrew Or] Fix tests?
4b487a3 [Andrew Or] Add tests for closures passed to DStream operations
328139b [Andrew Or] Do not forget foreachRDD
5431f61 [Andrew Or] Clean streaming closures
72b7b73 [Andrew Or] Clean core closures
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request Jun 12, 2015
… need cleaning

SPARK-7741 is the equivalent of SPARK-7237 in streaming. This is an alternative to apache#6268.

Author: Andrew Or <[email protected]>

Closes apache#6269 from andrewor14/clean-moar and squashes the following commits:

c51c9ab [Andrew Or] Add periods (trivial)
6c686ac [Andrew Or] Merge branch 'master' of github.com:apache/spark into clean-moar
79a435b [Andrew Or] Fix tests
d18c9f9 [Andrew Or] Merge branch 'master' of github.com:apache/spark into clean-moar
65ef07b [Andrew Or] Fix tests?
4b487a3 [Andrew Or] Add tests for closures passed to DStream operations
328139b [Andrew Or] Do not forget foreachRDD
5431f61 [Andrew Or] Clean streaming closures
72b7b73 [Andrew Or] Clean core closures
nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
… need cleaning

SPARK-7741 is the equivalent of SPARK-7237 in streaming. This is an alternative to apache#6268.

Author: Andrew Or <[email protected]>

Closes apache#6269 from andrewor14/clean-moar and squashes the following commits:

c51c9ab [Andrew Or] Add periods (trivial)
6c686ac [Andrew Or] Merge branch 'master' of github.com:apache/spark into clean-moar
79a435b [Andrew Or] Fix tests
d18c9f9 [Andrew Or] Merge branch 'master' of github.com:apache/spark into clean-moar
65ef07b [Andrew Or] Fix tests?
4b487a3 [Andrew Or] Add tests for closures passed to DStream operations
328139b [Andrew Or] Do not forget foreachRDD
5431f61 [Andrew Or] Clean streaming closures
72b7b73 [Andrew Or] Clean core closures
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.

4 participants