[ 
https://issues.apache.org/jira/browse/FLINK-2405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14642514#comment-14642514
 ] 

ASF GitHub Bot commented on FLINK-2405:
---------------------------------------

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

    https://github.com/apache/flink/pull/936#discussion_r35520346
  
    --- Diff: 
flink-staging/flink-streaming/flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/function/StatefulFunction.scala
 ---
    @@ -0,0 +1,42 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.flink.streaming.api.scala.function
    +
    +import org.apache.flink.api.common.functions.RichFunction
    +import org.apache.flink.configuration.Configuration
    +import org.apache.flink.api.common.state.OperatorState
    +
    +trait StatefulFunction[I, O, S] extends RichFunction {
    --- End diff --
    
    Scala docs are missing here.


> Add stateful transformations using lambdas to the Streaming Scala API
> ---------------------------------------------------------------------
>
>                 Key: FLINK-2405
>                 URL: https://issues.apache.org/jira/browse/FLINK-2405
>             Project: Flink
>          Issue Type: New Feature
>          Components: Scala API, Streaming
>            Reporter: Gyula Fora
>            Assignee: Gyula Fora
>            Priority: Minor
>
> I propose to extend the Streaming Scala API methods (map, flatmap, filter 
> etc) with versions that take stateful functions as lambdas. This would allow 
> for a nice functional way of defining stateful transformations:
> Example:
> def mapWithState( fun: (I, Option[S]) => (O, Option[S]), stateByKey: Boolean 
> = false)
> The stateByKey optional flag allows the user to partition the state by key 
> when applied on a KeyedDataStream.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to