protected static class Throttler.StreamThrottler extends Object implements IStreamThrottler
Modifier and Type | Field and Description |
---|---|
protected String[] |
binNames |
protected Throttler.ThrottlingGroup |
parent |
_rcsid
Constructor and Description |
---|
Throttler.StreamThrottler(Throttler.ThrottlingGroup parent,
String[] binNames) |
Modifier and Type | Method and Description |
---|---|
void |
closeStream()
Note the stream being closed.
|
boolean |
obtainReadPermission(int byteCount)
Obtain permission to read a block of bytes.
|
boolean |
obtainReadPermission(int byteCount,
IBreakCheck breakCheck)
Obtain permission to read a block of bytes.
|
void |
releaseReadPermission(int origByteCount,
int actualByteCount)
Note the completion of the read of a block of bytes.
|
protected final Throttler.ThrottlingGroup parent
protected final String[] binNames
public Throttler.StreamThrottler(Throttler.ThrottlingGroup parent, String[] binNames)
public boolean obtainReadPermission(int byteCount) throws InterruptedException
obtainReadPermission
in interface IStreamThrottler
byteCount
- is the number of bytes to get permissions to read.InterruptedException
public boolean obtainReadPermission(int byteCount, IBreakCheck breakCheck) throws InterruptedException, BreakException
obtainReadPermission
in interface IStreamThrottler
byteCount
- is the number of bytes to get permissions to read.breakCheck
- is the break check object.InterruptedException
BreakException
public void releaseReadPermission(int origByteCount, int actualByteCount)
releaseReadPermission
in interface IStreamThrottler
origByteCount
- is the originally requested number of bytes to get permissions to read.actualByteCount
- is the number of bytes actually read.public void closeStream()
closeStream
in interface IStreamThrottler