Class ConcurrentStripedPool<E>
- java.lang.Object
-
- org.apache.ignite.internal.processors.query.h2.ConcurrentStripedPool<E>
-
-
Constructor Summary
Constructors Constructor Description ConcurrentStripedPool(int stripes, int maxPoolSize)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Eborrow()Retrieves element from pool, or returnsnullif the pool is empty.voidclear()Removes all of the elements from the pool..voidforEach(Consumer<? super E> action)Performs the given action for each element of the pool until all elements have been processed or the action throws an exception.@NotNull Iterator<E>iterator()booleanrecycle(E e)Pushes an element onto the pool.voidresize(int size)Stream<E>stream()Returns a sequentialStreamof the pool.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
spliterator
-
-
-
-
Method Detail
-
recycle
public boolean recycle(E e)
Pushes an element onto the pool.- Parameters:
e- the element to push- Returns:
trueif the element is returned to the pool,falseif the is no space at the pool.- Throws:
NullPointerException- if the specified element is null and this deque does not permit null elements
-
borrow
public E borrow()
Retrieves element from pool, or returnsnullif the pool is empty.- Returns:
- the element of the pool, or
nullif the pool is empty.
-
forEach
public void forEach(Consumer<? super E> action)
Performs the given action for each element of the pool until all elements have been processed or the action throws an exception. Exceptions thrown by the action are relayed to the caller.- Specified by:
forEachin interfaceIterable<E>- Parameters:
action- The action to be performed for each element- Throws:
NullPointerException- if the specified action is null
-
clear
public void clear()
Removes all of the elements from the pool..
-
stream
public Stream<E> stream()
Returns a sequentialStreamof the pool.- Returns:
- a sequential
Streamover the elements iof the pool.
-
resize
public void resize(int size)
- Parameters:
size- New max pool size.
-
-