Questions about managed operator state

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Questions about managed operator state

Boris Lublinsky
Refers to CheckpointedRestoring interface.
Which jar defines this interface - can’t find it

Also documentation refers to MapState<UK, UV>. Do you have any example of creation of Map State.
For value State in Scala, I can do just do
private var sum: ValueState[(Long, Long)] = _
But it does not work for MapState -
Error:(44, 53) unbound placeholder parameter
  private val newModels : MapState[String, Model] = _


Boris Lublinsky
FDP Architect
[hidden email]
https://www.lightbend.com/

Reply | Threaded
Open this post in threaded view
|

Re: Questions about managed operator state

Fabian Hueske-2
Hi Boris,

the CheckpointedRestoring interface was removed in Flink 1.4.0 (and deprecated in an earlier version). Unfortunately, the docs have not been updated accordingly. I'll open a JIRA to fix this.
The replacements for CheckpointedRestoring are the CheckpointedFunction or ListCheckpointed interfaces (see [1]).

I think the compile error is caused because you define newModels as val and not as var.

Best, Fabian


2018-01-14 2:39 GMT+01:00 Boris Lublinsky <[hidden email]>:
Refers to CheckpointedRestoring interface.
Which jar defines this interface - can’t find it

Also documentation refers to MapState<UK, UV>. Do you have any example of creation of Map State.
For value State in Scala, I can do just do
private var sum: ValueState[(Long, Long)] = _
But it does not work for MapState -
Error:(44, 53) unbound placeholder parameter
  private val newModels : MapState[String, Model] = _


Boris Lublinsky
FDP Architect
[hidden email]
https://www.lightbend.com/


Reply | Threaded
Open this post in threaded view
|

Re: Questions about managed operator state

Boris Lublinsky
Thanks Fabian,
After I switched to var it compiles, but its not initialized. 
@transient private var currentModels : MapState[String, Model] = _
Assignes null to MapState.
Do I create an empty hashMap there?

Boris Lublinsky
FDP Architect
[hidden email]
https://www.lightbend.com/

On Jan 14, 2018, at 11:09 AM, Fabian Hueske <[hidden email]> wrote:

Hi Boris,

the CheckpointedRestoring interface was removed in Flink 1.4.0 (and deprecated in an earlier version). Unfortunately, the docs have not been updated accordingly. I'll open a JIRA to fix this.
The replacements for CheckpointedRestoring are the CheckpointedFunction or ListCheckpointed interfaces (see [1]).

I think the compile error is caused because you define newModels as val and not as var.

Best, Fabian


2018-01-14 2:39 GMT+01:00 Boris Lublinsky <[hidden email]>:
Refers to CheckpointedRestoring interface.
Which jar defines this interface - can’t find it

Also documentation refers to MapState<UK, UV>. Do you have any example of creation of Map State.
For value State in Scala, I can do just do
private var sum: ValueState[(Long, Long)] = _
But it does not work for MapState -
Error:(44, 53) unbound placeholder parameter
  private val newModels : MapState[String, Model] = _


Boris Lublinsky
FDP Architect
[hidden email]
https://www.lightbend.com/