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

TransferQueueBundler: bundler thread should remove chunks of messages

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Done
    • None
    • 3.6.10, 4.0
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: