annotate src/alice/test/codesegment/local/TestCodeSegment.java @ 182:52a1fa5ba38b working

add filp api
author e095732
date Tue, 26 Feb 2013 13:46:18 +0900
parents d7816b9b72e9
children 75150396681c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22
2ca2d961a8d2 implements outline of TopologyManager
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
1 package alice.test.codesegment.local;
3
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
2
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
3 import alice.codesegment.CodeSegment;
18
72dd27d952b0 change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
4 import alice.datasegment.CommandType;
33
20c67f673224 change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
5 import alice.datasegment.Receiver;
3
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
6
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
7 public class TestCodeSegment extends CodeSegment {
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
8
119
f84e1684c6be put NULL in CS
sugi
parents: 107
diff changeset
9 static int count = 0;
f84e1684c6be put NULL in CS
sugi
parents: 107
diff changeset
10
57
7fa9ddb31f64 add comment
one
parents: 34
diff changeset
11 // create input datasegment arg1
182
52a1fa5ba38b add filp api
e095732
parents: 175
diff changeset
12 Receiver arg1 = ids.create(CommandType.PEEK);
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
13 public TestCodeSegment(){
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
14 arg1.setKey("key1");
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
15 }
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
16 public TestCodeSegment(int index){
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
17 arg1.setKey("key1",index);
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
18 }
16
433e601a8e28 network bug fix
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
19
3
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
20 @Override
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
21 public void run() {
132
1044a79ce4ef delete cs from OutputCodeSegment
sugi
parents: 131
diff changeset
22 //System.out.println("index = " + arg1.index);
182
52a1fa5ba38b add filp api
e095732
parents: 175
diff changeset
23 //System.out.println("data = " + arg1.val);
132
1044a79ce4ef delete cs from OutputCodeSegment
sugi
parents: 131
diff changeset
24 //System.out.println(arg1.val.getType());
182
52a1fa5ba38b add filp api
e095732
parents: 175
diff changeset
25 if(count > 10000){
52a1fa5ba38b add filp api
e095732
parents: 175
diff changeset
26 System.out.println(System.currentTimeMillis() - StartCodeSegment.t);
52a1fa5ba38b add filp api
e095732
parents: 175
diff changeset
27 System.exit(1);
52a1fa5ba38b add filp api
e095732
parents: 175
diff changeset
28 }
150
206c7dd9cb48 remove version alpha beta
sugi
parents: 134
diff changeset
29
206c7dd9cb48 remove version alpha beta
sugi
parents: 134
diff changeset
30 /*
18
72dd27d952b0 change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
31 TestCodeSegment cs = new TestCodeSegment();
71
a3a2605e16a2 change checking debug mode of logger
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
32 cs.arg1.setKey("key1", arg1.index);
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 71
diff changeset
33 */
182
52a1fa5ba38b add filp api
e095732
parents: 175
diff changeset
34 ods.update("local","key1",arg1.asInteger()+1);
52a1fa5ba38b add filp api
e095732
parents: 175
diff changeset
35 //ods.flip(arg1, arg1.asInteger()+1);
169
16418c2c3e72 minor change
sugi
parents: 150
diff changeset
36 new TestCodeSegment();
16418c2c3e72 minor change
sugi
parents: 150
diff changeset
37 //new TestCodeSegment(arg1.index);
16418c2c3e72 minor change
sugi
parents: 150
diff changeset
38
182
52a1fa5ba38b add filp api
e095732
parents: 175
diff changeset
39 count++;
57
7fa9ddb31f64 add comment
one
parents: 34
diff changeset
40 // DataSegment.get("local").update
169
16418c2c3e72 minor change
sugi
parents: 150
diff changeset
41 //ods.update("local", "key1", arg1.index);
119
f84e1684c6be put NULL in CS
sugi
parents: 107
diff changeset
42
3
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
43 }
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
44
91057e15065f add DataSegment API and CodeSegment
one
parents:
diff changeset
45 }