Class ConcurrentDequeRecycler<T>
- java.lang.Object
-
- org.elasticsearch.common.recycler.DequeRecycler<T>
-
- org.elasticsearch.common.recycler.ConcurrentDequeRecycler<T>
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Releasable,Recycler<T>
public class ConcurrentDequeRecycler<T> extends DequeRecycler<T>
ARecyclerimplementation based on a concurrentDeque. This implementation is thread-safe.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.recycler.Recycler
Recycler.C<T>, Recycler.Factory<T>, Recycler.V<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected Recycler.C<T>c
-
Constructor Summary
Constructors Constructor Description ConcurrentDequeRecycler(Recycler.C<T> c, int maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterRelease(boolean recycled)Called after a release.protected booleanbeforeRelease()Called before releasing an object, returns true if the object should be recycled and false otherwise.voidclose()Recycler.V<T>obtain()Recycler.V<T>obtain(int sizing)
-
-
-
Field Detail
-
c
protected final Recycler.C<T> c
-
-
Constructor Detail
-
ConcurrentDequeRecycler
public ConcurrentDequeRecycler(Recycler.C<T> c, int maxSize)
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceRecycler<T>- Specified by:
closein interfaceReleasable- Overrides:
closein classDequeRecycler<T>
-
obtain
public Recycler.V<T> obtain(int sizing)
-
beforeRelease
protected boolean beforeRelease()
Description copied from class:DequeRecyclerCalled before releasing an object, returns true if the object should be recycled and false otherwise.- Overrides:
beforeReleasein classDequeRecycler<T>
-
afterRelease
protected void afterRelease(boolean recycled)
Description copied from class:DequeRecyclerCalled after a release.- Overrides:
afterReleasein classDequeRecycler<T>
-
obtain
public Recycler.V<T> obtain()
-
-