org.apache.spark.streaming.api.java
Interface JavaDStreamLike<T,This extends JavaDStreamLike<T,This,R>,R extends JavaRDDLike<T,R>>

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
JavaDStream, JavaInputDStream, JavaPairDStream, JavaPairInputDStream, JavaPairReceiverInputDStream, JavaReceiverInputDStream

public interface JavaDStreamLike<T,This extends JavaDStreamLike<T,This,R>,R extends JavaRDDLike<T,R>>
extends scala.Serializable


Method Summary
 DStream<T> checkpoint(Duration interval)
          Enable periodic checkpointing of RDDs of this DStream.
 scala.reflect.ClassTag<T> classTag()
           
 StreamingContext context()
          Return the StreamingContext associated with this DStream
 JavaDStream<Long> count()
          Return a new DStream in which each RDD has a single element generated by counting each RDD of this DStream.
 JavaPairDStream<T,Long> countByValue()
          Return a new DStream in which each RDD contains the counts of each distinct value in each RDD of this DStream.
 JavaPairDStream<T,Long> countByValue(int numPartitions)
          Return a new DStream in which each RDD contains the counts of each distinct value in each RDD of this DStream.
 JavaPairDStream<T,Long> countByValueAndWindow(Duration windowDuration, Duration slideDuration)
          Return a new DStream in which each RDD contains the count of distinct elements in RDDs in a sliding window over this DStream.
 JavaPairDStream<T,Long> countByValueAndWindow(Duration windowDuration, Duration slideDuration, int numPartitions)
          Return a new DStream in which each RDD contains the count of distinct elements in RDDs in a sliding window over this DStream.
 JavaDStream<Long> countByWindow(Duration windowDuration, Duration slideDuration)
          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.
 DStream<T> dstream()
           
<U> JavaDStream<U>
flatMap(FlatMapFunction<T,U> f)
          Return a new DStream by applying a function to all elements of this DStream, and then flattening the results
<K2,V2> JavaPairDStream<K2,V2>
flatMapToPair(PairFlatMapFunction<T,K2,V2> f)
          Return a new DStream by applying a function to all elements of this DStream, and then flattening the results
 void foreach(Function<R,Void> foreachFunc)
          Deprecated. As of release 0.9.0, replaced by foreachRDD
 void foreach(Function2<R,Time,Void> foreachFunc)
          Deprecated. As of release 0.9.0, replaced by foreachRDD
 void foreachRDD(Function<R,Void> foreachFunc)
          Apply a function to each RDD in this DStream.
 void foreachRDD(Function2<R,Time,Void> foreachFunc)
          Apply a function to each RDD in this DStream.
 JavaDStream<java.util.List<T>> glom()
          Return a new DStream in which each RDD is generated by applying glom() to each RDD of this DStream.
<R> JavaDStream<R>
map(Function<T,R> f)
          Return a new DStream by applying a function to all elements of this DStream.
<U> JavaDStream<U>
mapPartitions(FlatMapFunction<java.util.Iterator<T>,U> f)
          Return a new DStream in which each RDD is generated by applying mapPartitions() to each RDDs of this DStream.
<K2,V2> JavaPairDStream<K2,V2>
mapPartitionsToPair(PairFlatMapFunction<java.util.Iterator<T>,K2,V2> f)
          Return a new DStream in which each RDD is generated by applying mapPartitions() to each RDDs of this DStream.
<K2,V2> JavaPairDStream<K2,V2>
mapToPair(PairFunction<T,K2,V2> f)
          Return a new DStream by applying a function to all elements of this DStream.
 void print()
          Print the first ten elements of each RDD generated in this DStream.
 void print(int num)
          Print the first num elements of each RDD generated in this DStream.
 JavaDStream<T> reduce(Function2<T,T,T> f)
          Return a new DStream in which each RDD has a single element generated by reducing each RDD of this DStream.
 DStream<T> reduceByWindow(scala.Function2<T,T,T> reduceFunc, Duration windowDuration, Duration slideDuration)
          Deprecated. As this API is not Java compatible.
 JavaDStream<T> reduceByWindow(Function2<T,T,T> reduceFunc, Duration windowDuration, Duration slideDuration)
          Return a new DStream in which each RDD has a single element generated by reducing all elements in a sliding window over this DStream.
 JavaDStream<T> reduceByWindow(Function2<T,T,T> reduceFunc, Function2<T,T,T> invReduceFunc, Duration windowDuration, Duration slideDuration)
          Return a new DStream in which each RDD has a single element generated by reducing all elements in a sliding window over this DStream.
 JavaDStream<Long> scalaIntToJavaLong(DStream<Object> in)
           
 java.util.List<R> slice(Time fromTime, Time toTime)
          Return all the RDDs between 'fromDuration' to 'toDuration' (both included)
<U> JavaDStream<U>
transform(Function<R,JavaRDD<U>> transformFunc)
          Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
<U> JavaDStream<U>
transform(Function2<R,Time,JavaRDD<U>> transformFunc)
          Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
<K2,V2> JavaPairDStream<K2,V2>
transformToPair(Function<R,JavaPairRDD<K2,V2>> transformFunc)
          Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
<K2,V2> JavaPairDStream<K2,V2>
transformToPair(Function2<R,Time,JavaPairRDD<K2,V2>> transformFunc)
          Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.
<U,W> JavaDStream<W>
transformWith(JavaDStream<U> other, Function3<R,JavaRDD<U>,Time,JavaRDD<W>> transformFunc)
          Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
<K2,V2,W> JavaDStream<W>
transformWith(JavaPairDStream<K2,V2> other, Function3<R,JavaPairRDD<K2,V2>,Time,JavaRDD<W>> transformFunc)
          Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
<U,K2,V2> JavaPairDStream<K2,V2>
transformWithToPair(JavaDStream<U> other, Function3<R,JavaRDD<U>,Time,JavaPairRDD<K2,V2>> transformFunc)
          Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
<K2,V2,K3,V3>
JavaPairDStream<K3,V3>
transformWithToPair(JavaPairDStream<K2,V2> other, Function3<R,JavaPairRDD<K2,V2>,Time,JavaPairRDD<K3,V3>> transformFunc)
          Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.
 R wrapRDD(RDD<T> in)
           
 

Method Detail

classTag

scala.reflect.ClassTag<T> classTag()

dstream

DStream<T> dstream()

wrapRDD

R wrapRDD(RDD<T> in)

scalaIntToJavaLong

JavaDStream<Long> scalaIntToJavaLong(DStream<Object> in)

print

void print()
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.


print

void print(int num)
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.

Parameters:
num - (undocumented)

count

JavaDStream<Long> count()
Return a new DStream in which each RDD has a single element generated by counting each RDD of this DStream.

Returns:
(undocumented)

countByValue

JavaPairDStream<T,Long> countByValue()
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.

Returns:
(undocumented)

countByValue

JavaPairDStream<T,Long> countByValue(int numPartitions)
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.

Parameters:
numPartitions - number of partitions of each RDD in the new DStream.
Returns:
(undocumented)

countByWindow

JavaDStream<Long> countByWindow(Duration windowDuration,
                                Duration slideDuration)
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()

Parameters:
windowDuration - (undocumented)
slideDuration - (undocumented)
Returns:
(undocumented)

countByValueAndWindow

JavaPairDStream<T,Long> countByValueAndWindow(Duration windowDuration,
                                              Duration slideDuration)
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.

Parameters:
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
Returns:
(undocumented)

countByValueAndWindow

JavaPairDStream<T,Long> countByValueAndWindow(Duration windowDuration,
                                              Duration slideDuration,
                                              int numPartitions)
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.

Parameters:
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.
Returns:
(undocumented)

glom

JavaDStream<java.util.List<T>> glom()
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.

Returns:
(undocumented)

context

StreamingContext context()
Return the StreamingContext associated with this DStream


map

<R> JavaDStream<R> map(Function<T,R> f)
Return a new DStream by applying a function to all elements of this DStream.


mapToPair

<K2,V2> JavaPairDStream<K2,V2> mapToPair(PairFunction<T,K2,V2> f)
Return a new DStream by applying a function to all elements of this DStream.


flatMap

<U> JavaDStream<U> flatMap(FlatMapFunction<T,U> f)
Return a new DStream by applying a function to all elements of this DStream, and then flattening the results

Parameters:
f - (undocumented)
Returns:
(undocumented)

flatMapToPair

<K2,V2> JavaPairDStream<K2,V2> flatMapToPair(PairFlatMapFunction<T,K2,V2> f)
Return a new DStream by applying a function to all elements of this DStream, and then flattening the results

Parameters:
f - (undocumented)
Returns:
(undocumented)

mapPartitions

<U> JavaDStream<U> mapPartitions(FlatMapFunction<java.util.Iterator<T>,U> f)
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.

Parameters:
f - (undocumented)
Returns:
(undocumented)

mapPartitionsToPair

<K2,V2> JavaPairDStream<K2,V2> mapPartitionsToPair(PairFlatMapFunction<java.util.Iterator<T>,K2,V2> f)
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.

Parameters:
f - (undocumented)
Returns:
(undocumented)

reduce

JavaDStream<T> reduce(Function2<T,T,T> f)
Return a new DStream in which each RDD has a single element generated by reducing each RDD of this DStream.

Parameters:
f - (undocumented)
Returns:
(undocumented)

reduceByWindow

DStream<T> reduceByWindow(scala.Function2<T,T,T> reduceFunc,
                          Duration windowDuration,
                          Duration slideDuration)
Deprecated. As this API is not Java compatible.

Return a new DStream in which each RDD has a single element generated by reducing all elements in a sliding window over this DStream.

Parameters:
reduceFunc - associative 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
Returns:
(undocumented)

reduceByWindow

JavaDStream<T> reduceByWindow(Function2<T,T,T> reduceFunc,
                              Duration windowDuration,
                              Duration slideDuration)
Return a new DStream in which each RDD has a single element generated by reducing all elements in a sliding window over this DStream.

Parameters:
reduceFunc - associative 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
Returns:
(undocumented)

reduceByWindow

JavaDStream<T> reduceByWindow(Function2<T,T,T> reduceFunc,
                              Function2<T,T,T> invReduceFunc,
                              Duration windowDuration,
                              Duration slideDuration)
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 : 1. 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".

Parameters:
reduceFunc - associative reduce function
invReduceFunc - inverse 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
Returns:
(undocumented)

slice

java.util.List<R> slice(Time fromTime,
                        Time toTime)
Return all the RDDs between 'fromDuration' to 'toDuration' (both included)

Parameters:
fromTime - (undocumented)
toTime - (undocumented)
Returns:
(undocumented)

foreach

void foreach(Function<R,Void> foreachFunc)
Deprecated. As of release 0.9.0, replaced by foreachRDD

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.

Parameters:
foreachFunc - (undocumented)

foreach

void foreach(Function2<R,Time,Void> foreachFunc)
Deprecated. As of release 0.9.0, replaced by foreachRDD

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.

Parameters:
foreachFunc - (undocumented)

foreachRDD

void foreachRDD(Function<R,Void> foreachFunc)
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.

Parameters:
foreachFunc - (undocumented)

foreachRDD

void foreachRDD(Function2<R,Time,Void> foreachFunc)
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.

Parameters:
foreachFunc - (undocumented)

transform

<U> JavaDStream<U> transform(Function<R,JavaRDD<U>> transformFunc)
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.

Parameters:
transformFunc - (undocumented)
Returns:
(undocumented)

transform

<U> JavaDStream<U> transform(Function2<R,Time,JavaRDD<U>> transformFunc)
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.

Parameters:
transformFunc - (undocumented)
Returns:
(undocumented)

transformToPair

<K2,V2> JavaPairDStream<K2,V2> transformToPair(Function<R,JavaPairRDD<K2,V2>> transformFunc)
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.

Parameters:
transformFunc - (undocumented)
Returns:
(undocumented)

transformToPair

<K2,V2> JavaPairDStream<K2,V2> transformToPair(Function2<R,Time,JavaPairRDD<K2,V2>> transformFunc)
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream.

Parameters:
transformFunc - (undocumented)
Returns:
(undocumented)

transformWith

<U,W> JavaDStream<W> transformWith(JavaDStream<U> other,
                                   Function3<R,JavaRDD<U>,Time,JavaRDD<W>> transformFunc)
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.

Parameters:
other - (undocumented)
transformFunc - (undocumented)
Returns:
(undocumented)

transformWithToPair

<U,K2,V2> JavaPairDStream<K2,V2> transformWithToPair(JavaDStream<U> other,
                                                     Function3<R,JavaRDD<U>,Time,JavaPairRDD<K2,V2>> transformFunc)
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.

Parameters:
other - (undocumented)
transformFunc - (undocumented)
Returns:
(undocumented)

transformWith

<K2,V2,W> JavaDStream<W> transformWith(JavaPairDStream<K2,V2> other,
                                       Function3<R,JavaPairRDD<K2,V2>,Time,JavaRDD<W>> transformFunc)
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.

Parameters:
other - (undocumented)
transformFunc - (undocumented)
Returns:
(undocumented)

transformWithToPair

<K2,V2,K3,V3> JavaPairDStream<K3,V3> transformWithToPair(JavaPairDStream<K2,V2> other,
                                                         Function3<R,JavaPairRDD<K2,V2>,Time,JavaPairRDD<K3,V3>> transformFunc)
Return a new DStream in which each RDD is generated by applying a function on each RDD of 'this' DStream and 'other' DStream.

Parameters:
other - (undocumented)
transformFunc - (undocumented)
Returns:
(undocumented)

checkpoint

DStream<T> checkpoint(Duration interval)
Enable periodic checkpointing of RDDs of this DStream.

Parameters:
interval - Time interval after which generated RDD will be checkpointed
Returns:
(undocumented)