|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgoldengate.common.cpu.GgConstraintLimitHandler
public abstract class GgConstraintLimitHandler

Abstract class for Constraint Limit Handler for GoldenGate project
| Field Summary | |
|---|---|
String |
lastAlert
|
| Constructor Summary | |
|---|---|
GgConstraintLimitHandler()
Empty constructor |
|
GgConstraintLimitHandler(long WAITFORNETOP2,
long TIMEOUTCON2,
boolean useCpuLimit,
boolean useJdKCpuLimit,
double cpulimit,
int channellimit)
This constructor enables only Connection check ability |
|
GgConstraintLimitHandler(long WAITFORNETOP2,
long TIMEOUTCON2,
boolean useCpuLimit,
boolean useJdKCpuLimit,
double cpulimit,
int channellimit,
double lowcpuLimit,
double highcpuLimit,
double percentageDecrease,
org.jboss.netty.handler.traffic.GlobalTrafficShapingHandler handler,
long delay,
long limitLowBandwidth)
This constructor enables both Connection check ability and throttling bandwidth with cpu usage |
|
GgConstraintLimitHandler(long WAITFORNETOP2,
long TIMEOUTCON2,
boolean useJdkCpuLimit,
double lowcpuLimit,
double highcpuLimit,
double percentageDecrease,
org.jboss.netty.handler.traffic.GlobalTrafficShapingHandler handler,
long delay,
long limitLowBandwidth)
This constructor enables only throttling bandwidth with cpu usage |
|
| Method Summary | |
|---|---|
boolean |
checkConstraints()
|
boolean |
checkConstraintsSleep(int step)
Same as checkConstraints except that the thread will sleep some time proportionally to the current Load (if CPU related) |
int |
getChannelLimit()
|
double |
getCpuLimit()
|
protected abstract int |
getNumberLocalChannel()
|
protected abstract long |
getReadLimit()
Get the current setting on Read Limit (supposed to be not the value in the handler but in the configuration) |
long |
getSleepTime()
|
protected abstract long |
getWriteLimit()
Get the current setting on Write Limit (supposed to be not the value in the handler but in the configuration) |
void |
release()
Release the resources |
void |
run()
Check every delay if the current cpu usage needs to relax or to constraint the bandwidth |
void |
setChannelLimit(int channelLimit)
|
void |
setCpuLimit(double cpuLimit)
|
void |
setHandler(org.jboss.netty.handler.traffic.GlobalTrafficShapingHandler handler)
Set the handler |
void |
setServer(boolean isServer)
To explicitly set this handler as server mode |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public String lastAlert
| Constructor Detail |
|---|
public GgConstraintLimitHandler()
public GgConstraintLimitHandler(long WAITFORNETOP2,
long TIMEOUTCON2,
boolean useJdkCpuLimit,
double lowcpuLimit,
double highcpuLimit,
double percentageDecrease,
org.jboss.netty.handler.traffic.GlobalTrafficShapingHandler handler,
long delay,
long limitLowBandwidth)
WAITFORNETOP2 - 1000 ms as wait for a network operationTIMEOUTCON2 - 10000 ms as timeout limituseJdkCpuLimit - True to use JDK Cpu native or False for JavaSysMonlowcpuLimit - for proactive cpu limitation (throttling bandwidth) (0<= x < 1 & highcpulimit)highcpuLimit - for proactive cpu limitation (throttling bandwidth) (0<= x <= 1) 0 meaning no throttle activatedpercentageDecrease - for proactive cpu limitation, throttling bandwidth reduction (0 < x < 1) as 0.25 for 25% of reductionhandler - the GlobalTrafficShapingHandler associated (null to have no proactive cpu limitation)delay - the delay between 2 tests for proactive cpu limitationlimitLowBandwidth - the minimal bandwidth (read or write) to apply when decreasing bandwidth (low limit = 4096)
public GgConstraintLimitHandler(long WAITFORNETOP2,
long TIMEOUTCON2,
boolean useCpuLimit,
boolean useJdKCpuLimit,
double cpulimit,
int channellimit)
useCpuLimit - True to enable cpuLimit on connection checkuseJdKCpuLimit - True to use JDK Cpu native or False for JavaSysMoncpulimit - high cpu limit (0<= x < 1) to refuse new connectionschannellimit - number of connection limit (0<= x)
public GgConstraintLimitHandler(long WAITFORNETOP2,
long TIMEOUTCON2,
boolean useCpuLimit,
boolean useJdKCpuLimit,
double cpulimit,
int channellimit,
double lowcpuLimit,
double highcpuLimit,
double percentageDecrease,
org.jboss.netty.handler.traffic.GlobalTrafficShapingHandler handler,
long delay,
long limitLowBandwidth)
WAITFORNETOP2 - 1000 ms as wait for a network operationTIMEOUTCON2 - 10000 ms as timeout limituseCpuLimit - True to enable cpuLimit on connection checkuseJdKCpuLimit - True to use JDK Cpu native or False for JavaSysMoncpulimit - high cpu limit (0<= x < 1) to refuse new connectionschannellimit - number of connection limit (0<= x)lowcpuLimit - for proactive cpu limitation (throttling bandwidth) (0<= x < 1 & highcpulimit)highcpuLimit - for proactive cpu limitation (throttling bandwidth) (0<= x <= 1) 0 meaning no throttle activatedpercentageDecrease - for proactive cpu limitation, throttling bandwidth reduction (0 < x < 1) as 0.25 for 25% of reductionhandler - the GlobalTrafficShapingHandler associated (null to have no proactive cpu limitation)delay - the delay between 2 tests for proactive cpu limitationlimitLowBandwidth - the minimal bandwidth (read or write) to apply when decreasing bandwidth (low limit = 4096)| Method Detail |
|---|
public void release()
public void setServer(boolean isServer)
isServer - public boolean checkConstraints()
protected abstract int getNumberLocalChannel()
public boolean checkConstraintsSleep(int step)
step - the current step in retry
public long getSleepTime()
public double getCpuLimit()
public void setCpuLimit(double cpuLimit)
cpuLimit - the cpuLimit to setpublic int getChannelLimit()
public void setChannelLimit(int channelLimit)
channelLimit - the channelLimit to setprotected abstract long getReadLimit()
protected abstract long getWriteLimit()
public void setHandler(org.jboss.netty.handler.traffic.GlobalTrafficShapingHandler handler)
handler - public void run()
run in interface Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||