ITERATOR_TYPE - OBJECT_TYPE - public class IteratorPool<OBJECT_TYPE,ITERATOR_TYPE extends AbstractIterator<OBJECT_TYPE>> extends ObjectPool<ITERATOR_TYPE>
ObjectPool of Iterators of type
ITERATOR_TYPE, which are AbstractIterators for OBJECT_TYPE objects.
All Iterator pools have the same allocation scheme :
- Initial size is given either by global configureInitialPoolSize(int) call,
by system property "HPPC_ITERATOR_POOLSIZE",
or by default, the number of processors.
- Grows by chunks of initial size,
- When its size gets bigger than MAX_SIZE_GROWTH_FACTOR * initial size,
capacity remains constant while 'initial size' old objects are disposed of.| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_SIZE_GROWTH_FACTOR
An Iterator pool never get bigger than MAX_SIZE_GROWTH_FACTOR times its
original size.
|
static java.lang.String |
POOL_INITIAL_SIZE_PROPERTY |
arrayPool, capacity, currentSize, factory, growthPolicy| Constructor and Description |
|---|
IteratorPool(ObjectFactory<ITERATOR_TYPE> objFactory) |
| Modifier and Type | Method and Description |
|---|---|
ITERATOR_TYPE |
borrow()
Customized borrow(), that properly attach the borrowed iterator to its
corresponding pool and resets it to allow iteration as if the iterator was
created for the first time.
|
static void |
configureInitialPoolSize(int initialSize)
Configure the initial pool size for all iterators, for all containers.
|
static int |
getMaxPoolSize()
Returns the expected max size all iterator pools will be limited to.
|
capacity, release, sizepublic static final int MAX_SIZE_GROWTH_FACTOR
public static final java.lang.String POOL_INITIAL_SIZE_PROPERTY
public IteratorPool(ObjectFactory<ITERATOR_TYPE> objFactory)
public ITERATOR_TYPE borrow()
borrow in class ObjectPool<ITERATOR_TYPE extends AbstractIterator<OBJECT_TYPE>>public static final void configureInitialPoolSize(int initialSize)
initialSize - public static final int getMaxPoolSize()
Copyright © 2017. All rights reserved.