@Beta public final class DefaultTokenBucket extends Object implements TokenBucket, TokenBucketEntry
Modifier and Type | Class and Description |
---|---|
static class |
DefaultTokenBucket.Builder
Implementation of the token bucket builder interface.
|
TokenBucket.Action, TokenBucket.Type
MAX_DSCP, MIN_DSCP
Modifier and Type | Method and Description |
---|---|
TokenBucket.Action |
action()
Action used by this token bucket
for the exceeding traffic.
|
static DefaultTokenBucket.Builder |
builder()
Returns a new builder reference.
|
long |
burstSize()
Maximum burst size subject to the SLAs
specified for this token bucket.
|
short |
dscp()
Dscp value, it meaning depends on the used marking.
|
boolean |
equals(Object o) |
int |
hashCode() |
long |
processedBytes()
Stats which reports how many bytes have been
processed so far.
|
long |
processedPackets()
Stats which reports how many packets have been
processed so far.
|
long |
rate()
Rate of traffic subject to the SLAs
specified for this token bucket.
|
void |
setProcessedBytes(long bytes)
Updates the number of bytes seen by this token bucket.
|
void |
setProcessedPackets(long packets)
Updates the number of packets seen by this token bucket.
|
String |
toString() |
TokenBucket.Type |
type()
Token bucket type.
|
public long rate()
TokenBucket
rate
in interface TokenBucket
public long burstSize()
TokenBucket
burstSize
in interface TokenBucket
public TokenBucket.Action action()
TokenBucket
action
in interface TokenBucket
public short dscp()
TokenBucket
dscp
in interface TokenBucket
public TokenBucket.Type type()
TokenBucket
type
in interface TokenBucket
public long processedPackets()
TokenBucket
processedPackets
in interface TokenBucket
public void setProcessedPackets(long packets)
TokenBucketEntry
setProcessedPackets
in interface TokenBucketEntry
packets
- a packet count.public long processedBytes()
TokenBucket
processedBytes
in interface TokenBucket
public void setProcessedBytes(long bytes)
TokenBucketEntry
setProcessedBytes
in interface TokenBucketEntry
bytes
- a byte counter.public static DefaultTokenBucket.Builder builder()