Mercurial > hg > Database > Alice
comparison src/main/java/alice/topology/node/IncomingConnectionInfo.java @ 419:aefbe41fcf12 dispose
change tab to space
author | sugi |
---|---|
date | Tue, 15 Jul 2014 16:00:22 +0900 |
parents | 6508ed6ea6a6 |
children | 1b32ea1263f3 |
comparison
equal
deleted
inserted
replaced
418:a269a019f5f8 | 419:aefbe41fcf12 |
---|---|
8 import alice.datasegment.Receiver; | 8 import alice.datasegment.Receiver; |
9 import alice.topology.HostMessage; | 9 import alice.topology.HostMessage; |
10 | 10 |
11 public class IncomingConnectionInfo extends CodeSegment { | 11 public class IncomingConnectionInfo extends CodeSegment { |
12 | 12 |
13 public Receiver hostInfo = ids.create(CommandType.TAKE); | 13 public Receiver hostInfo = ids.create(CommandType.TAKE); |
14 private String absName; | 14 private String absName; |
15 private int count; | 15 private int count; |
16 | 16 |
17 public IncomingConnectionInfo(String absName, int count) { | 17 public IncomingConnectionInfo(String absName, int count) { |
18 this.absName = absName; | 18 this.absName = absName; |
19 this.count = count; | 19 this.count = count; |
20 } | 20 } |
21 | 21 |
22 | 22 |
23 @Override | 23 @Override |
24 public void run() { | 24 public void run() { |
25 if (this.hostInfo.getVal() == null) { | 25 if (this.hostInfo.getVal() == null) { |
26 ods.put("local", "configNodeNum", count); | 26 ods.put("local", "configNodeNum", count); |
27 } else { | 27 } else { |
28 if (count == 0) | 28 if (count == 0) |
29 ods.put("_CLIST", new ArrayList<String>()); | 29 ods.put("_CLIST", new ArrayList<String>()); |
30 | 30 |
31 HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); | 31 HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); |
32 DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); | 32 DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); |
33 ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); | 33 ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); |
34 ods.put("cMember", hostInfo.connectionName); | 34 ods.put("cMember", hostInfo.connectionName); |
35 count++; | 35 count++; |
36 | 36 |
37 new CreateConnectionList(); | 37 new CreateConnectionList(); |
38 } | 38 } |
39 IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, count); | 39 IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, count); |
40 cs.hostInfo.setKey("manager", absName); | 40 cs.hostInfo.setKey("manager", absName); |
41 } | 41 } |
42 | 42 |
43 } | 43 } |