Github user zsxwing commented on a diff in the pull request:
https://github.com/apache/spark/pull/10224#discussion_r47154432
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/StateSpec.scala ---
@@ -91,92 +96,93 @@ sealed abstract class StateSpec[KeyType, ValueType,
StateType, EmittedType] exte
/**
* :: Experimental ::
* Builder object for creating instances of
[[org.apache.spark.streaming.StateSpec StateSpec]]
- * that is used for specifying the parameters of the DStream
transformation `trackStateByKey`
+ * that is used for specifying the parameters of the DStream
transformation `mapWithState`
* that is used for specifying the parameters of the DStream transformation
- * `trackStateByKey` operation of a
+ * `mapWithState` operation of a
* [[org.apache.spark.streaming.dstream.PairDStreamFunctions pair
DStream]] (Scala) or a
* [[org.apache.spark.streaming.api.java.JavaPairDStream JavaPairDStream]]
(Java).
*
* Example in Scala:
* {{{
- * def trackingFunction(data: Option[ValueType], wrappedState:
State[StateType]): EmittedType = {
+ * def mappingFunction(data: Option[ValueType], wrappedState:
State[StateType]): MappedType = {
* ...
* }
*
- * val emittedRecordDStream =
keyValueDStream.trackStateByKey[StateType, EmittedDataType](
- * StateSpec.function(trackingFunction).numPartitions(10))
+ * val spec = StateSpec.function(mappingFunction).numPartitions(10)
--- End diff --
I remember this line cannot be put here because the compiler cannot infer
`KeyType`.
---
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]