diff options
author | Weiqing Yang <yangweiqing001@gmail.com> | 2017-01-03 09:56:42 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2017-01-03 09:56:42 +0000 |
commit | e5c307c50a660f706799f1f7f6890bcec888d96b (patch) | |
tree | c576e5aa397e437836dfb8d098d051f558a1d924 /mllib/src | |
parent | ae83c211257c508989c703d54f2aeec8b2b5f14d (diff) | |
download | spark-e5c307c50a660f706799f1f7f6890bcec888d96b.tar.gz spark-e5c307c50a660f706799f1f7f6890bcec888d96b.tar.bz2 spark-e5c307c50a660f706799f1f7f6890bcec888d96b.zip |
[MINOR] Add missing sc.stop() to end of examples
## What changes were proposed in this pull request?
Add `finally` clause for `sc.stop()` in the `test("register and deregister Spark listener from SparkContext")`.
## How was this patch tested?
Pass the build and unit tests.
Author: Weiqing Yang <yangweiqing001@gmail.com>
Closes #16426 from weiqingy/testIssue.
Diffstat (limited to 'mllib/src')
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/mllib/util/KMeansDataGenerator.scala | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/util/KMeansDataGenerator.scala b/mllib/src/main/scala/org/apache/spark/mllib/util/KMeansDataGenerator.scala index 00fd1606a3..7f84be9f37 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/util/KMeansDataGenerator.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/util/KMeansDataGenerator.scala @@ -86,6 +86,7 @@ object KMeansDataGenerator { val data = generateKMeansRDD(sc, numPoints, k, d, r, parts) data.map(_.mkString(" ")).saveAsTextFile(outputPath) + sc.stop() System.exit(0) } } |