خرید بک لینک

Vote count: 0

I have a program that receives a constant stream of data.

From this stream of data I populate a hashtable. Every piece of data I receive is translated in, either:

  • a key update ;
  • or a key insertion if it doesn't already exist.

I store the incoming raw data in a queue before it is being processed.

The number of keys in the hashtable is very small. 99% of the data I receive corresponds to key updates.

The problem is that I have so many key updates that the queue becomes too big for my consumers.

Obviously, from the thousands of key updates, many of them conce the same key, so only the last one has a real value while all the others are useless.

What is the best way for me to handle this case? Which data structure should I be using?

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 26 فروردين 1395 ساعت: 21:17

صفحه بندی