Mercurial > hg > Database > Alice
comparison src/main/java/alice/topology/node/IncomingReverseKey.java @ 345:8f71c3e6f11d
Change directory structure Maven standard
author | sugi |
---|---|
date | Wed, 16 Apr 2014 18:26:07 +0900 |
parents | |
children | fee3efd9257d |
comparison
equal
deleted
inserted
replaced
344:9f97ec18f8c5 | 345:8f71c3e6f11d |
---|---|
1 package alice.topology.node; | |
2 | |
3 import alice.codesegment.CodeSegment; | |
4 import alice.datasegment.CommandType; | |
5 import alice.datasegment.DataSegment; | |
6 import alice.datasegment.Receiver; | |
7 import org.msgpack.type.Value; | |
8 | |
9 public class IncomingReverseKey extends CodeSegment { | |
10 | |
11 public Receiver reverseKey = ids.create(CommandType.TAKE); | |
12 public Receiver reverseCount = ids.create(CommandType.PEEK); | |
13 | |
14 @Override | |
15 public void run() { | |
16 String reverseKey = ((Value)this.reverseKey.getVal()).asRawValue().getString(); | |
17 String from = this.reverseKey.from; | |
18 DataSegment.getAccept(from).reverseKey = reverseKey; | |
19 | |
20 int reverseCount = this.reverseCount.asInteger(); | |
21 reverseCount++; | |
22 ods.update("local", "reverseCount", reverseCount); | |
23 | |
24 | |
25 IncomingReverseKey cs = new IncomingReverseKey(); | |
26 cs.reverseKey.setKey("local", "reverseKey"); | |
27 cs.reverseCount.setKey("local", "reverseCount"); | |
28 } | |
29 | |
30 } |