new DStream(jDStream)
Parameters:
Name | Type | Description |
---|---|---|
jDStream |
object |
Methods
cache() → {module:eclairjs/streaming/dstream.DStream}
Persist RDDs of this DStream with the default storage level (MEMORY_ONLY_SER)
Returns:
checkpoint(interval) → {module:eclairjs/streaming/dstream.DStream}
Enable periodic checkpointing of RDDs of this DStream.
Parameters:
Name | Type | Description |
---|---|---|
interval |
module:eclairjs/streaming.Duration |
Returns:
compute(validTime) → {module:eclairjs.RDD}
Generate an RDD for the given duration
Parameters:
Name | Type | Description |
---|---|---|
validTime |
module:eclairjs/streaming.Time |
Returns:
- Type
- module:eclairjs.RDD
context() → {module:eclairjs/streaming.StreamingContext}
Return the StreamingContext associated with this DStream
Returns:
count() → {module:eclairjs/streaming/dstream.DStream}
Return a new DStream in which each RDD has a single element generated by
counting each RDD of this DStream.
Returns:
countByValue(numPartitions) → {module:eclairjs/streaming/dstream.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 if numPartions is not
specified.
Parameters:
Name | Type | Description |
---|---|---|
numPartitions |
int |
Returns:
countByValueAndWindow(windowDuration, slideDuration, numPartitions) → {module:eclairjs/streaming/dstream.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 if
numPartitions is not specified.
Parameters:
Name | Type | Description |
---|---|---|
windowDuration |
module:eclairjs/streaming.Duration | |
slideDuration |
module:eclairjs/streaming.Duration | |
numPartitions |
int |
Returns:
countByValueAndWindow(windowDuration, slideDuration, numPartitionsopt) → {module:eclairjs/streaming/dstream.PairDStream}
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:
Name | Type | Attributes | Description |
---|---|---|---|
windowDuration |
module:eclairjs/streaming.Duration | width of the window; must be a multiple of this DStream's batching interval | |
slideDuration |
module:eclairjs/streaming.Duration | 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 |
<optional> |
number of partitions of each RDD in the new DStream. |
Returns:
countByWindow(windowDuration, slideDuration) → {module:eclairjs/streaming/dstream.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()
Parameters:
Name | Type | Description |
---|---|---|
windowDuration |
module:eclairjs/streaming.Duration | |
slideDuration |
module:eclairjs/streaming.Duration |
Returns:
filter(func, bindArgsopt) → {module:eclairjs/streaming/dstream.DStream}
Return a new DStream containing only the elements that satisfy a predicate.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
func |
function | ||
bindArgs |
Array.<Object> |
<optional> |
array whose values will be added to func's argument list. |
Returns:
flatMap(func, bindArgsopt) → {module:eclairjs/streaming/dstream.DStream}
Return a new DStream by first applying a function to all elements of this
DStream, and then flattening the results.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
func |
|||
bindArgs |
Array.<Object> |
<optional> |
array whose values will be added to func's argument list. |
Returns:
flatMapToPair(func, bindArgsopt) → {module:eclairjs/streaming/dstream.PairDStream}
Return a new DStream by applying a function to all elements of this DStream,
and then flattening the results
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
func |
|||
bindArgs |
Array.<Object> |
<optional> |
array whose values will be added to func's argument list. |
Returns:
foreachRDD(func, bindArgsopt) → {void}
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:
Name | Type | Attributes | Description |
---|---|---|---|
func |
|||
bindArgs |
Array.<Object> |
<optional> |
array whose values will be added to func's argument list. |
Returns:
- Type
- void
foreachRDDWithTime(func, bindArgsopt) → {void}
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.
The time is passed into to the function.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
func |
|||
bindArgs |
Array.<Object> |
<optional> |
array whose values will be added to func's argument list. |
Returns:
- Type
- void
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.
map(func, bindArgsopt) → {module:eclairjs/streaming/dstream.DStream}
Return a new DStream by applying a function to all elements of this DStream.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
func |
|||
bindArgs |
Array.<Object> |
<optional> |
array whose values will be added to func's argument list. |
Returns:
mapPartitions(func, bindArgsopt) → {module:eclairjs/streaming/dstream.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.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
func |
|||
bindArgs |
Array.<Object> |
<optional> |
array whose values will be added to func's argument list. |
Returns:
mapToPair(func, bindArgsopt) → {module:eclairjs/streaming/dstream.PairDStream}
Return a new DStream by applying a function to all elements of this DStream.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
func |
|||
bindArgs |
Array.<Object> |
<optional> |
array whose values will be added to func's argument list. |
Returns:
persist(levelopt) → {module:eclairjs/streaming/dstream.DStream}
Persist RDDs of this DStream with the storage level
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
level |
module:eclairjs/storage.StorageLevel |
<optional> |
(MEMORY_ONLY_SER) by default |
Returns:
print() → {void}
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.
Returns:
- Type
- void
reduce(f) → {module:eclairjs/streaming/dstream.DStream}
Return a new DStream in which each RDD has a single element generated by reducing each RDD
of this DStream.
Parameters:
Name | Type | Description |
---|---|---|
f |
func |
Returns:
reduceByWindow(reduceFunc, windowDuration, slideDuration) → {module:eclairjs/streaming/dstream.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.
Parameters:
Name | Type | Description |
---|---|---|
reduceFunc |
func | associative reduce function |
windowDuration |
module:eclairjs/streaming.Duration | width of the window; must be a multiple of this DStream's batching interval |
slideDuration |
module:eclairjs/streaming.Duration | 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:
reduceByWindowwithSlideDuration(reduceFunc, invReduceFunc, windowDuration, slideDuration) → {module:eclairjs/streaming/dstream.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 :
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:
Name | Type | Description |
---|---|---|
reduceFunc |
func | associative reduce function |
invReduceFunc |
func | inverse reduce function |
windowDuration |
module:eclairjs/streaming.Duration | width of the window; must be a multiple of this DStream's batching interval |
slideDuration |
module:eclairjs/streaming.Duration | 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:
repartition(numPartitions) → {module:eclairjs/streaming/dstream.DStream}
Return a new DStream with an increased or decreased level of parallelism.
Parameters:
Name | Type | Description |
---|---|---|
numPartitions |
int |
Returns:
transform(transformFunc) → {module:eclairjs/streaming/dstream.DStream}
Return a new DStream in which each RDD is generated by applying a function
on each RDD of 'this' DStream.
Parameters:
Name | Type | Description |
---|---|---|
transformFunc |
func |
Returns:
transformToPair(transformFunc) → {module:eclairjs/streaming/dstream.PairDStream}
Return a new DStream in which each RDD is generated by applying a function
on each RDD of 'this' DStream.
Parameters:
Name | Type | Description |
---|---|---|
transformFunc |
func |
Returns:
union(that) → {module:eclairjs/streaming/dstream.DStream}
Return a new DStream by unifying data of another DStream with this DStream.
Parameters:
Name | Type | Description |
---|---|---|
that |
module:eclairjs/streaming/dstream.DStream |
Returns:
window(duration, slideIntervalopt) → {module:eclairjs/streaming/dstream.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.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
duration |
width of the window; must be a multiple of this DStream's interval. | ||
slideInterval |
<optional> |