Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ class PairDStreamFunctions[K, V](self: DStream[(K, V)])
new HashPartitioner(numPartitions)
}

/**
* Return a DStream with the keys of each tuple.
*/
def keys: DStream[K] = self.map(_._1)

/**
* Return a DStream with the values of each tuple.
*/
def values: DStream[V] = self.map(_._2)

/**
* Return a new DStream by applying `groupByKey` to each RDD. Hash partitioning is used to
* generate the RDDs with Spark's default number of partitions.
Expand Down