flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Huang <jackhu...@machinezone.com>
Subject Checkpoint and restore states
Date Wed, 20 Apr 2016 01:51:23 GMT
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