diff options
author | Herman van Hovell <hvanhovell@questtec.nl> | 2016-04-30 16:06:20 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-04-30 16:06:20 +0100 |
commit | e5fb78baf9a6014b6dd02cf9f528d069732aafca (patch) | |
tree | f1c49579318bfa86831fbd7cf84be902b0ece27f | |
parent | 0847fe4eb346e3c2060eb0f3680610bec06115e7 (diff) | |
download | spark-e5fb78baf9a6014b6dd02cf9f528d069732aafca.tar.gz spark-e5fb78baf9a6014b6dd02cf9f528d069732aafca.tar.bz2 spark-e5fb78baf9a6014b6dd02cf9f528d069732aafca.zip |
[SPARK-14952][CORE][ML] Remove methods that were deprecated in 1.6.0
#### What changes were proposed in this pull request?
This PR removes three methods the were deprecated in 1.6.0:
- `PortableDataStream.close()`
- `LinearRegression.weights`
- `LogisticRegression.weights`
The rationale for doing this is that the impact is small and that Spark 2.0 is a major release.
#### How was this patch tested?
Compilation succeded.
Author: Herman van Hovell <hvanhovell@questtec.nl>
Closes #12732 from hvanhovell/SPARK-14952.
6 files changed, 5 insertions, 34 deletions
diff --git a/core/src/main/scala/org/apache/spark/input/PortableDataStream.scala b/core/src/main/scala/org/apache/spark/input/PortableDataStream.scala index 18cb7631b3..f66510b6f9 100644 --- a/core/src/main/scala/org/apache/spark/input/PortableDataStream.scala +++ b/core/src/main/scala/org/apache/spark/input/PortableDataStream.scala @@ -185,15 +185,6 @@ class PortableDataStream( } } - /** - * Closing the PortableDataStream is not needed anymore. The user either can use the - * PortableDataStream to get a DataInputStream (which the user needs to close after usage), - * or a byte array. - */ - @deprecated("Closing the PortableDataStream is not needed anymore.", "1.6.0") - def close(): Unit = { - } - def getPath(): String = path } diff --git a/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala b/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala index 8cd7ee4d9a..717e93c058 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala @@ -480,9 +480,6 @@ class LogisticRegressionModel private[spark] ( extends ProbabilisticClassificationModel[Vector, LogisticRegressionModel] with LogisticRegressionParams with MLWritable { - @deprecated("Use coefficients instead.", "1.6.0") - def weights: Vector = coefficients - @Since("1.5.0") override def setThreshold(value: Double): this.type = super.setThreshold(value) diff --git a/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala b/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala index 0be8f3aebb..5117ee115c 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala @@ -389,9 +389,6 @@ class LinearRegressionModel private[ml] ( private var trainingSummary: Option[LinearRegressionTrainingSummary] = None - @deprecated("Use coefficients instead.", "1.6.0") - def weights: Vector = coefficients - override val numFeatures: Int = coefficients.size /** diff --git a/project/MimaExcludes.scala b/project/MimaExcludes.scala index 6fc49a08fe..33e0db606c 100644 --- a/project/MimaExcludes.scala +++ b/project/MimaExcludes.scala @@ -689,6 +689,11 @@ object MimaExcludes { // [SPARK-4452][Core]Shuffle data structures can starve others on the same thread for memory ProblemFilters.exclude[IncompatibleTemplateDefProblem]("org.apache.spark.util.collection.Spillable") ) ++ Seq( + // [SPARK-14952][Core][ML] Remove methods deprecated in 1.6 + ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.spark.input.PortableDataStream.close"), + ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.spark.ml.classification.LogisticRegressionModel.weights"), + ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.spark.ml.regression.LinearRegressionModel.weights") + ) ++ Seq( // SPARK-14654: New accumulator API ProblemFilters.exclude[MissingTypesProblem]("org.apache.spark.ExceptionFailure$"), ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.spark.ExceptionFailure.apply"), diff --git a/python/pyspark/ml/classification.py b/python/pyspark/ml/classification.py index cc562d2d3d..f616c7fbec 100644 --- a/python/pyspark/ml/classification.py +++ b/python/pyspark/ml/classification.py @@ -214,16 +214,6 @@ class LogisticRegressionModel(JavaModel, JavaMLWritable, JavaMLReadable): """ @property - @since("1.4.0") - def weights(self): - """ - Model weights. - """ - - warnings.warn("weights is deprecated. Use coefficients instead.") - return self._call_java("weights") - - @property @since("1.6.0") def coefficients(self): """ diff --git a/python/pyspark/ml/regression.py b/python/pyspark/ml/regression.py index 8e76070e9a..d490953f79 100644 --- a/python/pyspark/ml/regression.py +++ b/python/pyspark/ml/regression.py @@ -129,15 +129,6 @@ class LinearRegressionModel(JavaModel, JavaMLWritable, JavaMLReadable): """ @property - @since("1.4.0") - def weights(self): - """ - Model weights. - """ - warnings.warn("weights is deprecated. Use coefficients instead.") - return self._call_java("weights") - - @property @since("1.6.0") def coefficients(self): """ |