public final class ThrottlingConfig extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
ThrottlingConfig |
bucketInterval(long throttleBucketInterval,
TimeUnit unit)
Returns a copy of this config with the specified bucketing interval.
|
long |
bucketInterval(TimeUnit unit)
Returns the throttle bucketing interval in the given time units.
|
boolean |
equals(Object o) |
int |
hashCode() |
static ThrottlingConfig |
noThrottling()
Returns a config which prescribe that a replicator shouldn't throttle.
|
static ThrottlingConfig |
throttle(long maxBits,
TimeUnit perUnit)
Returns a config which throttle the specified max bits per the given time unit with default bucketing
interval.
|
long |
throttling(TimeUnit perUnit)
Returns maximum bits per the given time unit, i.
|
String |
toString() |
public static ThrottlingConfig noThrottling()
public static ThrottlingConfig throttle(long maxBits, TimeUnit perUnit)
maxBits
- the preferred maximum bitsperUnit
- the time unit per which maximum bits specifiedIllegalArgumentException
- if the specified maxBits
is non-positive valuepublic final long throttling(TimeUnit perUnit)
0
(zero) designates there
is no throttling.perUnit
- maximum bits is returned per this time unit0
if there is no throttlingpublic long bucketInterval(TimeUnit unit)
Default throttle bucketing interval is 100 millis.
unit
- the time unit of the intervalpublic ThrottlingConfig bucketInterval(long throttleBucketInterval, TimeUnit unit)
throttleBucketInterval
- the bucketing interval for throttlingunit
- the time unit of the intervalIllegalArgumentException
- if the given bucketing interval is non-positiveCopyright © 2015. All rights reserved.