mirror of https://github.com/apache/cloudstack.git
Allow to query management server node alive status
This commit is contained in:
parent
ade92456df
commit
cbb5aa0e89
|
|
@ -44,6 +44,7 @@ public interface ClusterManager extends Manager {
|
|||
public int getHeartbeatThreshold();
|
||||
public long getId();
|
||||
public long getCurrentRunId();
|
||||
public boolean isManageemnNodeAlive(long msid);
|
||||
public String getSelfPeerName();
|
||||
public String getSelfNodeIP();
|
||||
public String getPeerName(long agentHostId);
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ import javax.naming.ConfigurationException;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.agent.AgentManager;
|
||||
import com.cloud.agent.Listener;
|
||||
import com.cloud.agent.AgentManager.OnError;
|
||||
import com.cloud.agent.Listener;
|
||||
import com.cloud.agent.api.Answer;
|
||||
import com.cloud.agent.api.ChangeAgentCommand;
|
||||
import com.cloud.agent.api.Command;
|
||||
|
|
@ -781,6 +781,17 @@ public class ClusterManagerImpl implements ClusterManager {
|
|||
return _runId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isManageemnNodeAlive(long msid) {
|
||||
ManagementServerHostVO mshost = _mshostDao.findById(msid);
|
||||
if(mshost != null) {
|
||||
if(mshost.getLastUpdateTime().getTime() >= DateUtil.currentGMTTime().getTime() - heartbeatThreshold)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeartbeatThreshold() {
|
||||
return this.heartbeatThreshold;
|
||||
|
|
|
|||
|
|
@ -101,6 +101,10 @@ public class DummyClusterManagerImpl implements ClusterManager {
|
|||
public String getSelfNodeIP() {
|
||||
return _clusterNodeIP;
|
||||
}
|
||||
|
||||
public boolean isManageemnNodeAlive(long msid) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getPeerName(long agentHostId) {
|
||||
throw new CloudRuntimeException("Unsupported feature");
|
||||
|
|
|
|||
Loading…
Reference in New Issue