comparison src/main/java/alice/test/codesegment/remote/RemoteIncrement.java @ 647:e321c5ec9b58

fix toplogy manager; ring worked
author suruga
date Sun, 31 Dec 2017 19:32:27 +0900
parents 646f705e65b1
children
comparison
equal deleted inserted replaced
646:3c060de44c2e 647:e321c5ec9b58
1 package alice.test.codesegment.remote; 1 package alice.test.codesegment.remote;
2 2
3 import alice.codesegment.CodeSegment; 3 import alice.codesegment.CodeSegment;
4 import alice.datasegment.CommandType; 4 import alice.datasegment.CommandType;
5 import alice.datasegment.Receiver; 5 import alice.datasegment.Receiver;
6 import org.msgpack.type.ValueFactory;
6 7
7 public class RemoteIncrement extends CodeSegment { 8 public class RemoteIncrement extends CodeSegment {
8 9
9 public Receiver num = ids.create(CommandType.TAKE);//true でCompressedDSMからtake 10 public Receiver num = ids.create(CommandType.TAKE);//true でCompressedDSMからtake
11 public Receiver nullValue = ids.create(CommandType.TAKE);//true でCompressedDSMからtake
12
13 RemoteIncrement() {
14 num.setKey("compressedlocal", "num");
15 nullValue.setKey("null-value");
16 }
10 17
11 /** 18 /**
12 * Increment DataSegment value up to 10 19 * Increment DataSegment value up to 10
13 */ 20 */
14 @Override 21 @Override
16 String z = ""; 23 String z = "";
17 if (num.isCompressed()){ 24 if (num.isCompressed()){
18 z = "zMP"; 25 z = "zMP";
19 } 26 }
20 int num = this.num.asInteger(); 27 int num = this.num.asInteger();
28 if ( nullValue.getVal() == null ) {
29 System.out.println("get null value");
30 }
31 ods.put("null-value", ValueFactory.createNilValue());
32
21 System.out.println("[CodeSegment" + z + "] " + num++); 33 System.out.println("[CodeSegment" + z + "] " + num++);
22 if (num == 10) System.exit(0); 34 if (num == 10) System.exit(0);
23 35
24 RemoteIncrement cs = new RemoteIncrement(); 36 RemoteIncrement cs = new RemoteIncrement();
25 37