Re: Error while using ConcurrentHashMap in Spark Streaming

2015-08-06 Thread Ted Yu
bq. aggregationMap.put(countryCode,requestCountPerCountry+1); If NPE came from the above line, maybe requestCountPerCountry was null ? Cheers On Thu, Aug 6, 2015 at 8:54 AM, UMESH CHAUDHARY wrote: > Scenario is: > >- I have a map of country-code as key and count as value (initially >co

Error while using ConcurrentHashMap in Spark Streaming

2015-08-06 Thread UMESH CHAUDHARY
Scenario is: - I have a map of country-code as key and count as value (initially count is 0) - In DStream.foreachRDD I need to update the count for country in the map with new aggregated value I am doing : transient Map aggregationMap=new ConcurrentHashMap(); Integer requestCountPe