类 TripleLongPriorityQueue

java.lang.Object
org.apache.pulsar.common.util.collections.TripleLongPriorityQueue
所有已实现的接口:
AutoCloseable

public class TripleLongPriorityQueue extends Object implements AutoCloseable
Provides a priority-queue implementation specialized on items composed by 3 longs.

This class is not thread safe and the items are stored in direct memory.

  • 构造器概要

    构造器
    构造器
    说明
    Create a new priority queue with default initial capacity.
    TripleLongPriorityQueue(int initialCapacity)
    Create a new priority queue with a given initial capacity.
    TripleLongPriorityQueue(long initialCapacity, float shrinkFactor)
     
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    add(long n1, long n2, long n3)
    Add a tuple of 3 long items to the priority queue.
    long
    The amount of memory used to back the priority queue.
    void
    Clear all items.
    void
    Close the priority queue and free the memory associated.
    boolean
    Returns whether the priority queue is empty.
    long
    Read the 1st long item in the top tuple in the priority queue.
    long
    Read the 2nd long item in the top tuple in the priority queue.
    long
    Read the 3rd long item in the top tuple in the priority queue.
    void
    pop()
    Removes the first item from the queue.
    long
    Returns the number of tuples in the priority queue.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • TripleLongPriorityQueue

      public TripleLongPriorityQueue()
      Create a new priority queue with default initial capacity.
    • TripleLongPriorityQueue

      public TripleLongPriorityQueue(long initialCapacity, float shrinkFactor)
    • TripleLongPriorityQueue

      public TripleLongPriorityQueue(int initialCapacity)
      Create a new priority queue with a given initial capacity.
      参数:
      initialCapacity -
  • 方法详细资料

    • close

      public void close()
      Close the priority queue and free the memory associated.
      指定者:
      close 在接口中 AutoCloseable
    • add

      public void add(long n1, long n2, long n3)
      Add a tuple of 3 long items to the priority queue.
      参数:
      n1 -
      n2 -
      n3 -
    • peekN1

      public long peekN1()
      Read the 1st long item in the top tuple in the priority queue.

      The tuple will not be extracted

    • peekN2

      public long peekN2()
      Read the 2nd long item in the top tuple in the priority queue.

      The tuple will not be extracted

    • peekN3

      public long peekN3()
      Read the 3rd long item in the top tuple in the priority queue.

      The tuple will not be extracted

    • pop

      public void pop()
      Removes the first item from the queue.
    • isEmpty

      public boolean isEmpty()
      Returns whether the priority queue is empty.
    • size

      public long size()
      Returns the number of tuples in the priority queue.
    • bytesCapacity

      public long bytesCapacity()
      The amount of memory used to back the priority queue.
    • clear

      public void clear()
      Clear all items.