public class FetchBin extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
FetchBin.SumClass |
Modifier and Type | Field and Description |
---|---|
protected 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 String |
serviceName
The (anonymous) service name
|
protected String |
serviceTypeName
Service type name
|
protected static String |
serviceTypePrefix
The service type prefix for fetch bins
|
protected String |
targetCalcLockName
The target calculation lock name
|
protected static String |
targetCalcLockPrefix
The target calculation lock prefix
|
Constructor and Description |
---|
FetchBin(IThreadContext threadContext,
String throttlingGroupName,
String binName)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected static String |
buildServiceTypeName(String throttlingGroupName,
String binName) |
protected static String |
buildTargetCalcLockName(String throttlingGroupName,
String binName) |
void |
clearReservation()
Clear reserved request.
|
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 String binName
protected final String serviceTypeName
protected final String serviceName
protected final String targetCalcLockName
protected long minTimeBetweenFetches
protected long localMinimum
protected long lastFetchTime
protected boolean reserveNextFetch
protected static final String serviceTypePrefix
protected static final String targetCalcLockPrefix
public FetchBin(IThreadContext threadContext, String throttlingGroupName, String binName) throws ManifoldCFException
ManifoldCFException
protected static String buildServiceTypeName(String throttlingGroupName, String binName)
protected static String buildTargetCalcLockName(String throttlingGroupName, String binName)
public String getBinName()
public void updateMinTimeBetweenFetches(long minTimeBetweenFetches)
public boolean reserveFetchRequest(IBreakCheck breakCheck) throws InterruptedException, BreakException
InterruptedException
BreakException
public void clearReservation()
public boolean waitNextFetch(IBreakCheck breakCheck) throws InterruptedException, BreakException
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)