class JavaMapWithStateDStream[KeyType, ValueType, StateType, MappedType] extends JavaDStream[MappedType]
DStream representing the stream of data generated by mapWithState
operation on a
JavaPairDStream. Additionally, it also gives access to the
stream of state snapshots, that is, the state data of all keys after a batch has updated them.
- KeyType
Class of the keys
- ValueType
Class of the values
- StateType
Class of the state data
- MappedType
Class of the mapped data
- Alphabetic
- By Inheritance
- JavaMapWithStateDStream
- JavaDStream
- AbstractJavaDStreamLike
- JavaDStreamLike
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
cache(): JavaDStream[MappedType]
Persist RDDs of this DStream with the default storage level (MEMORY_ONLY_SER)
Persist RDDs of this DStream with the default storage level (MEMORY_ONLY_SER)
- Definition Classes
- JavaDStream
-
def
checkpoint(interval: Duration): DStream[MappedType]
Enable periodic checkpointing of RDDs of this DStream.
Enable periodic checkpointing of RDDs of this DStream.
- interval
Time interval after which generated RDD will be checkpointed
- Definition Classes
- JavaDStreamLike
-
implicit
val
classTag: ClassTag[MappedType]
- Definition Classes
- JavaDStream → JavaDStreamLike
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
compute(validTime: Time): JavaRDD[MappedType]
Generate an RDD for the given duration
Generate an RDD for the given duration
- Definition Classes
- JavaDStream
-
def
context(): StreamingContext
Return the org.apache.spark.streaming.StreamingContext associated with this DStream
Return the org.apache.spark.streaming.StreamingContext associated with this DStream
- Definition Classes
- JavaDStreamLike
-
def
count(): JavaDStream[Long]
Return a new DStream in which each RDD has a single element generated by counting each RDD of this DStream.
Return a new DStream in which each RDD has a single element generated by counting each RDD of this DStream.
- Definition Classes
- JavaDStreamLike
-
def
countByValue(numPartitions: Int): JavaPairDStream[MappedType, Long]
Return a new DStream in which each RDD contains the counts of each distinct value in each RDD of this DStream.
Return a new DStream in which each RDD contains the counts of each distinct value in each RDD of this DStream. Hash partitioning is used to generate the RDDs with
numPartitions
partitions.- numPartitions
number of partitions of each RDD in the new DStream.
- Definition Classes
- JavaDStreamLike
-
def
countByValue(): JavaPairDStream[MappedType, Long]
Return a new DStream in which each RDD contains the counts of each distinct value in each RDD of this DStream.
Return a new DStream in which each RDD contains the counts of each distinct value in each RDD of this DStream. Hash partitioning is used to generate the RDDs with Spark's default number of partitions.
- Definition Classes
- JavaDStreamLike
-
def
countByValueAndWindow(windowDuration: Duration, slideDuration: Duration, numPartitions: Int): JavaPairDStream[MappedType, Long]
Return a new DStream in which each RDD contains the count of distinct elements in RDDs in a sliding window over this DStream.
Return a new DStream in which each RDD contains the count of distinct elements in RDDs in a sliding window over this DStream. Hash partitioning is used to generate the RDDs with
numPartitions
partitions.- windowDuration
width of the window; must be a multiple of this DStream's batching interval
- slideDuration
sliding interval of the window (i.e., the interval after which the new DStream will generate RDDs); must be a multiple of this DStream's batching interval
- numPartitions
number of partitions of each RDD in the new DStream.
- Definition Classes
- JavaDStreamLike
-
def
countByValueAndWindow(windowDuration: Duration, slideDuration: Duration): JavaPairDStream[MappedType, Long]
Return a new DStream in which each RDD contains the count of distinct elements in RDDs in a sliding window over this DStream.
Return a new DStream in which each RDD contains the count of distinct elements in RDDs in a sliding window over this DStream. Hash partitioning is used to generate the RDDs with Spark's default number of partitions.
- windowDuration
width of the window; must be a multiple of this DStream's batching interval
- slideDuration
sliding interval of the window (i.e., the interval after which the new DStream will generate RDDs); must be a multiple of this DStream's batching interval
- Definition Classes
- JavaDStreamLike
-
def
countByWindow(windowDuration: Duration, slideDuration: Duration): JavaDStream[Long]
Return a new DStream in which each RDD has a single element generated by counting the number of elements in a window over this DStream.
Return a new DStream in which each RDD has a single element generated by counting the number of elements in a window over this DStream. windowDuration and slideDuration are as defined in the window() operation. This is equivalent to window(windowDuration, slideDuration).count()
- Definition Classes
- JavaDStreamLike
-
val
dstream: DStream[MappedType]
- Definition Classes
- JavaDStream → JavaDStreamLike
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
filter(f: Function[MappedType, Boolean]): JavaDStream[MappedType]
Return a new DStream containing only the elements that satisfy a predicate.
Return a new DStream containing only the elements that satisfy a predicate.
- Definition Classes
- JavaDStream
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[U](f: FlatMapFunction[MappedType, U]): JavaDStream[U]
Return a new DStream by applying a function to all elements of this DStream, and then flattening the results
Return a new DStream by applying a function to all elements of this DStream, and then flattening the results
- Definition Classes
- JavaDStreamLike
-
def
flatMapToPair[K2, V2](f: PairFlatMapFunction[MappedType, K2, V2]): JavaPairDStream[K2, V2]
Return a new DStream by applying a function to all elements of this DStream, and then flattening the results
Return a new DStream by applying a function to all elements of this DStream, and then flattening the results
- Definition Classes
- JavaDStreamLike
-
def
foreachRDD(foreachFunc: VoidFunction2[JavaRDD[MappedType], Time]): Unit
Apply a function to each RDD in this DStream.
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.
- Definition Classes
- JavaDStreamLike
-
def
foreachRDD(foreachFunc: VoidFunction[JavaRDD[MappedType]]): Unit
Apply a function to each RDD in this DStream.
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.
- Definition Classes
- JavaDStreamLike
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
glom(): JavaDStream[List[MappedType]]
Return a new DStream in which each RDD is generated by applying glom() to each RDD of this DStream.
Return a new DStream in which each RDD is generated by applying glom() to each RDD of this DStream. Applying glom() to an RDD coalesces all elements within each partition into an array.
- Definition Classes
- JavaDStreamLike
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
map[U](f: Function[MappedType, U]): JavaDStream[U]
Return a new DStream by applying a function to all elements of this DStream.
Return a new DStream by applying a function to all elements of this DStream.
- Definition Classes
- JavaDStreamLike
-
def
mapPartitions[U](f: FlatMapFunction[Iterator[MappedType], U]): JavaDStream[U]
Return a new DStream in which each RDD is generated by applying mapPartitions() to each RDDs of this DStream.
Return a new DStream in which each RDD is generated by applying mapPartitions() to each RDDs of this DStream. Applying mapPartitions() to an RDD applies a function to each partition of the RDD.
- Definition Classes
- JavaDStreamLike
-
def
mapPartitionsToPair[K2, V2](f: PairFlatMapFunction[Iterator[MappedType], K2, V2]): JavaPairDStream[K2, V2]
Return a new DStream in which each RDD is generated by applying mapPartitions() to each RDDs of this DStream.
Return a new DStream in which each RDD is generated by applying mapPartitions() to each RDDs of this DStream. Applying mapPartitions() to an RDD applies a function to each partition of the RDD.
- Definition Classes
- JavaDStreamLike
-
def
mapToPair[K2, V2](f: PairFunction[MappedType, K2, V2]): JavaPairDStream[K2, V2]
Return a new DStream by applying a function to all elements of this DStream.
Return a new DStream by applying a function to all elements of this DStream.
- Definition Classes
- JavaDStreamLike
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
persist(storageLevel: StorageLevel): JavaDStream[MappedType]
Persist the RDDs of this DStream with the given storage level
Persist the RDDs of this DStream with the given storage level
- Definition Classes
- JavaDStream
-
def
persist(): JavaDStream[MappedType]
Persist RDDs of this DStream with the default storage level (MEMORY_ONLY_SER)
Persist RDDs of this DStream with the default storage level (MEMORY_ONLY_SER)
- Definition Classes
- JavaDStream
-
def
print(num: Int): Unit
Print the first num elements of each RDD generated in this DStream.
Print the first num elements of each RDD generated in this DStream. This is an output operator, so this DStream will be registered as an output stream and there materialized.
- Definition Classes
- JavaDStreamLike
-
def
print(): Unit
Print the first ten elements of each RDD generated in this DStream.
Print the first ten elements of each RDD generated in this DStream. This is an output operator, so this DStream will be registered as an output stream and there materialized.
- Definition Classes
- JavaDStreamLike
-
def
reduce(f: Function2[MappedType, MappedType, MappedType]): JavaDStream[MappedType]
Return a new DStream in which each RDD has a single element generated by reducing each RDD of this DStream.
Return a new DStream in which each RDD has a single element generated by reducing each RDD of this DStream.
- Definition Classes
- JavaDStreamLike
-
def
reduceByWindow(reduceFunc: Function2[MappedType, MappedType, MappedType], invReduceFunc: Function2[MappedType, MappedType, MappedType], windowDuration: Duration, slideDuration: Duration): JavaDStream[MappedType]
Return a new DStream in which each RDD has a single element generated by reducing all elements in a sliding window over this DStream.
Return a new DStream in which each RDD has a single element generated by reducing all elements in a sliding window over this DStream. However, the reduction is done incrementally using the old window's reduced value :
- reduce the new values that entered the window (e.g., adding new counts) 2. "inverse reduce" the old values that left the window (e.g., subtracting old counts) This is more efficient than reduceByWindow without "inverse reduce" function. However, it is applicable to only "invertible reduce functions".
- reduceFunc
associative and commutative reduce function
- invReduceFunc
inverse reduce function; such that for all y, invertible x:
invReduceFunc(reduceFunc(x, y), x) = y
- windowDuration
width of the window; must be a multiple of this DStream's batching interval
- slideDuration
sliding interval of the window (i.e., the interval after which the new DStream will generate RDDs); must be a multiple of this DStream's batching interval
- Definition Classes
- JavaDStreamLike
-
def
reduceByWindow(reduceFunc: Function2[MappedType, MappedType, MappedType], windowDuration: Duration, slideDuration: Duration): JavaDStream[MappedType]
Return a new DStream in which each RDD has a single element generated by reducing all elements in a sliding window over this DStream.
Return a new DStream in which each RDD has a single element generated by reducing all elements in a sliding window over this DStream.
- reduceFunc
associative and commutative reduce function
- windowDuration
width of the window; must be a multiple of this DStream's batching interval
- slideDuration
sliding interval of the window (i.e., the interval after which the new DStream will generate RDDs); must be a multiple of this DStream's batching interval
- Definition Classes
- JavaDStreamLike
-
def
repartition(numPartitions: Int): JavaDStream[MappedType]
Return a new DStream with an increased or decreased level of parallelism.
Return a new DStream with an increased or decreased level of parallelism. Each RDD in the returned DStream has exactly numPartitions partitions.
- Definition Classes
- JavaDStream
-
implicit
def
scalaIntToJavaLong(in: DStream[Long]): JavaDStream[Long]
- Definition Classes
- JavaDStreamLike
-
def
slice(fromTime: Time, toTime: Time): List[JavaRDD[MappedType]]
Return all the RDDs between 'fromDuration' to 'toDuration' (both included)
Return all the RDDs between 'fromDuration' to 'toDuration' (both included)
- Definition Classes
- JavaDStreamLike
- def stateSnapshots(): JavaPairDStream[KeyType, StateType]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
transform[U](transformFunc: Function2[JavaRDD[MappedType], Time, JavaRDD[U]]): JavaDStream[U]
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
- Definition Classes
- JavaDStreamLike
-
def
transform[U](transformFunc: Function[JavaRDD[MappedType], JavaRDD[U]]): JavaDStream[U]
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
- Definition Classes
- JavaDStreamLike
-
def
transformToPair[K2, V2](transformFunc: Function2[JavaRDD[MappedType], Time, JavaPairRDD[K2, V2]]): JavaPairDStream[K2, V2]
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
- Definition Classes
- JavaDStreamLike
-
def
transformToPair[K2, V2](transformFunc: Function[JavaRDD[MappedType], JavaPairRDD[K2, V2]]): JavaPairDStream[K2, V2]
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
- Definition Classes
- JavaDStreamLike
-
def
transformWith[K2, V2, W](other: JavaPairDStream[K2, V2], transformFunc: Function3[JavaRDD[MappedType], JavaPairRDD[K2, V2], Time, JavaRDD[W]]): JavaDStream[W]
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
- Definition Classes
- JavaDStreamLike
-
def
transformWith[U, W](other: JavaDStream[U], transformFunc: Function3[JavaRDD[MappedType], JavaRDD[U], Time, JavaRDD[W]]): JavaDStream[W]
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
- Definition Classes
- JavaDStreamLike
-
def
transformWithToPair[K2, V2, K3, V3](other: JavaPairDStream[K2, V2], transformFunc: Function3[JavaRDD[MappedType], JavaPairRDD[K2, V2], Time, JavaPairRDD[K3, V3]]): JavaPairDStream[K3, V3]
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
- Definition Classes
- JavaDStreamLike
-
def
transformWithToPair[U, K2, V2](other: JavaDStream[U], transformFunc: Function3[JavaRDD[MappedType], JavaRDD[U], Time, JavaPairRDD[K2, V2]]): JavaPairDStream[K2, V2]
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
- Definition Classes
- JavaDStreamLike
-
def
union(that: JavaDStream[MappedType]): JavaDStream[MappedType]
Return a new DStream by unifying data of another DStream with this DStream.
Return a new DStream by unifying data of another DStream with this DStream.
- that
Another DStream having the same interval (i.e., slideDuration) as this DStream.
- Definition Classes
- JavaDStream
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
window(windowDuration: Duration, slideDuration: Duration): JavaDStream[MappedType]
Return a new DStream in which each RDD contains all the elements in seen in a sliding window of time over this DStream.
Return a new DStream in which each RDD contains all the elements in seen in a sliding window of time over this DStream.
- windowDuration
width of the window; must be a multiple of this DStream's batching interval
- slideDuration
sliding interval of the window (i.e., the interval after which the new DStream will generate RDDs); must be a multiple of this DStream's batching interval
- Definition Classes
- JavaDStream
-
def
window(windowDuration: Duration): JavaDStream[MappedType]
Return a new DStream in which each RDD contains all the elements in seen in a sliding window of time over this DStream.
Return a new DStream in which each RDD contains all the elements in seen in a sliding window of time over this DStream. The new DStream generates RDDs with the same interval as this DStream.
- windowDuration
width of the window; must be a multiple of this DStream's interval.
- Definition Classes
- JavaDStream
-
def
wrapRDD(rdd: RDD[MappedType]): JavaRDD[MappedType]
- Definition Classes
- JavaDStream → JavaDStreamLike