Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11122#discussion_r53099782
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala
 ---
    @@ -498,10 +502,36 @@ class PairDStreamFunctions[K, V](self: DStream[(K, 
V)])
           updateFunc: (Iterator[(K, Seq[V], Option[S])]) => Iterator[(K, S)],
           partitioner: Partitioner,
           rememberPartitioner: Boolean,
    -      initialRDD: RDD[(K, S)]
    -    ): DStream[(K, S)] = ssc.withScope {
    -     new StateDStream(self, ssc.sc.clean(updateFunc), partitioner,
    -       rememberPartitioner, Some(initialRDD))
    +      initialRDD: RDD[(K, S)]): DStream[(K, S)] = ssc.withScope {
    +    val cleanedFunc = ssc.sc.clean(updateFunc)
    +    val newUpdateFunc = (_: Time, it: Iterator[(K, Seq[V], Option[S])]) => 
{
    +      cleanedFunc(it)
    +    }
    +    new StateDStream(self, newUpdateFunc, partitioner,
    +      rememberPartitioner, Some(initialRDD))
    +  }
    +
    +  /**
    +    * Return a new "state" DStream where the state for each key is updated 
by applying
    +    * the given function on the previous state of the key and the new 
values of the key.
    +    * org.apache.spark.Partitioner is used to control the partitioning of 
each RDD.
    +    * @param updateFunc State update function. If `this` function returns 
None, then
    +    *                   corresponding state key-value pair will be 
eliminated.
    +    * @param partitioner Partitioner for controlling the partitioning of 
each RDD in the new
    +    *                    DStream.
    +    * @tparam S State type
    +    */
    +  def updateStateByKey[S: ClassTag]
    +  (updateFunc: (Time, K, Seq[V], Option[S]) => Option[S],
    +   partitioner: Partitioner,
    --- End diff --
    
    Please use 4 spaces indention for the parameters


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to