parent
e682f608b5
commit
20094a2a30
|
@ -17,10 +17,6 @@ public interface HighAvailablePool {
|
|||
|
||||
public void remove(Agent agent);
|
||||
|
||||
public void addABlotter(RunningAgentInterface runningAgent);
|
||||
|
||||
public void removeABlotter(UUID agentRunId);
|
||||
|
||||
public int blotterSize();
|
||||
|
||||
public Long getMaxAvailableLoad();
|
||||
|
|
|
@ -145,10 +145,8 @@ public class HighAvailablePoolImpl extends CurrentLoadSubject implements
|
|||
|
||||
@Scheduled(cron = "0,30 */2 * * * *")
|
||||
public synchronized void checkAllHeartBeat() {
|
||||
long time = System.nanoTime();
|
||||
heartBeatsAndUpdateHAPool();
|
||||
doSubstituteIfRequired();
|
||||
System.out.println("finish heart beat:" + (System.nanoTime() - time));
|
||||
}
|
||||
|
||||
private void heartBeatsAndUpdateHAPool() {
|
||||
|
@ -161,7 +159,7 @@ public class HighAvailablePoolImpl extends CurrentLoadSubject implements
|
|||
this.updateAgentPoolByHeart(map);
|
||||
}
|
||||
|
||||
private void updateAgentPoolByHeart(
|
||||
private void updateAgentPoolByHeart(
|
||||
Map<Agent, Future<ServerStatusModel>> map) {
|
||||
this.setCurrentAvailableLoad(0);
|
||||
this.setMaxAvailableLoad((long) 0);
|
||||
|
@ -212,12 +210,12 @@ public class HighAvailablePoolImpl extends CurrentLoadSubject implements
|
|||
this.setCurrentAvailableLoad(availableLoad);
|
||||
}
|
||||
|
||||
public void addABlotter(RunningAgentInterface runningAgent) {
|
||||
private void addABlotter(RunningAgentInterface runningAgent) {
|
||||
this.getAgentRunBlotters().put(runningAgent.getAgentRunId(),
|
||||
runningAgent);
|
||||
}
|
||||
|
||||
public void removeABlotter(UUID agentRunId) {
|
||||
private void removeABlotter(UUID agentRunId) {
|
||||
this.getAgentRunBlotters().remove(agentRunId);
|
||||
}
|
||||
|
||||
|
|
|
@ -85,24 +85,12 @@ public class HighAvailableImpl implements HighAvailablePool {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeABlotter(UUID agentRunId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int blotterSize() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addABlotter(RunningAgentInterface runningAgent) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Agent agent) {
|
||||
// TODO Auto-generated method stub
|
||||
|
|
Loading…
Reference in New Issue