public class ThrottleBin
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
ThrottleBin.SumClass |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
binName
This is the bin name which this throttle belongs to.
|
protected boolean |
estimateInProgress
Flag indicating whether rate estimation is in progress yet
|
protected boolean |
estimateValid
Flag indicating whether a rate estimate is needed
|
protected boolean |
isAlive
This signals whether the bin is alive or not.
|
protected double |
localMinimum
The local minimum milliseconds per byte
|
protected double |
minimumMillisecondsPerByte
The minimum milliseconds per byte
|
protected double |
rateEstimate
The inverse rate estimate of the first fetch, in ms/byte
|
protected int |
refCount
This is the reference count for this bin (which records active references)
|
protected long |
seriesStartTime
The start time of this series
|
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 throttle bins
|
protected java.lang.String |
targetCalcLockName
The target calculation lock name
|
protected static java.lang.String |
targetCalcLockPrefix
The target calculation lock prefix
|
protected long |
totalBytesRead
Total actual bytes read in this series; this includes fetches in progress
|
Constructor and Description |
---|
ThrottleBin(IThreadContext threadContext,
java.lang.String throttlingGroupName,
java.lang.String binName)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
abortFetch()
Abort the fetch.
|
void |
abortRead()
Abort a read in progress.
|
void |
beginFetch()
Note the start of a fetch operation for a bin.
|
boolean |
beginRead(int byteCount,
IBreakCheck breakCheck)
Note the start of an individual byte read of a specified size.
|
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) |
boolean |
endFetch()
Note the end of a fetch operation.
|
void |
endRead(int originalCount,
int actualCount)
Note the end of an individual read from the server.
|
java.lang.String |
getBinName()
Get the bin name.
|
protected static byte[] |
pack(double targetDouble) |
void |
poll(IThreadContext threadContext)
Poll this bin
|
void |
shutDown(IThreadContext threadContext)
Shut down this bin.
|
protected static double |
unpackTarget(byte[] data) |
void |
updateMinimumMillisecondsPerByte(double min)
Update minimumMillisecondsPerBytePerServer
|
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 double minimumMillisecondsPerByte
protected double localMinimum
protected volatile int refCount
protected double rateEstimate
protected volatile boolean estimateValid
protected volatile boolean estimateInProgress
protected long seriesStartTime
protected long totalBytesRead
protected static final java.lang.String serviceTypePrefix
protected static final java.lang.String targetCalcLockPrefix
public ThrottleBin(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 updateMinimumMillisecondsPerByte(double min)
public void beginFetch()
public void abortFetch()
public boolean beginRead(int byteCount, IBreakCheck breakCheck) throws java.lang.InterruptedException, BreakException
java.lang.InterruptedException
BreakException
public void abortRead()
public void endRead(int originalCount, int actualCount)
public boolean endFetch()
public void poll(IThreadContext threadContext) throws ManifoldCFException
ManifoldCFException
public void shutDown(IThreadContext threadContext) throws ManifoldCFException
ManifoldCFException
protected static double unpackTarget(byte[] data)
protected static byte[] pack(double targetDouble)