mirror of https://github.com/apache/cloudstack.git
findDirectAgentToLoad ordered by clusterId
This commit is contained in:
parent
05afca54f2
commit
a72646307b
|
|
@ -67,8 +67,7 @@ public interface HostDao extends GenericDao<HostVO, Long> {
|
|||
*/
|
||||
List<HostVO> findDirectlyConnectedHosts();
|
||||
|
||||
List<HostVO> findDirectAgentToLoad(long msid, long clusterId, long lastPingSecondsAfter, Long limit);
|
||||
List<HostVO> findExternalNetworkAppliancesToLoad(long lastPingSecondsAfter);
|
||||
List<HostVO> findDirectAgentToLoad(long msid, long lastPingSecondsAfter, Long limit);
|
||||
|
||||
/**
|
||||
* Mark the host as disconnected if it is in one of these states.
|
||||
|
|
|
|||
|
|
@ -190,8 +190,6 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
|
|||
UnmanagedDirectConnectSearch = createSearchBuilder();
|
||||
UnmanagedDirectConnectSearch.and("resource", UnmanagedDirectConnectSearch.entity().getResource(), SearchCriteria.Op.NNULL);
|
||||
UnmanagedDirectConnectSearch.and("server", UnmanagedDirectConnectSearch.entity().getManagementServerId(), SearchCriteria.Op.NULL);
|
||||
UnmanagedDirectConnectSearch.and("avoidstatus", UnmanagedDirectConnectSearch.entity().getStatus(), SearchCriteria.Op.NEQ);
|
||||
UnmanagedDirectConnectSearch.and("clusterId", UnmanagedDirectConnectSearch.entity().getClusterId(), SearchCriteria.Op.EQ);
|
||||
UnmanagedDirectConnectSearch.and("lastPinged", UnmanagedDirectConnectSearch.entity().getLastPinged(), SearchCriteria.Op.LTEQ);
|
||||
|
||||
/*
|
||||
|
|
@ -257,22 +255,11 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<HostVO> findDirectAgentToLoad(long msid, long clusterId, long lastPingSecondsAfter, Long limit) {
|
||||
public List<HostVO> findDirectAgentToLoad(long msid, long lastPingSecondsAfter, Long limit) {
|
||||
SearchCriteria<HostVO> sc = UnmanagedDirectConnectSearch.create();
|
||||
sc.setParameters("avoidstatus", Status.Removed.toString());
|
||||
sc.setParameters("clusterId", clusterId);
|
||||
sc.setParameters("lastPinged", lastPingSecondsAfter);
|
||||
|
||||
return search(sc, new Filter(HostVO.class, "id", true, 0L, limit));
|
||||
sc.setParameters("lastPinged", lastPingSecondsAfter);
|
||||
return search(sc, new Filter(HostVO.class, "clusterId", true, 0L, limit));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HostVO> findExternalNetworkAppliancesToLoad(long lastPingSecondsAfter) {
|
||||
SearchCriteria<HostVO> sc = UnmanagedExternalNetworkApplianceSearch.create();
|
||||
sc.setParameters("types", new Object[]{Type.ExternalFirewall, Type.ExternalLoadBalancer});
|
||||
sc.setParameters("lastPinged", lastPingSecondsAfter);
|
||||
return search(sc, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markHostsAsDisconnected(long msId, Status... states) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue