protected void incrementCounter(ListNode2<Counter<T>> counterNode, int incrementCount) {
    Counter<T> counter = counterNode.getValue(); // count_i
    ListNode2<Bucket> oldNode = counter.bucketNode;
    Bucket bucket = oldNode.getValue(); // Let Bucket_i be the bucket of count_i
    bucket.counterList.remove(counterNode); // Detach count_i from Bucket_i's child-list
    counter.count = counter.count + incrementCount;

    // Finding the right bucket for count_i
    // Because we allow a single call to increment count more than once, this may not be the
    // adjacent bucket.
    ListNode2<Bucket> bucketNodePrev = oldNode;
    ListNode2<Bucket> bucketNodeNext = bucketNodePrev.getNext();
    while (bucketNodeNext != null) {
      Bucket bucketNext =
          bucketNodeNext.getValue(); // Let Bucket_i^+ be Bucket_i's neighbor of larger value
      if (counter.count == bucketNext.count) {
        bucketNext.counterList.add(counterNode); // Attach count_i to Bucket_i^+'s child-list
        break;
      } else if (counter.count > bucketNext.count) {
        bucketNodePrev = bucketNodeNext;
        bucketNodeNext = bucketNodePrev.getNext(); // Continue hunting for an appropriate bucket
      } else {
        // A new bucket has to be created
        bucketNodeNext = null;
      }
    }

    if (bucketNodeNext == null) {
      Bucket bucketNext = new Bucket(counter.count);
      bucketNext.counterList.add(counterNode);
      bucketNodeNext = bucketList.addAfter(bucketNodePrev, bucketNext);
    }
    counter.bucketNode = bucketNodeNext;

    // Cleaning up
    if (bucket.counterList.isEmpty()) // If Bucket_i's child-list is empty
    {
      bucketList.remove(oldNode); // Detach Bucket_i from the Stream-Summary
    }
  }
@param item stream element (<i>e</i>)
@return Pair<isNewItem, itemDropped> where isNewItem is the return value of offer() and
    itemDropped is null if no item was dropped
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/aggregation/approximate/StreamSummary.java