bolt prepare init data, but where to change it,
hi, I have a doubt about how to change init data(clean it once per day ) in
prepare method.
My Bolt prepare code like this:
public void prepare(Map stormConf, TopologyContext context, OutputCollector
collector) {
int maxCount = 10000;
dataMap = myDao.getData(maxCount);
}
myDao.getData method query data from storage, holds current day click count.
when storm topology runs some day, dataMap holds data with this days.
Where should I remove data expect today's data at dataMap.
Is there someone encounter this and have some solution about it ? thanks.