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.
1条答案
按热度按时间5vf7fwbs1#
你不需要存储k-v。通过cardId键控你的流,并在keyedProcessFunction中为UserId保留一个状态。如果传入的userId与值状态中的userId不同,则创建警告消息。