public class PairDStreamFunctions<K,V>
extends Object
implements scala.Serializable
| Constructor and Description | 
|---|
| PairDStreamFunctions(DStream<scala.Tuple2<K,V>> self,
                    scala.reflect.ClassTag<K> kt,
                    scala.reflect.ClassTag<V> vt,
                    scala.math.Ordering<K> ord) | 
| Modifier and Type | Method and Description | 
|---|---|
| <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.collection.Iterable<V>,scala.collection.Iterable<W>>>> | cogroup(DStream<scala.Tuple2<K,W>> other,
       scala.reflect.ClassTag<W> evidence$13)Return a new DStream by applying 'cogroup' between RDDs of  thisDStream andotherDStream. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.collection.Iterable<V>,scala.collection.Iterable<W>>>> | cogroup(DStream<scala.Tuple2<K,W>> other,
       int numPartitions,
       scala.reflect.ClassTag<W> evidence$14)Return a new DStream by applying 'cogroup' between RDDs of  thisDStream andotherDStream. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.collection.Iterable<V>,scala.collection.Iterable<W>>>> | cogroup(DStream<scala.Tuple2<K,W>> other,
       Partitioner partitioner,
       scala.reflect.ClassTag<W> evidence$15)Return a new DStream by applying 'cogroup' between RDDs of  thisDStream andotherDStream. | 
| <C> DStream<scala.Tuple2<K,C>> | combineByKey(scala.Function1<V,C> createCombiner,
            scala.Function2<C,V,C> mergeValue,
            scala.Function2<C,C,C> mergeCombiner,
            Partitioner partitioner,
            boolean mapSideCombine,
            scala.reflect.ClassTag<C> evidence$1)Combine elements of each key in DStream's RDDs using custom functions. | 
| <U> DStream<scala.Tuple2<K,U>> | flatMapValues(scala.Function1<V,scala.collection.TraversableOnce<U>> flatMapValuesFunc,
             scala.reflect.ClassTag<U> evidence$12)Return a new DStream by applying a flatmap function to the value of each key-value pairs in
 'this' DStream without changing the key. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.Option<V>,scala.Option<W>>>> | fullOuterJoin(DStream<scala.Tuple2<K,W>> other,
             scala.reflect.ClassTag<W> evidence$25)Return a new DStream by applying 'full outer join' between RDDs of  thisDStream andotherDStream. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.Option<V>,scala.Option<W>>>> | fullOuterJoin(DStream<scala.Tuple2<K,W>> other,
             int numPartitions,
             scala.reflect.ClassTag<W> evidence$26)Return a new DStream by applying 'full outer join' between RDDs of  thisDStream andotherDStream. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.Option<V>,scala.Option<W>>>> | fullOuterJoin(DStream<scala.Tuple2<K,W>> other,
             Partitioner partitioner,
             scala.reflect.ClassTag<W> evidence$27)Return a new DStream by applying 'full outer join' between RDDs of  thisDStream andotherDStream. | 
| DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> | groupByKey()Return a new DStream by applying  groupByKeyto each RDD. | 
| DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> | groupByKey(int numPartitions)Return a new DStream by applying  groupByKeyto each RDD. | 
| DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> | groupByKey(Partitioner partitioner)Return a new DStream by applying  groupByKeyon each RDD. | 
| DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> | groupByKeyAndWindow(Duration windowDuration)Return a new DStream by applying  groupByKeyover a sliding window. | 
| DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> | groupByKeyAndWindow(Duration windowDuration,
                   Duration slideDuration)Return a new DStream by applying  groupByKeyover a sliding window. | 
| DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> | groupByKeyAndWindow(Duration windowDuration,
                   Duration slideDuration,
                   int numPartitions)Return a new DStream by applying  groupByKeyover a sliding window onthisDStream. | 
| DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> | groupByKeyAndWindow(Duration windowDuration,
                   Duration slideDuration,
                   Partitioner partitioner)Create a new DStream by applying  groupByKeyover a sliding window onthisDStream. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<V,W>>> | join(DStream<scala.Tuple2<K,W>> other,
    scala.reflect.ClassTag<W> evidence$16)Return a new DStream by applying 'join' between RDDs of  thisDStream andotherDStream. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<V,W>>> | join(DStream<scala.Tuple2<K,W>> other,
    int numPartitions,
    scala.reflect.ClassTag<W> evidence$17)Return a new DStream by applying 'join' between RDDs of  thisDStream andotherDStream. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<V,W>>> | join(DStream<scala.Tuple2<K,W>> other,
    Partitioner partitioner,
    scala.reflect.ClassTag<W> evidence$18)Return a new DStream by applying 'join' between RDDs of  thisDStream andotherDStream. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<V,scala.Option<W>>>> | leftOuterJoin(DStream<scala.Tuple2<K,W>> other,
             scala.reflect.ClassTag<W> evidence$19)Return a new DStream by applying 'left outer join' between RDDs of  thisDStream andotherDStream. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<V,scala.Option<W>>>> | leftOuterJoin(DStream<scala.Tuple2<K,W>> other,
             int numPartitions,
             scala.reflect.ClassTag<W> evidence$20)Return a new DStream by applying 'left outer join' between RDDs of  thisDStream andotherDStream. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<V,scala.Option<W>>>> | leftOuterJoin(DStream<scala.Tuple2<K,W>> other,
             Partitioner partitioner,
             scala.reflect.ClassTag<W> evidence$21)Return a new DStream by applying 'left outer join' between RDDs of  thisDStream andotherDStream. | 
| <U> DStream<scala.Tuple2<K,U>> | mapValues(scala.Function1<V,U> mapValuesFunc,
         scala.reflect.ClassTag<U> evidence$11)Return a new DStream by applying a map function to the value of each key-value pairs in
 'this' DStream without changing the key. | 
| <StateType,MappedType> | mapWithState(StateSpec<K,V,StateType,MappedType> spec,
            scala.reflect.ClassTag<StateType> evidence$2,
            scala.reflect.ClassTag<MappedType> evidence$3)Return a  MapWithStateDStreamby applying a function to every key-value element ofthisstream, while maintaining some state data for each unique key. | 
| DStream<scala.Tuple2<K,V>> | reduceByKey(scala.Function2<V,V,V> reduceFunc)Return a new DStream by applying  reduceByKeyto each RDD. | 
| DStream<scala.Tuple2<K,V>> | reduceByKey(scala.Function2<V,V,V> reduceFunc,
           int numPartitions)Return a new DStream by applying  reduceByKeyto each RDD. | 
| DStream<scala.Tuple2<K,V>> | reduceByKey(scala.Function2<V,V,V> reduceFunc,
           Partitioner partitioner)Return a new DStream by applying  reduceByKeyto each RDD. | 
| DStream<scala.Tuple2<K,V>> | reduceByKeyAndWindow(scala.Function2<V,V,V> reduceFunc,
                    Duration windowDuration)Return a new DStream by applying  reduceByKeyover a sliding window onthisDStream. | 
| DStream<scala.Tuple2<K,V>> | reduceByKeyAndWindow(scala.Function2<V,V,V> reduceFunc,
                    Duration windowDuration,
                    Duration slideDuration)Return a new DStream by applying  reduceByKeyover a sliding window. | 
| DStream<scala.Tuple2<K,V>> | reduceByKeyAndWindow(scala.Function2<V,V,V> reduceFunc,
                    Duration windowDuration,
                    Duration slideDuration,
                    int numPartitions)Return a new DStream by applying  reduceByKeyover a sliding window. | 
| DStream<scala.Tuple2<K,V>> | reduceByKeyAndWindow(scala.Function2<V,V,V> reduceFunc,
                    Duration windowDuration,
                    Duration slideDuration,
                    Partitioner partitioner)Return a new DStream by applying  reduceByKeyover a sliding window. | 
| DStream<scala.Tuple2<K,V>> | reduceByKeyAndWindow(scala.Function2<V,V,V> reduceFunc,
                    scala.Function2<V,V,V> invReduceFunc,
                    Duration windowDuration,
                    Duration slideDuration,
                    int numPartitions,
                    scala.Function1<scala.Tuple2<K,V>,Object> filterFunc)Return a new DStream by applying incremental  reduceByKeyover a sliding window. | 
| DStream<scala.Tuple2<K,V>> | reduceByKeyAndWindow(scala.Function2<V,V,V> reduceFunc,
                    scala.Function2<V,V,V> invReduceFunc,
                    Duration windowDuration,
                    Duration slideDuration,
                    Partitioner partitioner,
                    scala.Function1<scala.Tuple2<K,V>,Object> filterFunc)Return a new DStream by applying incremental  reduceByKeyover a sliding window. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.Option<V>,W>>> | rightOuterJoin(DStream<scala.Tuple2<K,W>> other,
              scala.reflect.ClassTag<W> evidence$22)Return a new DStream by applying 'right outer join' between RDDs of  thisDStream andotherDStream. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.Option<V>,W>>> | rightOuterJoin(DStream<scala.Tuple2<K,W>> other,
              int numPartitions,
              scala.reflect.ClassTag<W> evidence$23)Return a new DStream by applying 'right outer join' between RDDs of  thisDStream andotherDStream. | 
| <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.Option<V>,W>>> | rightOuterJoin(DStream<scala.Tuple2<K,W>> other,
              Partitioner partitioner,
              scala.reflect.ClassTag<W> evidence$24)Return a new DStream by applying 'right outer join' between RDDs of  thisDStream andotherDStream. | 
| void | saveAsHadoopFiles(String prefix,
                 String suffix,
                 Class<?> keyClass,
                 Class<?> valueClass,
                 Class<? extends org.apache.hadoop.mapred.OutputFormat<?,?>> outputFormatClass,
                 org.apache.hadoop.mapred.JobConf conf)Save each RDD in  thisDStream as a Hadoop file. | 
| <F extends org.apache.hadoop.mapred.OutputFormat<K,V>> | saveAsHadoopFiles(String prefix,
                 String suffix,
                 scala.reflect.ClassTag<F> fm)Save each RDD in  thisDStream as a Hadoop file. | 
| void | saveAsNewAPIHadoopFiles(String prefix,
                       String suffix,
                       Class<?> keyClass,
                       Class<?> valueClass,
                       Class<? extends org.apache.hadoop.mapreduce.OutputFormat<?,?>> outputFormatClass,
                       org.apache.hadoop.conf.Configuration conf)Save each RDD in  thisDStream as a Hadoop file. | 
| <F extends org.apache.hadoop.mapreduce.OutputFormat<K,V>> | saveAsNewAPIHadoopFiles(String prefix,
                       String suffix,
                       scala.reflect.ClassTag<F> fm)Save each RDD in  thisDStream as a Hadoop file. | 
| <S> DStream<scala.Tuple2<K,S>> | updateStateByKey(scala.Function1<scala.collection.Iterator<scala.Tuple3<K,scala.collection.Seq<V>,scala.Option<S>>>,scala.collection.Iterator<scala.Tuple2<K,S>>> updateFunc,
                Partitioner partitioner,
                boolean rememberPartitioner,
                scala.reflect.ClassTag<S> evidence$7)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 each key. | 
| <S> DStream<scala.Tuple2<K,S>> | updateStateByKey(scala.Function1<scala.collection.Iterator<scala.Tuple3<K,scala.collection.Seq<V>,scala.Option<S>>>,scala.collection.Iterator<scala.Tuple2<K,S>>> updateFunc,
                Partitioner partitioner,
                boolean rememberPartitioner,
                RDD<scala.Tuple2<K,S>> initialRDD,
                scala.reflect.ClassTag<S> evidence$9)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 each key. | 
| <S> DStream<scala.Tuple2<K,S>> | updateStateByKey(scala.Function2<scala.collection.Seq<V>,scala.Option<S>,scala.Option<S>> updateFunc,
                scala.reflect.ClassTag<S> evidence$4)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 each key. | 
| <S> DStream<scala.Tuple2<K,S>> | updateStateByKey(scala.Function2<scala.collection.Seq<V>,scala.Option<S>,scala.Option<S>> updateFunc,
                int numPartitions,
                scala.reflect.ClassTag<S> evidence$5)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 each key. | 
| <S> DStream<scala.Tuple2<K,S>> | updateStateByKey(scala.Function2<scala.collection.Seq<V>,scala.Option<S>,scala.Option<S>> updateFunc,
                Partitioner partitioner,
                scala.reflect.ClassTag<S> evidence$6)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. | 
| <S> DStream<scala.Tuple2<K,S>> | updateStateByKey(scala.Function2<scala.collection.Seq<V>,scala.Option<S>,scala.Option<S>> updateFunc,
                Partitioner partitioner,
                RDD<scala.Tuple2<K,S>> initialRDD,
                scala.reflect.ClassTag<S> evidence$8)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. | 
| <S> DStream<scala.Tuple2<K,S>> | updateStateByKey(scala.Function4<Time,K,scala.collection.Seq<V>,scala.Option<S>,scala.Option<S>> updateFunc,
                Partitioner partitioner,
                boolean rememberPartitioner,
                scala.Option<RDD<scala.Tuple2<K,S>>> initialRDD,
                scala.reflect.ClassTag<S> evidence$10)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. | 
public <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.collection.Iterable<V>,scala.collection.Iterable<W>>>> cogroup(DStream<scala.Tuple2<K,W>> other, scala.reflect.ClassTag<W> evidence$13)
this DStream and other DStream.
 Hash partitioning is used to generate the RDDs with Spark's default number
 of partitions.other - (undocumented)evidence$13 - (undocumented)public <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.collection.Iterable<V>,scala.collection.Iterable<W>>>> cogroup(DStream<scala.Tuple2<K,W>> other, int numPartitions, scala.reflect.ClassTag<W> evidence$14)
this DStream and other DStream.
 Hash partitioning is used to generate the RDDs with numPartitions partitions.other - (undocumented)numPartitions - (undocumented)evidence$14 - (undocumented)public <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.collection.Iterable<V>,scala.collection.Iterable<W>>>> cogroup(DStream<scala.Tuple2<K,W>> other, Partitioner partitioner, scala.reflect.ClassTag<W> evidence$15)
this DStream and other DStream.
 The supplied org.apache.spark.Partitioner is used to partition the generated RDDs.other - (undocumented)partitioner - (undocumented)evidence$15 - (undocumented)public <C> DStream<scala.Tuple2<K,C>> combineByKey(scala.Function1<V,C> createCombiner, scala.Function2<C,V,C> mergeValue, scala.Function2<C,C,C> mergeCombiner, Partitioner partitioner, boolean mapSideCombine, scala.reflect.ClassTag<C> evidence$1)
createCombiner - (undocumented)mergeValue - (undocumented)mergeCombiner - (undocumented)partitioner - (undocumented)mapSideCombine - (undocumented)evidence$1 - (undocumented)public <U> DStream<scala.Tuple2<K,U>> flatMapValues(scala.Function1<V,scala.collection.TraversableOnce<U>> flatMapValuesFunc, scala.reflect.ClassTag<U> evidence$12)
flatMapValuesFunc - (undocumented)evidence$12 - (undocumented)public <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.Option<V>,scala.Option<W>>>> fullOuterJoin(DStream<scala.Tuple2<K,W>> other, scala.reflect.ClassTag<W> evidence$25)
this DStream and
 other DStream. Hash partitioning is used to generate the RDDs with Spark's default
 number of partitions.other - (undocumented)evidence$25 - (undocumented)public <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.Option<V>,scala.Option<W>>>> fullOuterJoin(DStream<scala.Tuple2<K,W>> other, int numPartitions, scala.reflect.ClassTag<W> evidence$26)
this DStream and
 other DStream. Hash partitioning is used to generate the RDDs with numPartitions
 partitions.other - (undocumented)numPartitions - (undocumented)evidence$26 - (undocumented)public <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.Option<V>,scala.Option<W>>>> fullOuterJoin(DStream<scala.Tuple2<K,W>> other, Partitioner partitioner, scala.reflect.ClassTag<W> evidence$27)
this DStream and
 other DStream. The supplied org.apache.spark.Partitioner is used to control
 the partitioning of each RDD.other - (undocumented)partitioner - (undocumented)evidence$27 - (undocumented)public DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> groupByKey()
groupByKey to each RDD. Hash partitioning is used to
 generate the RDDs with Spark's default number of partitions.public DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> groupByKey(int numPartitions)
groupByKey to each RDD. Hash partitioning is used to
 generate the RDDs with numPartitions partitions.numPartitions - (undocumented)public DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> groupByKey(Partitioner partitioner)
groupByKey on each RDD. The supplied
 org.apache.spark.Partitioner is used to control the partitioning of each RDD.partitioner - (undocumented)public DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> groupByKeyAndWindow(Duration windowDuration)
groupByKey over a sliding window. This is similar to
 DStream.groupByKey() but applies it over a sliding window. The new DStream generates RDDs
 with the same interval as this DStream. Hash partitioning is used to generate the RDDs with
 Spark's default number of partitions.windowDuration - width of the window; must be a multiple of this DStream's
                       batching intervalpublic DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> groupByKeyAndWindow(Duration windowDuration, Duration slideDuration)
groupByKey over a sliding window. Similar to
 DStream.groupByKey(), but applies it over a sliding window. Hash partitioning is used to
 generate the RDDs with Spark's default number of partitions.windowDuration - width of the window; must be a multiple of this DStream's
                       batching intervalslideDuration - 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 intervalpublic DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> groupByKeyAndWindow(Duration windowDuration, Duration slideDuration, int numPartitions)
groupByKey over a sliding window on this DStream.
 Similar to DStream.groupByKey(), but applies it over a sliding window.
 Hash partitioning is used to generate the RDDs with numPartitions partitions.windowDuration - width of the window; must be a multiple of this DStream's
                       batching intervalslideDuration - 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 intervalnumPartitions - number of partitions of each RDD in the new DStream; if not specified
                       then Spark's default number of partitions will be usedpublic DStream<scala.Tuple2<K,scala.collection.Iterable<V>>> groupByKeyAndWindow(Duration windowDuration, Duration slideDuration, Partitioner partitioner)
groupByKey over a sliding window on this DStream.
 Similar to DStream.groupByKey(), but applies it over a sliding window.windowDuration - width of the window; must be a multiple of this DStream's
                       batching intervalslideDuration - 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 intervalpartitioner - partitioner for controlling the partitioning of each RDD in the new
                       DStream.public <W> DStream<scala.Tuple2<K,scala.Tuple2<V,W>>> join(DStream<scala.Tuple2<K,W>> other, scala.reflect.ClassTag<W> evidence$16)
this DStream and other DStream.
 Hash partitioning is used to generate the RDDs with Spark's default number of partitions.other - (undocumented)evidence$16 - (undocumented)public <W> DStream<scala.Tuple2<K,scala.Tuple2<V,W>>> join(DStream<scala.Tuple2<K,W>> other, int numPartitions, scala.reflect.ClassTag<W> evidence$17)
this DStream and other DStream.
 Hash partitioning is used to generate the RDDs with numPartitions partitions.other - (undocumented)numPartitions - (undocumented)evidence$17 - (undocumented)public <W> DStream<scala.Tuple2<K,scala.Tuple2<V,W>>> join(DStream<scala.Tuple2<K,W>> other, Partitioner partitioner, scala.reflect.ClassTag<W> evidence$18)
this DStream and other DStream.
 The supplied org.apache.spark.Partitioner is used to control the partitioning of each RDD.other - (undocumented)partitioner - (undocumented)evidence$18 - (undocumented)public <W> DStream<scala.Tuple2<K,scala.Tuple2<V,scala.Option<W>>>> leftOuterJoin(DStream<scala.Tuple2<K,W>> other, scala.reflect.ClassTag<W> evidence$19)
this DStream and
 other DStream. Hash partitioning is used to generate the RDDs with Spark's default
 number of partitions.other - (undocumented)evidence$19 - (undocumented)public <W> DStream<scala.Tuple2<K,scala.Tuple2<V,scala.Option<W>>>> leftOuterJoin(DStream<scala.Tuple2<K,W>> other, int numPartitions, scala.reflect.ClassTag<W> evidence$20)
this DStream and
 other DStream. Hash partitioning is used to generate the RDDs with numPartitions
 partitions.other - (undocumented)numPartitions - (undocumented)evidence$20 - (undocumented)public <W> DStream<scala.Tuple2<K,scala.Tuple2<V,scala.Option<W>>>> leftOuterJoin(DStream<scala.Tuple2<K,W>> other, Partitioner partitioner, scala.reflect.ClassTag<W> evidence$21)
this DStream and
 other DStream. The supplied org.apache.spark.Partitioner is used to control
 the partitioning of each RDD.other - (undocumented)partitioner - (undocumented)evidence$21 - (undocumented)public <U> DStream<scala.Tuple2<K,U>> mapValues(scala.Function1<V,U> mapValuesFunc, scala.reflect.ClassTag<U> evidence$11)
mapValuesFunc - (undocumented)evidence$11 - (undocumented)public <StateType,MappedType> MapWithStateDStream<K,V,StateType,MappedType> mapWithState(StateSpec<K,V,StateType,MappedType> spec, scala.reflect.ClassTag<StateType> evidence$2, scala.reflect.ClassTag<MappedType> evidence$3)
MapWithStateDStream by applying a function to every key-value element of
 this stream, while maintaining some state data for each unique key. The mapping function
 and other specification (e.g. partitioners, timeouts, initial state data, etc.) of this
 transformation can be specified using StateSpec class. The state data is accessible in
 as a parameter of type State in the mapping function.
 
 Example of using mapWithState:
 
    // A mapping function that maintains an integer state and return a String
    def mappingFunction(key: String, value: Option[Int], state: State[Int]): Option[String] = {
      // Use state.exists(), state.get(), state.update() and state.remove()
      // to manage state, and return the necessary string
    }
    val spec = StateSpec.function(mappingFunction).numPartitions(10)
    val mapWithStateDStream = keyValueDStream.mapWithState[StateType, MappedType](spec)
 spec - Specification of this transformationevidence$2 - (undocumented)evidence$3 - (undocumented)public DStream<scala.Tuple2<K,V>> reduceByKey(scala.Function2<V,V,V> reduceFunc)
reduceByKey to each RDD. The values for each key are
 merged using the associative and commutative reduce function. Hash partitioning is used to
 generate the RDDs with Spark's default number of partitions.reduceFunc - (undocumented)public DStream<scala.Tuple2<K,V>> reduceByKey(scala.Function2<V,V,V> reduceFunc, int numPartitions)
reduceByKey to each RDD. The values for each key are
 merged using the supplied reduce function. Hash partitioning is used to generate the RDDs
 with numPartitions partitions.reduceFunc - (undocumented)numPartitions - (undocumented)public DStream<scala.Tuple2<K,V>> reduceByKey(scala.Function2<V,V,V> reduceFunc, Partitioner partitioner)
reduceByKey to each RDD. The values for each key are
 merged using the supplied reduce function. org.apache.spark.Partitioner is used to control
 the partitioning of each RDD.reduceFunc - (undocumented)partitioner - (undocumented)public DStream<scala.Tuple2<K,V>> reduceByKeyAndWindow(scala.Function2<V,V,V> reduceFunc, Duration windowDuration)
reduceByKey over a sliding window on this DStream.
 Similar to DStream.reduceByKey(), but applies it over a sliding window. The new DStream
 generates RDDs with the same interval as this DStream. Hash partitioning is used to generate
 the RDDs with Spark's default number of partitions.reduceFunc - associative and commutative reduce functionwindowDuration - width of the window; must be a multiple of this DStream's
                       batching intervalpublic DStream<scala.Tuple2<K,V>> reduceByKeyAndWindow(scala.Function2<V,V,V> reduceFunc, Duration windowDuration, Duration slideDuration)
reduceByKey over a sliding window. This is similar to
 DStream.reduceByKey() but applies it over a sliding window. Hash partitioning is used to
 generate the RDDs with Spark's default number of partitions.reduceFunc - associative and commutative reduce functionwindowDuration - width of the window; must be a multiple of this DStream's
                       batching intervalslideDuration - 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 intervalpublic DStream<scala.Tuple2<K,V>> reduceByKeyAndWindow(scala.Function2<V,V,V> reduceFunc, Duration windowDuration, Duration slideDuration, int numPartitions)
reduceByKey over a sliding window. This is similar to
 DStream.reduceByKey() but applies it over a sliding window. Hash partitioning is used to
 generate the RDDs with numPartitions partitions.reduceFunc - associative and commutative reduce functionwindowDuration - width of the window; must be a multiple of this DStream's
                       batching intervalslideDuration - 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 intervalnumPartitions - number of partitions of each RDD in the new DStream.public DStream<scala.Tuple2<K,V>> reduceByKeyAndWindow(scala.Function2<V,V,V> reduceFunc, Duration windowDuration, Duration slideDuration, Partitioner partitioner)
reduceByKey over a sliding window. Similar to
 DStream.reduceByKey(), but applies it over a sliding window.reduceFunc - associative and commutative reduce functionwindowDuration - width of the window; must be a multiple of this DStream's
                       batching intervalslideDuration - 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 intervalpartitioner - partitioner for controlling the partitioning of each RDD
                       in the new DStream.public DStream<scala.Tuple2<K,V>> reduceByKeyAndWindow(scala.Function2<V,V,V> reduceFunc, scala.Function2<V,V,V> invReduceFunc, Duration windowDuration, Duration slideDuration, int numPartitions, scala.Function1<scala.Tuple2<K,V>,Object> filterFunc)
reduceByKey over a sliding window.
 The reduced value of over a new window is calculated 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 reduceByKeyAndWindow without "inverse reduce" function. However, it is applicable to only "invertible reduce functions". Hash partitioning is used to generate the RDDs with Spark's default number of partitions.
reduceFunc - associative and commutative reduce functioninvReduceFunc - inverse reduce function; such that for all y, invertible x:
                      invReduceFunc(reduceFunc(x, y), x) = ywindowDuration - width of the window; must be a multiple of this DStream's
                       batching intervalslideDuration - 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 intervalfilterFunc - Optional function to filter expired key-value pairs;
                       only pairs that satisfy the function are retainednumPartitions - (undocumented)public DStream<scala.Tuple2<K,V>> reduceByKeyAndWindow(scala.Function2<V,V,V> reduceFunc, scala.Function2<V,V,V> invReduceFunc, Duration windowDuration, Duration slideDuration, Partitioner partitioner, scala.Function1<scala.Tuple2<K,V>,Object> filterFunc)
reduceByKey over a sliding window.
 The reduced value of over a new window is calculated 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 reduceByKeyAndWindow without "inverse reduce" function.
 However, it is applicable to only "invertible reduce functions".reduceFunc - associative and commutative reduce functioninvReduceFunc - inverse reduce functionwindowDuration - width of the window; must be a multiple of this DStream's
                       batching intervalslideDuration - 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 intervalpartitioner - partitioner for controlling the partitioning of each RDD in the new
                       DStream.filterFunc - Optional function to filter expired key-value pairs;
                       only pairs that satisfy the function are retainedpublic <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.Option<V>,W>>> rightOuterJoin(DStream<scala.Tuple2<K,W>> other, scala.reflect.ClassTag<W> evidence$22)
this DStream and
 other DStream. Hash partitioning is used to generate the RDDs with Spark's default
 number of partitions.other - (undocumented)evidence$22 - (undocumented)public <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.Option<V>,W>>> rightOuterJoin(DStream<scala.Tuple2<K,W>> other, int numPartitions, scala.reflect.ClassTag<W> evidence$23)
this DStream and
 other DStream. Hash partitioning is used to generate the RDDs with numPartitions
 partitions.other - (undocumented)numPartitions - (undocumented)evidence$23 - (undocumented)public <W> DStream<scala.Tuple2<K,scala.Tuple2<scala.Option<V>,W>>> rightOuterJoin(DStream<scala.Tuple2<K,W>> other, Partitioner partitioner, scala.reflect.ClassTag<W> evidence$24)
this DStream and
 other DStream. The supplied org.apache.spark.Partitioner is used to control
 the partitioning of each RDD.other - (undocumented)partitioner - (undocumented)evidence$24 - (undocumented)public <F extends org.apache.hadoop.mapred.OutputFormat<K,V>> void saveAsHadoopFiles(String prefix, String suffix, scala.reflect.ClassTag<F> fm)
this DStream as a Hadoop file. The file name at each batch interval
 is generated based on prefix and suffix: "prefix-TIME_IN_MS.suffix"prefix - (undocumented)suffix - (undocumented)fm - (undocumented)public void saveAsHadoopFiles(String prefix,
                              String suffix,
                              Class<?> keyClass,
                              Class<?> valueClass,
                              Class<? extends org.apache.hadoop.mapred.OutputFormat<?,?>> outputFormatClass,
                              org.apache.hadoop.mapred.JobConf conf)
this DStream as a Hadoop file. The file name at each batch interval
 is generated based on prefix and suffix: "prefix-TIME_IN_MS.suffix"prefix - (undocumented)suffix - (undocumented)keyClass - (undocumented)valueClass - (undocumented)outputFormatClass - (undocumented)conf - (undocumented)public <F extends org.apache.hadoop.mapreduce.OutputFormat<K,V>> void saveAsNewAPIHadoopFiles(String prefix, String suffix, scala.reflect.ClassTag<F> fm)
this DStream as a Hadoop file. The file name at each batch interval is
 generated based on prefix and suffix: "prefix-TIME_IN_MS.suffix".prefix - (undocumented)suffix - (undocumented)fm - (undocumented)public void saveAsNewAPIHadoopFiles(String prefix,
                                    String suffix,
                                    Class<?> keyClass,
                                    Class<?> valueClass,
                                    Class<? extends org.apache.hadoop.mapreduce.OutputFormat<?,?>> outputFormatClass,
                                    org.apache.hadoop.conf.Configuration conf)
this DStream as a Hadoop file. The file name at each batch interval is
 generated based on prefix and suffix: "prefix-TIME_IN_MS.suffix".prefix - (undocumented)suffix - (undocumented)keyClass - (undocumented)valueClass - (undocumented)outputFormatClass - (undocumented)conf - (undocumented)public <S> DStream<scala.Tuple2<K,S>> updateStateByKey(scala.Function2<scala.collection.Seq<V>,scala.Option<S>,scala.Option<S>> updateFunc, scala.reflect.ClassTag<S> evidence$4)
updateFunc - State update function. If this function returns None, then
                   corresponding state key-value pair will be eliminated.evidence$4 - (undocumented)public <S> DStream<scala.Tuple2<K,S>> updateStateByKey(scala.Function2<scala.collection.Seq<V>,scala.Option<S>,scala.Option<S>> updateFunc, int numPartitions, scala.reflect.ClassTag<S> evidence$5)
numPartitions partitions.updateFunc - State update function. If this function returns None, then
                   corresponding state key-value pair will be eliminated.numPartitions - Number of partitions of each RDD in the new DStream.evidence$5 - (undocumented)public <S> DStream<scala.Tuple2<K,S>> updateStateByKey(scala.Function2<scala.collection.Seq<V>,scala.Option<S>,scala.Option<S>> updateFunc, Partitioner partitioner, scala.reflect.ClassTag<S> evidence$6)
Partitioner is used to control the partitioning of each RDD.updateFunc - State update function. If this function returns None, then
                   corresponding state key-value pair will be eliminated.partitioner - Partitioner for controlling the partitioning of each RDD in the new
                    DStream.evidence$6 - (undocumented)public <S> DStream<scala.Tuple2<K,S>> updateStateByKey(scala.Function1<scala.collection.Iterator<scala.Tuple3<K,scala.collection.Seq<V>,scala.Option<S>>>,scala.collection.Iterator<scala.Tuple2<K,S>>> updateFunc, Partitioner partitioner, boolean rememberPartitioner, scala.reflect.ClassTag<S> evidence$7)
Partitioner is used to control the partitioning of each RDD.updateFunc - State update function. Note, that this function may generate a different
                   tuple with a different key than the input key. Therefore keys may be removed
                   or added in this way. It is up to the developer to decide whether to
                   remember the partitioner despite the key being changed.partitioner - Partitioner for controlling the partitioning of each RDD in the new
                    DStreamrememberPartitioner - Whether to remember the partitioner object in the generated RDDs.evidence$7 - (undocumented)public <S> DStream<scala.Tuple2<K,S>> updateStateByKey(scala.Function2<scala.collection.Seq<V>,scala.Option<S>,scala.Option<S>> updateFunc, Partitioner partitioner, RDD<scala.Tuple2<K,S>> initialRDD, scala.reflect.ClassTag<S> evidence$8)
updateFunc - State update function. If this function returns None, then
                   corresponding state key-value pair will be eliminated.partitioner - Partitioner for controlling the partitioning of each RDD in the new
                    DStream.initialRDD - initial state value of each key.evidence$8 - (undocumented)public <S> DStream<scala.Tuple2<K,S>> updateStateByKey(scala.Function1<scala.collection.Iterator<scala.Tuple3<K,scala.collection.Seq<V>,scala.Option<S>>>,scala.collection.Iterator<scala.Tuple2<K,S>>> updateFunc, Partitioner partitioner, boolean rememberPartitioner, RDD<scala.Tuple2<K,S>> initialRDD, scala.reflect.ClassTag<S> evidence$9)
updateFunc - State update function. Note, that this function may generate a different
                   tuple with a different key than the input key. Therefore keys may be removed
                   or added in this way. It is up to the developer to decide whether to
                   remember the  partitioner despite the key being changed.partitioner - Partitioner for controlling the partitioning of each RDD in the new
                    DStreamrememberPartitioner - Whether to remember the partitioner object in the generated RDDs.initialRDD - initial state value of each key.evidence$9 - (undocumented)public <S> DStream<scala.Tuple2<K,S>> updateStateByKey(scala.Function4<Time,K,scala.collection.Seq<V>,scala.Option<S>,scala.Option<S>> updateFunc, Partitioner partitioner, boolean rememberPartitioner, scala.Option<RDD<scala.Tuple2<K,S>>> initialRDD, scala.reflect.ClassTag<S> evidence$10)
updateFunc - State update function. If this function returns None, then
                   corresponding state key-value pair will be eliminated.partitioner - Partitioner for controlling the partitioning of each RDD in the new
                    DStream.rememberPartitioner - (undocumented)initialRDD - (undocumented)evidence$10 - (undocumented)