I need to implement plenty of rules on the data that I'll receive on daily basis.
Data will have information about the user actions like someone clicking on an advertisement. We want to ignore some of the clicks based on rules like
- anyone clicking the same ad more than 4 times in a minute --> ignore all clicks 4th onwards
- anyone clicking the same ad more than 4 times in an hour --> ignore all clicks 4th onwards
- anyone clicking different ads more than 10 times in a minute --> ignore all clicks for that user
Data will be coming for each clicking. Example:
User_ID AD_ID CLICK_TIME
User1 ad1 2018-09-11 11:10:00
User1 ad1 2018-09-11 11:10:01
User1 ad1 2018-09-11 11:10:02
User1 ad1 2018-09-11 11:10:03
User1 ad1 2018-09-11 11:10:04
User1 ad1 2018-09-11 11:10:05
Since the data will be huge and each rule requires data aggregation and then checking the counts. Data will be provided in a file.
May I know whats the best approach to implement such rules in Java? Is there any ope source that we can use?
Thanks