Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

in flink,how to store mutiple k-v and match them while mapping

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You don`t need to store k-v.
Key your stream by cardId and in keyedProcessFunction keep a state for UserId.
If incoming userId is not same with the userId in the value state, create warning message.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading