在flink中如何存储多个k-v并在Map时进行匹配

icnyk63a  于 2022-12-09  发布在  Apache
关注(0)|答案(1)|浏览(99)

there are userID and cardID.When data comes,store it if it cant match cardID, or check its userID.when the user is not match,print a warn including userIDs and cardID.
I try to store them in

class Bean{
  String userID;
  String cardID;
}
Liststate<Bean> liststate;

I can store them,just dont know how to match.

5vf7fwbs

5vf7fwbs1#

你不需要存储k-v。通过cardId键控你的流,并在keyedProcessFunction中为UserId保留一个状态。如果传入的userId与值状态中的userId不同,则创建警告消息。

相关问题