Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-5721

Add FoldingState to State Documentation

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0, 1.2.1
    • Component/s: Documentation
    • Labels:
      None

      Issue Links

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user aljoscha opened a pull request:

        https://github.com/apache/flink/pull/3272

        FLINK-5721 Add FoldingState to State Documentation

        R: @NicoK

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/aljoscha/flink add-fold-state-doc

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/flink/pull/3272.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #3272


        commit e45a2291ab0f5959a03dbd544c90a544bbf6b7ad
        Author: Aljoscha Krettek <aljoscha.krettek@gmail.com>
        Date: 2017-02-06T13:51:17Z

        FLINK-5721 Add FoldingState to State Documentation


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user aljoscha opened a pull request: https://github.com/apache/flink/pull/3272 FLINK-5721 Add FoldingState to State Documentation R: @NicoK You can merge this pull request into a Git repository by running: $ git pull https://github.com/aljoscha/flink add-fold-state-doc Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3272.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3272 commit e45a2291ab0f5959a03dbd544c90a544bbf6b7ad Author: Aljoscha Krettek <aljoscha.krettek@gmail.com> Date: 2017-02-06T13:51:17Z FLINK-5721 Add FoldingState to State Documentation
        Hide
        githubbot ASF GitHub Bot added a comment -

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

        https://github.com/apache/flink/pull/3272#discussion_r99614243

        — Diff: docs/dev/stream/state.md —
        @@ -113,9 +113,19 @@ be retrieved using `Iterable<T> get()`.
        added to the state. The interface is the same as for `ListState` but elements added using
        `add(T)` are reduced to an aggregate using a specified `ReduceFunction`.

        +* `FoldingState<T, ACC>`: This keeps a single value that represents the aggregation of all values
        +added to the state. Contrary to `ReducingState`, the aggregate type is different from the type of
        +elements that are added to the state. The interface is the same as for `ListState` but elements
        +added using `add(T)` are folded into an aggregate using a specified `FoldFunction`.
        +
        All types of state also have a method `clear()` that clears the state for the currently
        active key, i.e. the key of the input element.

        +<span class="label label-danger">Attention</span> `FoldingState` will be deprecated in one of
        +the next versions of Flink and will be completely removed in the Future. A more general
        — End diff –

        Future should be lower case

        Show
        githubbot ASF GitHub Bot added a comment - Github user uce commented on a diff in the pull request: https://github.com/apache/flink/pull/3272#discussion_r99614243 — Diff: docs/dev/stream/state.md — @@ -113,9 +113,19 @@ be retrieved using `Iterable<T> get()`. added to the state. The interface is the same as for `ListState` but elements added using `add(T)` are reduced to an aggregate using a specified `ReduceFunction`. +* `FoldingState<T, ACC>`: This keeps a single value that represents the aggregation of all values +added to the state. Contrary to `ReducingState`, the aggregate type is different from the type of +elements that are added to the state. The interface is the same as for `ListState` but elements +added using `add(T)` are folded into an aggregate using a specified `FoldFunction`. + All types of state also have a method `clear()` that clears the state for the currently active key, i.e. the key of the input element. +<span class="label label-danger">Attention</span> `FoldingState` will be deprecated in one of +the next versions of Flink and will be completely removed in the Future. A more general — End diff – Future should be lower case
        Hide
        githubbot ASF GitHub Bot added a comment -

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

        https://github.com/apache/flink/pull/3272#discussion_r99614214

        — Diff: docs/dev/stream/state.md —
        @@ -113,9 +113,19 @@ be retrieved using `Iterable<T> get()`.
        added to the state. The interface is the same as for `ListState` but elements added using
        `add(T)` are reduced to an aggregate using a specified `ReduceFunction`.

        +* `FoldingState<T, ACC>`: This keeps a single value that represents the aggregation of all values
        +added to the state. Contrary to `ReducingState`, the aggregate type is different from the type of
        +elements that are added to the state. The interface is the same as for `ListState` but elements
        +added using `add(T)` are folded into an aggregate using a specified `FoldFunction`.
        +
        All types of state also have a method `clear()` that clears the state for the currently
        active key, i.e. the key of the input element.

        +<span class="label label-danger">Attention</span> `FoldingState` will be deprecated in one of
        +the next versions of Flink and will be completely removed in the Future. A more general
        +alternative will be provided.
        +
        +
        — End diff –

        empty line

        Show
        githubbot ASF GitHub Bot added a comment - Github user uce commented on a diff in the pull request: https://github.com/apache/flink/pull/3272#discussion_r99614214 — Diff: docs/dev/stream/state.md — @@ -113,9 +113,19 @@ be retrieved using `Iterable<T> get()`. added to the state. The interface is the same as for `ListState` but elements added using `add(T)` are reduced to an aggregate using a specified `ReduceFunction`. +* `FoldingState<T, ACC>`: This keeps a single value that represents the aggregation of all values +added to the state. Contrary to `ReducingState`, the aggregate type is different from the type of +elements that are added to the state. The interface is the same as for `ListState` but elements +added using `add(T)` are folded into an aggregate using a specified `FoldFunction`. + All types of state also have a method `clear()` that clears the state for the currently active key, i.e. the key of the input element. +<span class="label label-danger">Attention</span> `FoldingState` will be deprecated in one of +the next versions of Flink and will be completely removed in the Future. A more general +alternative will be provided. + + — End diff – empty line
        Hide
        githubbot ASF GitHub Bot added a comment -

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

        https://github.com/apache/flink/pull/3272#discussion_r99614763

        — Diff: docs/dev/stream/state.md —
        @@ -113,9 +113,19 @@ be retrieved using `Iterable<T> get()`.
        added to the state. The interface is the same as for `ListState` but elements added using
        `add(T)` are reduced to an aggregate using a specified `ReduceFunction`.

        +* `FoldingState<T, ACC>`: This keeps a single value that represents the aggregation of all values
        +added to the state. Contrary to `ReducingState`, the aggregate type is different from the type of
        — End diff –

        ...the aggregate type *may be* different from...

        Show
        githubbot ASF GitHub Bot added a comment - Github user NicoK commented on a diff in the pull request: https://github.com/apache/flink/pull/3272#discussion_r99614763 — Diff: docs/dev/stream/state.md — @@ -113,9 +113,19 @@ be retrieved using `Iterable<T> get()`. added to the state. The interface is the same as for `ListState` but elements added using `add(T)` are reduced to an aggregate using a specified `ReduceFunction`. +* `FoldingState<T, ACC>`: This keeps a single value that represents the aggregation of all values +added to the state. Contrary to `ReducingState`, the aggregate type is different from the type of — End diff – ...the aggregate type * may be * different from...
        Hide
        githubbot ASF GitHub Bot added a comment -

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

        https://github.com/apache/flink/pull/3272#discussion_r99615295

        — Diff: docs/dev/stream/state.md —
        @@ -126,8 +136,8 @@ To get a state handle, you have to create a `StateDescriptor`. This holds the na
        (as we will see later, you can create several states, and they have to have unique names so
        that you can reference them), the type of the values that the state holds, and possibly
        a user-specified function, such as a `ReduceFunction`. Depending on what type of state you
        -want to retrieve, you create either a `ValueStateDescriptor`, a `ListStateDescriptor` or
        -a `ReducingStateDescriptor`.
        +want to retrieve, you create either a `ValueStateDescriptor`, a `ListStateDescriptor`,
        +`ReducingStateDescriptor` or a `FoldingStateDescriptor`.
        — End diff –

        *a* `ReducingStateDescriptor`*,* or a ...

        Show
        githubbot ASF GitHub Bot added a comment - Github user NicoK commented on a diff in the pull request: https://github.com/apache/flink/pull/3272#discussion_r99615295 — Diff: docs/dev/stream/state.md — @@ -126,8 +136,8 @@ To get a state handle, you have to create a `StateDescriptor`. This holds the na (as we will see later, you can create several states, and they have to have unique names so that you can reference them), the type of the values that the state holds, and possibly a user-specified function, such as a `ReduceFunction`. Depending on what type of state you -want to retrieve, you create either a `ValueStateDescriptor`, a `ListStateDescriptor` or -a `ReducingStateDescriptor`. +want to retrieve, you create either a `ValueStateDescriptor`, a `ListStateDescriptor`, +`ReducingStateDescriptor` or a `FoldingStateDescriptor`. — End diff – * a * `ReducingStateDescriptor`* , * or a ...
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user aljoscha commented on the issue:

        https://github.com/apache/flink/pull/3272

        Thanks @uce and @NicoK. I incorporated your suggestions and will merge now.

        Show
        githubbot ASF GitHub Bot added a comment - Github user aljoscha commented on the issue: https://github.com/apache/flink/pull/3272 Thanks @uce and @NicoK. I incorporated your suggestions and will merge now.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user aljoscha closed the pull request at:

        https://github.com/apache/flink/pull/3272

        Show
        githubbot ASF GitHub Bot added a comment - Github user aljoscha closed the pull request at: https://github.com/apache/flink/pull/3272
        Hide
        aljoscha Aljoscha Krettek added a comment -

        Added on release-1.2 in:
        e789933b502a7d52ab7012404fa7e131353cfcd0

        on master in:
        588d7c62c0c60c83c894d26702d4563567c5e743

        Show
        aljoscha Aljoscha Krettek added a comment - Added on release-1.2 in: e789933b502a7d52ab7012404fa7e131353cfcd0 on master in: 588d7c62c0c60c83c894d26702d4563567c5e743

          People

          • Assignee:
            aljoscha Aljoscha Krettek
            Reporter:
            aljoscha Aljoscha Krettek
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development