Class ArrayBlockingQueueBuffer<T>

java.lang.Object
org.apache.skywalking.oap.server.library.datacarrier.buffer.ArrayBlockingQueueBuffer<T>
All Implemented Interfaces:
QueueBuffer<T>

public class ArrayBlockingQueueBuffer<T> extends Object implements QueueBuffer<T>
The buffer implementation based on JDK ArrayBlockingQueue.

This implementation has better performance in server side. We are still trying to research whether this is suitable for agent side, which is more sensitive about blocks.

  • Method Details

    • save

      public boolean save(T data)
      Description copied from interface: QueueBuffer
      Save data into the queue;
      Specified by:
      save in interface QueueBuffer<T>
      Parameters:
      data - to add.
      Returns:
      true if saved
    • setStrategy

      public void setStrategy(BufferStrategy strategy)
      Description copied from interface: QueueBuffer
      Set different strategy when queue is full.
      Specified by:
      setStrategy in interface QueueBuffer<T>
    • obtain

      public void obtain(List<T> consumeList)
      Description copied from interface: QueueBuffer
      Obtain the existing data from the queue
      Specified by:
      obtain in interface QueueBuffer<T>
    • getBufferSize

      public int getBufferSize()
      Specified by:
      getBufferSize in interface QueueBuffer<T>