diff src/main/java/christie/test/topology/paxos/StartLocalPaxos.java @ 166:f2218b5590d3

add CheckMyName
author akahori
date Tue, 22 Jan 2019 15:07:12 +0900
parents c6250ad544e0
children dd3c0ba6a0a6
line wrap: on
line diff
--- a/src/main/java/christie/test/topology/paxos/StartLocalPaxos.java	Tue Jan 22 14:48:02 2019 +0900
+++ b/src/main/java/christie/test/topology/paxos/StartLocalPaxos.java	Tue Jan 22 15:07:12 2019 +0900
@@ -35,9 +35,12 @@
         for(int i = 0; i < learnersNum; i++){
             String nodeName = "learner" + i;
             acceptorTopoDG.addConnection(nodeName);
+            TopologyDataGear topoDG = new TopologyDataGear();
 
             CodeGearManager learner = createCGM(learnerPort + i);
-            learner.setup(new LearnerCodeGear());
+            topoDG.setNodeName(nodeName);
+            learner.getLocalDGM().put("topoDG", topoDG);
+            learner.setup(new CheckMyName());
             learners.add(learner);
         }
 
@@ -49,7 +52,7 @@
             TopologyDataGear topoDG = acceptorTopoDG.clone();
             topoDG.setNodeName(nodeName);
             acceptor.getLocalDGM().put("topoDG", topoDG);
-            acceptor.setup(new AcceptorCodeGear());
+            acceptor.setup(new CheckMyName());
             acceptors.add(acceptor);
         }
 
@@ -71,7 +74,7 @@
                 acceptors.get(j).createRemoteDGM("proposer" + i, "localhost", proposers.get(i).localPort);
 
             }
-            proposers.get(i).setup(new ProposerCodeGear());
+            proposers.get(i).setup(new CheckMyName());
         }
 
         for(int i = 0; i < acceptorsNum; i++){