Modifier and Type | Field and Description |
---|---|
protected Map<String,ConnectionBin> |
connectionBins
The connection bins
|
protected Map<String,FetchBin> |
fetchBins
The fetch bins
|
protected Map<String,ThrottleBin> |
throttleBins
The throttle bins
|
protected IThrottleSpec |
throttleSpec
The current throttle spec
|
protected String |
throttlingGroupName
The throttling group name
|
Constructor and Description |
---|
Throttler.ThrottlingGroup(IThreadContext threadContext,
String throttlingGroupType,
String throttleGroup,
IThrottleSpec throttleSpec)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkDestroyPooledConnection(String[] binNames,
AtomicInteger[] poolCounts) |
boolean |
checkExpireConnection(String[] binNames,
AtomicInteger[] poolCounts)
Connection expiration is tricky, because even though a connection may be identified as
being expired, at the very same moment it could be handed out in another thread.
|
void |
closeStream(String[] binNames)
Note the stream being closed.
|
IStreamThrottler |
createFetchStream(String[] binNames) |
void |
destroy(IThreadContext threadContext)
Destroy this pool.
|
void |
freeUnusedResources(IThreadContext threadContext)
Free unused resources.
|
IFetchThrottler |
getNewConnectionFetchThrottler(String[] binNames) |
void |
noteConnectionDestroyed(String[] binNames) |
void |
noteConnectionReturnedToPool(String[] binNames,
AtomicInteger[] poolCounts) |
boolean |
noteReturnedConnection(String[] binNames) |
IConnectionThrottler |
obtainConnectionThrottler(IThreadContext threadContext,
String[] binNames)
Create a bunch of bins, corresponding to the bin names specified.
|
boolean |
obtainFetchDocumentPermission(String[] binNames,
IBreakCheck breakCheck)
Get permission to fetch a document.
|
boolean |
obtainReadPermission(String[] binNames,
int byteCount,
IBreakCheck breakCheck)
Obtain permission to read a block of bytes.
|
void |
poll(IThreadContext threadContext)
Call this periodically.
|
void |
releaseReadPermission(String[] binNames,
int origByteCount,
int actualByteCount)
Note the completion of the read of a block of bytes.
|
void |
updateThrottleSpecification(IThrottleSpec throttleSpec)
Update the throttle spec.
|
int |
waitConnectionAvailable(String[] binNames,
AtomicInteger[] poolCounts,
IBreakCheck breakCheck)
Wait for a connection to become available.
|
protected final String throttlingGroupName
protected IThrottleSpec throttleSpec
protected final Map<String,ConnectionBin> connectionBins
protected final Map<String,ThrottleBin> throttleBins
public Throttler.ThrottlingGroup(IThreadContext threadContext, String throttlingGroupType, String throttleGroup, IThrottleSpec throttleSpec) throws ManifoldCFException
ManifoldCFException
public IConnectionThrottler obtainConnectionThrottler(IThreadContext threadContext, String[] binNames) throws ManifoldCFException
binNames
- describes the set of bins to create.ManifoldCFException
public void updateThrottleSpecification(IThrottleSpec throttleSpec) throws ManifoldCFException
throttleSpec
- is the new throttle spec for this throttle group.ManifoldCFException
public int waitConnectionAvailable(String[] binNames, AtomicInteger[] poolCounts, IBreakCheck breakCheck) throws InterruptedException, BreakException
poolCount
- is a description of how many connections
are available in the current pool, across all bins.InterruptedException
BreakException
public IFetchThrottler getNewConnectionFetchThrottler(String[] binNames)
public boolean noteReturnedConnection(String[] binNames)
public boolean checkDestroyPooledConnection(String[] binNames, AtomicInteger[] poolCounts)
public boolean checkExpireConnection(String[] binNames, AtomicInteger[] poolCounts)
public void noteConnectionReturnedToPool(String[] binNames, AtomicInteger[] poolCounts)
public void noteConnectionDestroyed(String[] binNames)
public boolean obtainFetchDocumentPermission(String[] binNames, IBreakCheck breakCheck) throws InterruptedException, BreakException
binNames
- are the names of the bins.InterruptedException
BreakException
public IStreamThrottler createFetchStream(String[] binNames)
public boolean obtainReadPermission(String[] binNames, int byteCount, IBreakCheck breakCheck) throws InterruptedException, BreakException
byteCount
- is the number of bytes to get permissions to read.InterruptedException
BreakException
public void releaseReadPermission(String[] binNames, int origByteCount, int actualByteCount)
origByteCount
- is the originally requested number of bytes to get permissions to read.actualByteCount
- is the number of bytes actually read.public void closeStream(String[] binNames)
public void poll(IThreadContext threadContext) throws ManifoldCFException
ManifoldCFException
public void freeUnusedResources(IThreadContext threadContext) throws ManifoldCFException
ManifoldCFException
public void destroy(IThreadContext threadContext) throws ManifoldCFException
ManifoldCFException