public class FetchBin
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
FetchBin.SumClass |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
binName
This is the bin name which this connection pool belongs to
|
protected boolean |
isAlive
This is set to true until the bin is shut down.
|
protected long |
lastFetchTime
This is the last time a fetch was done on this bin
|
protected long |
localMinimum
The local minimum time between fetches
|
protected long |
minTimeBetweenFetches
This is the minimum time between fetches for this bin, in ms.
|
protected boolean |
reserveNextFetch
Is the next fetch reserved?
|
protected java.lang.String |
serviceName
The (anonymous) service name
|
protected java.lang.String |
serviceTypeName
Service type name
|
protected static java.lang.String |
serviceTypePrefix
The service type prefix for fetch bins
|
protected java.lang.String |
targetCalcLockName
The target calculation lock name
|
protected static java.lang.String |
targetCalcLockPrefix
The target calculation lock prefix
|
Constructor and Description |
---|
FetchBin(IThreadContext threadContext,
java.lang.String throttlingGroupName,
java.lang.String binName)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected static java.lang.String |
buildServiceTypeName(java.lang.String throttlingGroupName,
java.lang.String binName) |
protected static java.lang.String |
buildTargetCalcLockName(java.lang.String throttlingGroupName,
java.lang.String binName) |
void |
clearReservation()
Clear reserved request.
|
java.lang.String |
getBinName()
Get the bin name.
|
protected static byte[] |
pack(double targetDouble,
long earliestTime) |
void |
poll(IThreadContext threadContext)
Poll this bin
|
boolean |
reserveFetchRequest(IBreakCheck breakCheck)
Reserve a request to fetch a document from this bin.
|
void |
shutDown(IThreadContext threadContext)
Shut the bin down, and wake up all threads waiting on it.
|
protected static long |
unpackEarliestTime(byte[] data) |
protected static double |
unpackTarget(byte[] data) |
void |
updateMinTimeBetweenFetches(long minTimeBetweenFetches)
Update the maximum number of active connections.
|
boolean |
waitNextFetch(IBreakCheck breakCheck)
Wait the necessary time to do the fetch.
|
protected boolean isAlive
protected final java.lang.String binName
protected final java.lang.String serviceTypeName
protected final java.lang.String serviceName
protected final java.lang.String targetCalcLockName
protected long minTimeBetweenFetches
protected long localMinimum
protected long lastFetchTime
protected boolean reserveNextFetch
protected static final java.lang.String serviceTypePrefix
protected static final java.lang.String targetCalcLockPrefix
public FetchBin(IThreadContext threadContext, java.lang.String throttlingGroupName, java.lang.String binName) throws ManifoldCFException
ManifoldCFException
protected static java.lang.String buildServiceTypeName(java.lang.String throttlingGroupName, java.lang.String binName)
protected static java.lang.String buildTargetCalcLockName(java.lang.String throttlingGroupName, java.lang.String binName)
public java.lang.String getBinName()
public void updateMinTimeBetweenFetches(long minTimeBetweenFetches)
public boolean reserveFetchRequest(IBreakCheck breakCheck) throws java.lang.InterruptedException, BreakException
java.lang.InterruptedException
BreakException
public void clearReservation()
public boolean waitNextFetch(IBreakCheck breakCheck) throws java.lang.InterruptedException, BreakException
java.lang.InterruptedException
BreakException
public void poll(IThreadContext threadContext) throws ManifoldCFException
ManifoldCFException
public void shutDown(IThreadContext threadContext) throws ManifoldCFException
ManifoldCFException
protected static double unpackTarget(byte[] data)
protected static long unpackEarliestTime(byte[] data)
protected static byte[] pack(double targetDouble, long earliestTime)