Mercurial > hg > Members > tatsuki > Alice
view src/alice/test/topology/ring/CheckMyName.java @ 70:f2d4a4686036
delete CodeSegment receive thread
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 21 Feb 2012 20:09:18 +0900 |
parents | ca42a2c8ac22 |
children | 4a2ecd0a5e8f |
line wrap: on
line source
package alice.test.topology.ring; import org.apache.log4j.Logger; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class CheckMyName extends CodeSegment { public Receiver host = ids.create(CommandType.PEEK); private Logger logger = Logger.getLogger(CheckMyName.class); private RingTopologyConfig conf; public CheckMyName(RingTopologyConfig conf) { this.conf = conf; } @Override public void run() { String host = this.host.asString(); logger.debug(host); if (host.equals("node0")) { ods.put("local", "c", new byte[conf.size]); FirstRingMessagePassing cs1 = new FirstRingMessagePassing(System.nanoTime(), conf.count, conf.nodeNum); cs1.counter.setKey("c"); RingFinish cs2 = new RingFinish("manager"); cs2.finish.setKey("finish"); } else { ods.close("manager"); RingMessagePassing cs1 = new RingMessagePassing(); cs1.counter.setKey("c"); RingFinish cs2 = new RingFinish("right"); cs2.finish.setKey("finish"); } } }