Set the RDD containing the initial states that will be used by mapWithState
Set the RDD containing the initial states that will be used by mapWithState
Set the number of partitions by which the state RDDs generated by mapWithState
will be partitioned.
Set the number of partitions by which the state RDDs generated by mapWithState
will be partitioned. Hash partitioning will be used.
Set the partitioner by which the state RDDs generated by mapWithState
will be partitioned.
Set the duration after which the state of an idle key will be removed.
Set the duration after which the state of an idle key will be removed. A key and its state is
considered idle if it has not received any data for at least the given duration. The
mapping function will be called one final time on the idle states that are going to be
removed; State.isTimingOut() set
to true
in that call.
:: Experimental :: Abstract class representing all the specifications of the DStream transformation
mapWithState
operation of a pair DStream (Scala) or a JavaPairDStream (Java). Useorg.apache.spark.streaming.StateSpec.function()
factory methods to create instances of this class.Example in Scala:
Example in Java:
Class of the state key
Class of the state value
Class of the state data
Class of the mapped elements