Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-16735

New client operation registration can be optimized

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 15.1.0.Dev05
    • None
    • Hot Rod
    • None

      Today in the new client when an operation is to be submitted to the channel. We first generate an id and then from that register the operation to a HashMap and then register a timeout runnable with the netty scheduler which then is also fed into a different HashMap.

      We should be able to instead utilize a RingBuffer and store both the operation and timeout information there. Note that we would only submit one netty timeout event as the RingBuffer guarantees order for us, so it would only need to run until the oldest operation was submitted. Then upon running the task would only check the head until it found an operation that can expire and resubmit based on its remaining time.

      Also this allows for easier completion of a previous operation as all we have to do is remove the entry from the RingBuffer which is just an array offset removal and the timeout will "cancel" itself.

            wburns@redhat.com Will Burns
            wburns@redhat.com Will Burns
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: