|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.replication.regionserver.ReplicationThrottler
@InterfaceAudience.Private public class ReplicationThrottler
Per-peer per-node throttling controller for replication: enabled if bandwidth > 0, a cycle = 100ms, by throttling we guarantee data pushed to peer within each cycle won't exceed 'bandwidth' bytes
Constructor Summary | |
---|---|
ReplicationThrottler(double bandwidth)
ReplicationThrottler constructor If bandwidth less than 1, throttling is disabled |
Method Summary | |
---|---|
void |
addPushSize(int size)
Add current size to the current cycle's total push size |
long |
getNextSleepInterval(int size)
Get how long the caller should sleep according to the current size and current cycle's total push size and start tick, return the sleep interval for throttling control. |
boolean |
isEnabled()
If throttling is enabled |
void |
resetStartTick()
Reset the cycle start tick to NOW |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReplicationThrottler(double bandwidth)
bandwidth
- per cycle(100ms)Method Detail |
---|
public boolean isEnabled()
public long getNextSleepInterval(int size)
size
- is the size of edits to be pushed
public void addPushSize(int size)
size
- is the current size added to the current cycle's
total push sizepublic void resetStartTick()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |