Skip to content

Commit dd88444

Browse files
committed
Added more docs
1 parent e1a8505 commit dd88444

File tree

3 files changed

+37
-4
lines changed

3 files changed

+37
-4
lines changed

streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,12 @@ class StreamingContext private[streaming] (
513513
/**
514514
* :: DeveloperApi ::
515515
*
516-
* Return the current state of the context.
516+
* Return the current state of the context. The context can be in three possible states -
517+
* - StreamingContextState.INTIALIZED - The context has been created, but not been started yet.
518+
* Input DStreams, transformations and output operations can be created on the context.
519+
* - StreamingContextState.STARTED - The context has been started, and been not stopped.
520+
* Input DStreams, transformations and output operations cannot be created on the context.
521+
* - StreamingContextState.STOPPED - The context has been stopped and cannot be used any more.
517522
*/
518523
@DeveloperApi
519524
def getState(): StreamingContextState = {

streaming/src/main/scala/org/apache/spark/streaming/StreamingContextState.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,24 @@
2222
/**
2323
* :: DeveloperApi ::
2424
*
25-
* Represents the state of the StreamingContext.
25+
* Represents the state of a StreamingContext.
2626
*/
2727
@DeveloperApi
2828
public enum StreamingContextState {
29-
INITIALIZED, STARTED, STOPPED
29+
/**
30+
* The context has been created, but not been started yet.
31+
* Input DStreams, transformations and output operations can be created on the context.
32+
*/
33+
INITIALIZED,
34+
35+
/**
36+
* The context has been started, and been not stopped.
37+
* Input DStreams, transformations and output operations cannot be created on the context.
38+
*/
39+
STARTED,
40+
41+
/**
42+
* The context has been stopped and cannot be used any more.
43+
*/
44+
STOPPED
3045
}

streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,20 @@ class JavaStreamingContext(val ssc: StreamingContext) extends Closeable {
581581
/**
582582
* :: DeveloperApi ::
583583
*
584-
* Return the current state of the context.
584+
* Return the current state of the context. The context can be in three possible states -
585+
* <ul>
586+
* <li>
587+
* StreamingContextState.INTIALIZED - The context has been created, but not been started yet.
588+
* Input DStreams, transformations and output operations can be created on the context.
589+
* </li>
590+
* <li>
591+
* StreamingContextState.STARTED - The context has been started, and been not stopped.
592+
* Input DStreams, transformations and output operations cannot be created on the context.
593+
* </li>
594+
* <li>
595+
* StreamingContextState.STOPPED - The context has been stopped and cannot be used any more.
596+
* </li>
597+
* </ul>
585598
*/
586599
def getState(): StreamingContextState = {
587600
ssc.getState()

0 commit comments

Comments
 (0)