Commit caf4672
[FLINK-3201] Enhance Partitioned State Interface with State Types
Add new state types ValueState, ListState and ReducingState, where
ListState and ReducingState derive from interface MergingState.
ValueState behaves exactly the same as OperatorState. MergingState is a
stateful list to which elements can be added and for which the elements
that it contains can be obtained. If using a ListState the list of
elements is actually kept, for a ReducingState a reduce function is used
to combine all added elements into one. To create a ValueState the user
passes a ValueStateIdentifier to
StreamingRuntimeContext.getPartitionedState() while they would pass a
ListStateIdentifier or ReducingStateIdentifier for the other state
types.
This change is necessary to give the system more information about the
nature of the operator state. We want this to be able to do incremental
snapshots. This would not be possible, for example, if the user had a
List as a state. Inside OperatorState this list would be opaque and
Flink could not create good incremental snapshots.
This also refactors the StateBackend. Before, the logic for partitioned
state was spread out over StreamingRuntimeContext,
AbstractStreamOperator and StateBackend. Now it is consolidated in
StateBackend.
This also adds support for partitioned state in two-input operators.1 parent 680c2c3 commit caf4672
110 files changed
Lines changed: 4566 additions & 1819 deletions
File tree
- flink-contrib/flink-streaming-contrib/src
- main/java/org/apache/flink/contrib/streaming/state
- test
- java/org/apache/flink/contrib/streaming/state
- resources
- flink-core/src/main/java/org/apache/flink/api/common
- functions
- util
- state
- typeutils/base
- flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/windowing
- flink-fs-tests/src/test/java/org/apache/flink/hdfstests
- flink-runtime/src
- main/java/org/apache/flink/runtime/state
- filesystem
- memory
- test/java/org/apache/flink/runtime/state
- flink-streaming-connectors
- flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs
- flink-connector-kafka-base/src
- main/java/org/apache/flink/streaming/connectors/kafka
- test/java/org/apache/flink/streaming/connectors/kafka
- testutils
- flink-streaming-java/src
- main/java/org/apache/flink/streaming
- api
- datastream
- environment
- functions/source
- graph
- operators
- transformations
- windowing/triggers
- runtime
- io
- operators/windowing
- tasks
- test/java/org/apache/flink/streaming
- api
- operators/co
- runtime
- operators/windowing
- state
- util
- flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala
- function
- flink-tests/src/test/java/org/apache/flink/test
- checkpointing
- classloading/jar
- recovery
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 57 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
| |||
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
39 | | - | |
| 48 | + | |
40 | 49 | | |
41 | | - | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
| |||
56 | 65 | | |
57 | 66 | | |
58 | 67 | | |
59 | | - | |
| 68 | + | |
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
| |||
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
| 91 | + | |
| 92 | + | |
82 | 93 | | |
83 | 94 | | |
84 | 95 | | |
85 | | - | |
| 96 | + | |
86 | 97 | | |
87 | 98 | | |
88 | 99 | | |
| |||
104 | 115 | | |
105 | 116 | | |
106 | 117 | | |
107 | | - | |
| 118 | + | |
108 | 119 | | |
109 | 120 | | |
110 | 121 | | |
| |||
160 | 171 | | |
161 | 172 | | |
162 | 173 | | |
163 | | - | |
| 174 | + | |
164 | 175 | | |
165 | 176 | | |
166 | 177 | | |
| |||
182 | 193 | | |
183 | 194 | | |
184 | 195 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
195 | 226 | | |
196 | 227 | | |
197 | 228 | | |
198 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
199 | 236 | | |
200 | 237 | | |
201 | 238 | | |
| |||
221 | 258 | | |
222 | 259 | | |
223 | 260 | | |
224 | | - | |
| 261 | + | |
225 | 262 | | |
226 | 263 | | |
227 | 264 | | |
| |||
0 commit comments