Top Fields Constructors Methods
stormpot

pack-priv final Class BAllocThread<T extends Poolable>

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Annotations
@SuppressWarnings:NonAtomicOperationOnVolatileField
Imports
java.util.concurrent.BlockingQueue, .CountDownLatch, .LinkedTransferQueue, .TimeUnit, java.util.concurrent.atomic.AtomicInteger, java.util.concurrent.locks.LockSupport

Field Summary

Modifier and TypeField and Description
private volatile long
private final Reallocator<T>
private final boolean
private final CountDownLatch
private long
private final BlockingQueue<BSlot<T>>
private final long
private boolean
private final RefillPile<T>
private final Expiration<? super T>
private volatile long
private final PreciseLeakDetector
private final LinkedTransferQueue<BSlot<T>>
private final MetricsRecorder
private final RefillPile<T>
private final AtomicInteger
private final BSlot<T>
private volatile boolean
private static final long
shutdownPauseNanos

The amount of time, in nanoseconds, to wait for more work when the shutdown process has deallocated all the dead and live slots it could get its hands on, but there are still (claimed) slots left.

private int
private volatile int

Constructor Summary

AccessConstructor and Description
pack-priv
BAllocThread(LinkedTransferQueue<BSlot<T>> live, RefillPile<T> disregardPile, RefillPile<T> newAllocations, PoolBuilder<T> builder, BSlot<T> poisonPill)

Method Summary

Modifier and TypeMethod and Description
private void
alloc(BSlot<T> slot)

private void
private long
private void
pack-priv long
private void
dealloc(BSlot<T> slot)

pack-priv long
pack-priv long
pack-priv int
private void
private void
incrementAllocationCounts(boolean success)

pack-priv void
private void
private void
publishSlot(BSlot<T> slot, boolean success, long now)

private void
realloc(BSlot<T> slot)

private void
private void
recordObjectLifetimeSample(long nanoseconds)

private void
private void
private void
private void
resetSlot(BSlot<T> slot, long now)

public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
pack-priv void
setTargetSize(int size)

pack-priv Completion
shutdown(Thread allocatorThread)

private void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allocationCountback to summary
private volatile long allocationCount
allocatorback to summary
private final Reallocator<T> allocator
backgroundExpirationEnabledback to summary
private final boolean backgroundExpirationEnabled
completionLatchback to summary
private final CountDownLatch completionLatch
consecutiveAllocationFailuresback to summary
private long consecutiveAllocationFailures
deadback to summary
private final BlockingQueue<BSlot<T>> dead
defaultDeadPollTimeoutback to summary
private final long defaultDeadPollTimeout
didAnythingLastIterationback to summary
private boolean didAnythingLastIteration
disregardPileback to summary
private final RefillPile<T> disregardPile
expirationback to summary
private final Expiration<? super T> expiration
failedAllocationCountback to summary
private volatile long failedAllocationCount
leakDetectorback to summary
private final PreciseLeakDetector leakDetector
liveback to summary
private final LinkedTransferQueue<BSlot<T>> live
metricsRecorderback to summary
private final MetricsRecorder metricsRecorder
newAllocationsback to summary
private final RefillPile<T> newAllocations
poisonedSlotsback to summary
private final AtomicInteger poisonedSlots
poisonPillback to summary
private final BSlot<T> poisonPill
shutdownback to summary
private volatile boolean shutdown
shutdownPauseNanosback to summary
private static final long shutdownPauseNanos

The amount of time, in nanoseconds, to wait for more work when the shutdown process has deallocated all the dead and live slots it could get its hands on, but there are still (claimed) slots left.

sizeback to summary
private int size
targetSizeback to summary
private volatile int targetSize

Constructor Detail

BAllocThreadback to summary
pack-priv BAllocThread(LinkedTransferQueue<BSlot<T>> live, RefillPile<T> disregardPile, RefillPile<T> newAllocations, PoolBuilder<T> builder, BSlot<T> poisonPill)

Method Detail

allocback to summary
private void alloc(BSlot<T> slot)
backgroundExpirationCheckback to summary
private void backgroundExpirationCheck()
computeDeadPollTimeoutback to summary
private long computeDeadPollTimeout()
continuouslyReplenishPoolback to summary
private void continuouslyReplenishPool()
countLeakedObjectsback to summary
pack-priv long countLeakedObjects()
deallocback to summary
private void dealloc(BSlot<T> slot)
getAllocationCountback to summary
pack-priv long getAllocationCount()
getFailedAllocationCountback to summary
pack-priv long getFailedAllocationCount()
getTargetSizeback to summary
pack-priv int getTargetSize()
increaseSizeByAllocatingback to summary
private void increaseSizeByAllocating()
incrementAllocationCountsback to summary
private void incrementAllocationCounts(boolean success)
offerDeadSlotback to summary
pack-priv void offerDeadSlot(BSlot<T> slot)
proactivelyHealPoisonback to summary
private void proactivelyHealPoison()
publishSlotback to summary
private void publishSlot(BSlot<T> slot, boolean success, long now)
reallocback to summary
private void realloc(BSlot<T> slot)
reallocateDeadSlotback to summary
private void reallocateDeadSlot(BSlot<T> slot)
recordObjectLifetimeSampleback to summary
private void recordObjectLifetimeSample(long nanoseconds)
reduceSizeByDeallocatingback to summary
private void reduceSizeByDeallocating(BSlot<T> slot)
registerWithLeakDetectorback to summary
private void registerWithLeakDetector(BSlot<T> slot)
replenishPoolback to summary
private void replenishPool() throws InterruptedException
resetSlotback to summary
private void resetSlot(BSlot<T> slot, long now)
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
setTargetSizeback to summary
pack-priv void setTargetSize(int size)
shutdownback to summary
pack-priv Completion shutdown(Thread allocatorThread)
shutPoolDownback to summary
private void shutPoolDown()
unregisterWithLeakDetectorback to summary
private void unregisterWithLeakDetector(BSlot<T> slot)