Class DequeRecycler<T>

java.lang.Object
org.elasticsearch.common.recycler.DequeRecycler<T>
All Implemented Interfaces:
Recycler<T>
Direct Known Subclasses:
ConcurrentDequeRecycler

public class DequeRecycler<T> extends Object
A Recycler implementation based on a Deque. This implementation is NOT thread-safe.
  • Field Details

  • Constructor Details

    • DequeRecycler

      public DequeRecycler(Recycler.C<T> c, Deque<T> queue, int maxSize)
  • Method Details

    • obtain

      public Recycler.V<T> obtain()
    • beforeRelease

      protected boolean beforeRelease()
      Called before releasing an object, returns true if the object should be recycled and false otherwise.
    • afterRelease

      protected void afterRelease(boolean recycled)
      Called after a release.