streaminer
streaminer copied to clipboard
Bug while maintaining count in Stream Summary
It might be my misunderstanding, but I dont know why you have not reset the counter while adding a new item. I think you should set the count to the count of new item. Currently, the count of old element is maintained.
Bucket min = bucketList.first(); counterNode = min.counterList.tail(); Counter<T> counter = counterNode.getValue(); droppedItem = counter.getItem(); counterMap.remove(droppedItem); counter.setItem(item); counter.setError(min.count);
This code is from offerReturnAll method of StreamSummary class.