comparison src/main/java/christie/topology/manager/SearchHostName.java @ 50:8dfd93810041

fix config and HostMessage
author akahori
date Thu, 23 Aug 2018 09:30:36 +0900
parents ea9657dc8311
children cfd79a71f9cd
comparison
equal deleted inserted replaced
49:fd944876257b 50:8dfd93810041
32 32
33 33
34 // Question: remove処理 どうしようか. いらない気もする. 34 // Question: remove処理 どうしようか. いらない気もする.
35 // DataSegment.remove(hostInfo.absName); 35 // DataSegment.remove(hostInfo.absName);
36 36
37 cgm.createRemoteDGM(reconnectHost.absName, reconnectHost.name, reconnectHost.port); 37 cgm.createRemoteDGM(reconnectHost.absName, reconnectHost.hostName, reconnectHost.port);
38 getDGM(reconnectHost.absName).put("host", reconnectHost.absName); 38 getDGM(reconnectHost.absName).put("host", reconnectHost.absName);
39 39
40 // put Host dataSegment on reconnect node 40 // put Host dataSegment on reconnect node
41 if (topology.containsKey(reconnectHost.absName)) { 41 if (topology.containsKey(reconnectHost.absName)) {
42 42
60 for (HostMessage host : list){ 60 for (HostMessage host : list){
61 61
62 // find and update old info 62 // find and update old info
63 if (!reconnectHost.absName.equals(host.absName)) continue; 63 if (!reconnectHost.absName.equals(host.absName)) continue;
64 64
65 if (!reconnectHost.name.equals(host.name) || reconnectHost.port != host.port){ 65 if (!reconnectHost.hostName.equals(host.hostName) || reconnectHost.port != host.port){
66 host.name = reconnectHost.name; 66 host.hostName = reconnectHost.hostName;
67 host.port = reconnectHost.port; 67 host.port = reconnectHost.port;
68 68
69 getLocalDGM().put(host.remoteAbsName, host); 69 getLocalDGM().put(host.remoteAbsName, host);
70 70
71 } else { 71 } else {
75 } 75 }
76 76
77 for (LinkedList<HostMessage> list :topology.values()){ 77 for (LinkedList<HostMessage> list :topology.values()){
78 System.out.print(list.get(0).remoteAbsName+" : "); 78 System.out.print(list.get(0).remoteAbsName+" : ");
79 for (HostMessage host : list){ 79 for (HostMessage host : list){
80 System.out.print("[ "+host.absName+" "+host.name+" "+host.port+" "+host.connectionName+" "+host.reverseName+" "+host.remoteAbsName+" ]"); 80 System.out.print("[ "+host.absName+" "+host.hostName+" "+host.port+" "+host.connectionName+" "+host.reverseName+" "+host.remoteAbsName+" ]");
81 } 81 }
82 System.out.println(); 82 System.out.println();
83 } 83 }
84 84
85 getLocalDGM().put("topology", topology); 85 getLocalDGM().put("topology", topology);