??????????????????????????
  "???????????????????????????????????? state backend 
???????????????????????????????????????? Heap state backend 
?????????????????????????????????????? Java ??????RocksDB state backend 
????????????????list ???? map ???????????????????????? 8 ????????"


????????https://github.com/apache/flink/blob/master/docs/dev/stream/state/state.zh.md


by wulei


------------------ ???????? ------------------
??????:                                                                         
                                               "user-zh"                        
                                                            
<[email protected]&gt;;
????????:&nbsp;2020??9??18??(??????) ????10:49
??????:&nbsp;"user-zh"<[email protected]&gt;;

????:&nbsp;ListState ???? TTL ???? list ??????????????????



????????????????

KeyBy userId?? ???? userId ???????????????????????? ListState ??
private transient ListState<String&gt; list;

@Override
public void processElement(Tuple2<String, String&gt; value, Context ctx, 
Collector<String&gt; out)
&nbsp;&nbsp;&nbsp; throws Exception {
&nbsp;&nbsp;&nbsp; list.add(value.f1);
}
TTL ???? 7 ????
???????? userId ???? 7 ?????????????????????? userId ?????? ListState ??????????
???????? userId ???????????????????????????? 7 ?????? ?? add ?? list 
??????????????????????

??????
????


[email protected]

回复