Mercurial > hg > Database > Christie
comparison src/main/java/christie/test/ring/ConnectManager.java @ 35:6660ebba441e
add ring test but not working
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 18 Feb 2018 23:44:15 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
34:7b405f622c5c | 35:6660ebba441e |
---|---|
1 package christie.test.ring; | |
2 | |
3 import christie.annotation.Peek; | |
4 import christie.annotation.Take; | |
5 import christie.codegear.CodeGear; | |
6 import christie.codegear.CodeGearManager; | |
7 | |
8 public class ConnectManager extends CodeGear{ | |
9 @Take | |
10 int nodePort; | |
11 | |
12 @Peek | |
13 int max; | |
14 | |
15 @Override | |
16 protected void run(CodeGearManager cgm) { | |
17 String nodeName = "node"+(nodePort-10000); | |
18 cgm.createRemoteDGM(nodeName, "localhost", nodePort); | |
19 getDGM(nodeName).put("hostname", nodeName); | |
20 getDGM(nodeName).put("address", "localhost"); | |
21 if (nodePort-10000 < max-1){ | |
22 getDGM(nodeName).put("port", nodePort+1); | |
23 } else { | |
24 getDGM(nodeName).put("port", 10000); | |
25 cgm.setup(new StartCount()); | |
26 getLocalDGM().put("start_count", 1); | |
27 } | |
28 cgm.setup(new ConnectManager()); | |
29 } | |
30 } |