Skip to content
Snippets Groups Projects
Commit 7f74bb3b authored by zsxwing's avatar zsxwing Committed by Reynold Xin
Browse files

[SPARK-8025][Streaming]Add JavaDoc style deprecation for deprecated Streaming methods

Scala `deprecated` annotation actually doesn't show up in JavaDoc.

Author: zsxwing <zsxwing@gmail.com>

Closes #6564 from zsxwing/SPARK-8025 and squashes the following commits:

2faa2bb [zsxwing] Add JavaDoc style deprecation for deprecated Streaming methods
parent 75dda33f
No related branches found
No related tags found
No related merge requests found
...@@ -271,6 +271,8 @@ class StreamingContext private[streaming] ( ...@@ -271,6 +271,8 @@ class StreamingContext private[streaming] (
* Create an input stream with any arbitrary user implemented receiver. * Create an input stream with any arbitrary user implemented receiver.
* Find more details at: http://spark.apache.org/docs/latest/streaming-custom-receivers.html * Find more details at: http://spark.apache.org/docs/latest/streaming-custom-receivers.html
* @param receiver Custom implementation of Receiver * @param receiver Custom implementation of Receiver
*
* @deprecated As of 1.0.0", replaced by `receiverStream`.
*/ */
@deprecated("Use receiverStream", "1.0.0") @deprecated("Use receiverStream", "1.0.0")
def networkStream[T: ClassTag](receiver: Receiver[T]): ReceiverInputDStream[T] = { def networkStream[T: ClassTag](receiver: Receiver[T]): ReceiverInputDStream[T] = {
...@@ -617,6 +619,8 @@ class StreamingContext private[streaming] ( ...@@ -617,6 +619,8 @@ class StreamingContext private[streaming] (
* Wait for the execution to stop. Any exceptions that occurs during the execution * Wait for the execution to stop. Any exceptions that occurs during the execution
* will be thrown in this thread. * will be thrown in this thread.
* @param timeout time to wait in milliseconds * @param timeout time to wait in milliseconds
*
* @deprecated As of 1.3.0, replaced by `awaitTerminationOrTimeout(Long)`.
*/ */
@deprecated("Use awaitTerminationOrTimeout(Long) instead", "1.3.0") @deprecated("Use awaitTerminationOrTimeout(Long) instead", "1.3.0")
def awaitTermination(timeout: Long) { def awaitTermination(timeout: Long) {
...@@ -741,6 +745,10 @@ object StreamingContext extends Logging { ...@@ -741,6 +745,10 @@ object StreamingContext extends Logging {
} }
} }
/**
* @deprecated As of 1.3.0, replaced by implicit functions in the DStream companion object.
* This is kept here only for backward compatibility.
*/
@deprecated("Replaced by implicit functions in the DStream companion object. This is " + @deprecated("Replaced by implicit functions in the DStream companion object. This is " +
"kept here only for backward compatibility.", "1.3.0") "kept here only for backward compatibility.", "1.3.0")
def toPairDStreamFunctions[K, V](stream: DStream[(K, V)]) def toPairDStreamFunctions[K, V](stream: DStream[(K, V)])
......
...@@ -148,6 +148,9 @@ class JavaStreamingContext(val ssc: StreamingContext) extends Closeable { ...@@ -148,6 +148,9 @@ class JavaStreamingContext(val ssc: StreamingContext) extends Closeable {
/** The underlying SparkContext */ /** The underlying SparkContext */
val sparkContext = new JavaSparkContext(ssc.sc) val sparkContext = new JavaSparkContext(ssc.sc)
/**
* @deprecated As of 0.9.0, replaced by `sparkContext`
*/
@deprecated("use sparkContext", "0.9.0") @deprecated("use sparkContext", "0.9.0")
val sc: JavaSparkContext = sparkContext val sc: JavaSparkContext = sparkContext
...@@ -619,6 +622,7 @@ class JavaStreamingContext(val ssc: StreamingContext) extends Closeable { ...@@ -619,6 +622,7 @@ class JavaStreamingContext(val ssc: StreamingContext) extends Closeable {
* Wait for the execution to stop. Any exceptions that occurs during the execution * Wait for the execution to stop. Any exceptions that occurs during the execution
* will be thrown in this thread. * will be thrown in this thread.
* @param timeout time to wait in milliseconds * @param timeout time to wait in milliseconds
* @deprecated As of 1.3.0, replaced by `awaitTerminationOrTimeout(Long)`.
*/ */
@deprecated("Use awaitTerminationOrTimeout(Long) instead", "1.3.0") @deprecated("Use awaitTerminationOrTimeout(Long) instead", "1.3.0")
def awaitTermination(timeout: Long): Unit = { def awaitTermination(timeout: Long): Unit = {
...@@ -677,6 +681,7 @@ object JavaStreamingContext { ...@@ -677,6 +681,7 @@ object JavaStreamingContext {
* *
* @param checkpointPath Checkpoint directory used in an earlier JavaStreamingContext program * @param checkpointPath Checkpoint directory used in an earlier JavaStreamingContext program
* @param factory JavaStreamingContextFactory object to create a new JavaStreamingContext * @param factory JavaStreamingContextFactory object to create a new JavaStreamingContext
* @deprecated As of 1.4.0, replaced by `getOrCreate` without JavaStreamingContextFactor.
*/ */
@deprecated("use getOrCreate without JavaStreamingContextFactor", "1.4.0") @deprecated("use getOrCreate without JavaStreamingContextFactor", "1.4.0")
def getOrCreate( def getOrCreate(
...@@ -699,6 +704,7 @@ object JavaStreamingContext { ...@@ -699,6 +704,7 @@ object JavaStreamingContext {
* @param factory JavaStreamingContextFactory object to create a new JavaStreamingContext * @param factory JavaStreamingContextFactory object to create a new JavaStreamingContext
* @param hadoopConf Hadoop configuration if necessary for reading from any HDFS compatible * @param hadoopConf Hadoop configuration if necessary for reading from any HDFS compatible
* file system * file system
* @deprecated As of 1.4.0, replaced by `getOrCreate` without JavaStreamingContextFactor.
*/ */
@deprecated("use getOrCreate without JavaStreamingContextFactory", "1.4.0") @deprecated("use getOrCreate without JavaStreamingContextFactory", "1.4.0")
def getOrCreate( def getOrCreate(
...@@ -724,6 +730,7 @@ object JavaStreamingContext { ...@@ -724,6 +730,7 @@ object JavaStreamingContext {
* file system * file system
* @param createOnError Whether to create a new JavaStreamingContext if there is an * @param createOnError Whether to create a new JavaStreamingContext if there is an
* error in reading checkpoint data. * error in reading checkpoint data.
* @deprecated As of 1.4.0, replaced by `getOrCreate` without JavaStreamingContextFactor.
*/ */
@deprecated("use getOrCreate without JavaStreamingContextFactory", "1.4.0") @deprecated("use getOrCreate without JavaStreamingContextFactory", "1.4.0")
def getOrCreate( def getOrCreate(
......
...@@ -603,6 +603,8 @@ abstract class DStream[T: ClassTag] ( ...@@ -603,6 +603,8 @@ abstract class DStream[T: ClassTag] (
/** /**
* Apply a function to each RDD in this DStream. This is an output operator, so * Apply a function to each RDD in this DStream. This is an output operator, so
* 'this' DStream will be registered as an output stream and therefore materialized. * 'this' DStream will be registered as an output stream and therefore materialized.
*
* @deprecated As of 0.9.0, replaced by `foreachRDD`.
*/ */
@deprecated("use foreachRDD", "0.9.0") @deprecated("use foreachRDD", "0.9.0")
def foreach(foreachFunc: RDD[T] => Unit): Unit = ssc.withScope { def foreach(foreachFunc: RDD[T] => Unit): Unit = ssc.withScope {
...@@ -612,6 +614,8 @@ abstract class DStream[T: ClassTag] ( ...@@ -612,6 +614,8 @@ abstract class DStream[T: ClassTag] (
/** /**
* Apply a function to each RDD in this DStream. This is an output operator, so * Apply a function to each RDD in this DStream. This is an output operator, so
* 'this' DStream will be registered as an output stream and therefore materialized. * 'this' DStream will be registered as an output stream and therefore materialized.
*
* @deprecated As of 0.9.0, replaced by `foreachRDD`.
*/ */
@deprecated("use foreachRDD", "0.9.0") @deprecated("use foreachRDD", "0.9.0")
def foreach(foreachFunc: (RDD[T], Time) => Unit): Unit = ssc.withScope { def foreach(foreachFunc: (RDD[T], Time) => Unit): Unit = ssc.withScope {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment