public class JavaDStream<T>
extends Object
DStream
, the basic
abstraction in Spark Streaming that represents a continuous stream of data.
DStreams can either be created from live data (such as, data from TCP sockets, Kafka,
etc.) or it can be generated by transforming existing DStreams using operations such as map
,
window
. For operations applicable to key-value pair DStreams, see
JavaPairDStream
.Constructor and Description |
---|
JavaDStream(DStream<T> dstream,
scala.reflect.ClassTag<T> classTag) |
Modifier and Type | Method and Description |
---|---|
JavaDStream<T> |
cache()
Persist RDDs of this DStream with the default storage level (MEMORY_ONLY_SER)
|
scala.reflect.ClassTag<T> |
classTag() |
JavaRDD<T> |
compute(Time validTime)
Generate an RDD for the given duration
|
DStream<T> |
dstream() |
JavaDStream<T> |
filter(Function<T,Boolean> f)
Return a new DStream containing only the elements that satisfy a predicate.
|
static <T> JavaDStream<T> |
fromDStream(DStream<T> dstream,
scala.reflect.ClassTag<T> evidence$1)
Convert a scala
DStream to a Java-friendly
JavaDStream . |
JavaDStream<T> |
persist()
Persist RDDs of this DStream with the default storage level (MEMORY_ONLY_SER)
|
JavaDStream<T> |
persist(StorageLevel storageLevel)
Persist the RDDs of this DStream with the given storage level
|
JavaDStream<T> |
repartition(int numPartitions)
Return a new DStream with an increased or decreased level of parallelism.
|
JavaDStream<T> |
union(JavaDStream<T> that)
Return a new DStream by unifying data of another DStream with this DStream.
|
JavaDStream<T> |
window(Duration windowDuration)
Return a new DStream in which each RDD contains all the elements in seen in a
sliding window of time over this DStream.
|
JavaDStream<T> |
window(Duration windowDuration,
Duration slideDuration)
Return a new DStream in which each RDD contains all the elements in seen in a
sliding window of time over this DStream.
|
JavaRDD<T> |
wrapRDD(RDD<T> rdd) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkpoint, context, count, countByValue, countByValue, countByValueAndWindow, countByValueAndWindow, countByWindow, flatMap, flatMapToPair, foreachRDD, foreachRDD, glom, map, mapPartitions, mapPartitionsToPair, mapToPair, print, print, reduce, reduceByWindow, reduceByWindow, scalaIntToJavaLong, slice, transform, transform, transformToPair, transformToPair, transformWith, transformWith, transformWithToPair, transformWithToPair
public static <T> JavaDStream<T> fromDStream(DStream<T> dstream, scala.reflect.ClassTag<T> evidence$1)
DStream
to a Java-friendly
JavaDStream
.dstream
- (undocumented)evidence$1
- (undocumented)public scala.reflect.ClassTag<T> classTag()
public JavaDStream<T> filter(Function<T,Boolean> f)
public JavaDStream<T> cache()
public JavaDStream<T> persist()
public JavaDStream<T> persist(StorageLevel storageLevel)
public JavaDStream<T> window(Duration windowDuration)
windowDuration
- width of the window; must be a multiple of this DStream's interval.public JavaDStream<T> window(Duration windowDuration, Duration slideDuration)
windowDuration
- width of the window; must be a multiple of this DStream's
batching intervalslideDuration
- 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 intervalpublic JavaDStream<T> union(JavaDStream<T> that)
that
- Another DStream having the same interval (i.e., slideDuration) as this DStream.public JavaDStream<T> repartition(int numPartitions)
numPartitions
- (undocumented)