Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-2076

TransferQueueBundler: bundler thread should remove chunks of messages

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Minor Minor
    • 3.6.10, 4.0
    • None
    • None

      Currently, the bundler thread in TransferQueueBundler removes messages from the queue one by one:

      while(null != (msg=queue.poll())) {
          long size=msg.size();
          if(count + size >= transport.getMaxBundleSize())
              sendBundledMessages();
          addMessage(msg, size);
      }
      

      This is inefficient, as we need to acquire the lock on ArrayBlockingQueue every time. ArrayBlockingQueue.drainTo() should be used instead, to remove as many messages as are in the queue with one lock acquisition.

              rhn-engineering-bban Bela Ban
              rhn-engineering-bban Bela Ban
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: