use of com.cubrid.cubridmanager.core.mondashboard.model.DbProcessStatusInfo in project cubrid-manager by CUBRID.
the class HAUtil method getActiveCopyLogDbProcessStatusInfo.
/**
*
* Get the Copy Log DB process status information of active node from
* standby node
*
* @param dbNode DatabaseNode
* @return DbProcessStatusInfo
*/
public static DbProcessStatusInfo getActiveCopyLogDbProcessStatusInfo(DatabaseNode dbNode) {
HADatabaseStatusInfo dbStatusInfo = dbNode.getHaDatabaseStatus();
if (dbStatusInfo == null) {
return null;
}
DBStatusType dbStatusType = dbStatusInfo.getStatusType();
if (dbStatusType != DBStatusType.STANDBY && dbStatusType != DBStatusType.MAINTENANCE) {
return null;
}
List<DbProcessStatusInfo> dbProcessList = dbStatusInfo.getCopyLogDbProcessStatusList();
if (dbProcessList == null || dbProcessList.isEmpty()) {
return null;
}
HAHostStatusInfo hostStatusInfo = dbNode.getParent().getHostStatusInfo();
if (hostStatusInfo.getStatusType() != HostStatusType.SLAVE && hostStatusInfo.getStatusType() != HostStatusType.REPLICA) {
return null;
}
HAHostStatusInfo masterHostStatusInfo = hostStatusInfo.getMasterHostStatusInfo();
if (masterHostStatusInfo == null) {
return null;
}
String masterHostName = masterHostStatusInfo.getHostName();
for (DbProcessStatusInfo processStatusInfo : dbProcessList) {
if (masterHostName.equals(processStatusInfo.getHostName())) {
return processStatusInfo;
}
}
return null;
}
Aggregations