@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.TypeMAX_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()
TokenBucketrate in interface TokenBucketpublic long burstSize()
TokenBucketburstSize in interface TokenBucketpublic TokenBucket.Action action()
TokenBucketaction in interface TokenBucketpublic short dscp()
TokenBucketdscp in interface TokenBucketpublic TokenBucket.Type type()
TokenBuckettype in interface TokenBucketpublic long processedPackets()
TokenBucketprocessedPackets in interface TokenBucketpublic void setProcessedPackets(long packets)
TokenBucketEntrysetProcessedPackets in interface TokenBucketEntrypackets - a packet count.public long processedBytes()
TokenBucketprocessedBytes in interface TokenBucketpublic void setProcessedBytes(long bytes)
TokenBucketEntrysetProcessedBytes in interface TokenBucketEntrybytes - a byte counter.public static DefaultTokenBucket.Builder builder()