flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aljoscha Krettek <aljos...@apache.org>
Subject Re: Checkpoint and restore states
Date Wed, 20 Apr 2016 09:34:38 GMT
Hi,
what seems to be the problem?

Cheers,
Aljoscha

On Wed, 20 Apr 2016 at 03:52 Jack Huang <jackhuang@machinezone.com> wrote:

> Hi all,
>
> I am doing a simple word count example and want to checkpoint the
> accumulated word counts. I am not having any luck getting the counts saved
> and restored. Can someone help?
>
> env.enableCheckpointing(1000)
>
> env.setStateBackend(new MemoryStateBackend())
>
>
>>  ...
>
>
>
> inStream
>>     .keyBy({s => s})
>>
>>
>>
>> *.mapWithState((in:String, count:Option[Int]) => {        val newCount =
>> count.getOrElse(0) + 1        ((in, newCount), Some(newCount))    })*
>>     .print()
>
>
>
> Thanks,
>
> Jack Huang
>

Mime
View raw message