[유치수] [NOBTS] 서버맵의 어플리케이션 상세정보 창에 물리서버에 포트번호가 붙어서 group by가 잘못되는 문제 해결.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-web/trunk@2651 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Chisu Yu
2013-10-30 05:50:57 +00:00
parent 4a8eaf0167
commit e53c3d8943
@@ -47,24 +47,30 @@ public class Application implements Comparable<Application>, Mergeable<Applicati
return serverInstanceList;
}
/**
* 어플리케이션에 속한 물리서버와 서버 인스턴스 정보를 채운다.
*
* @param hostHistogram
*/
private void fillServerInstanceList(final Map<String, Host> hostHistogram) {
if (hostHistogram == null) {
return;
}
for (Entry<String, Host> entry : hostHistogram.entrySet()) {
String name = entry.getKey();
String instanceName = entry.getKey();
int pos = instanceName.indexOf(':');
String hostName = (pos > 0) ? instanceName.substring(0, pos) : instanceName;
ServiceType serviceType = entry.getValue().getServiceType();
MergeableMap<String, ServerInstance> serverInstanceMap = serverInstanceList.get(name);
ServerInstance serverInstance = new ServerInstance(name, serviceType, null);
ServerInstance serverInstance = new ServerInstance(instanceName, serviceType, null);
MergeableMap<String, ServerInstance> serverInstanceMap = serverInstanceList.get(hostName);
if (serverInstanceMap == null) {
MergeableMap<String, ServerInstance> value = new MergeableTreeMap<String, ServerInstance>();
value.put(serverInstance.getId(), serverInstance);
serverInstanceList.put(name, value);
serverInstanceList.put(hostName, value);
} else {
MergeableMap<String, ServerInstance> map = serverInstanceList.get(name);
MergeableMap<String, ServerInstance> map = serverInstanceList.get(hostName);
map.putOrMerge(serverInstance.getId(), serverInstance);
}
}