Mercurial > hg > Members > tatsuki > Alice
annotate src/alice/datasegment/Command.java @ 328:370a2f63944f
add ListManager Test
author | sugi |
---|---|
date | Tue, 11 Feb 2014 16:10:23 +0900 |
parents | b78f52865b8d |
children |
rev | line source |
---|---|
3 | 1 package alice.datasegment; |
2 | |
250 | 3 import java.io.IOException; |
13 | 4 import java.util.concurrent.BlockingQueue; |
3 | 5 import org.msgpack.type.Value; |
6 | |
7 | 7 import alice.codesegment.CodeSegment; |
250 | 8 import alice.codesegment.SingletonMessage; |
9 import alice.daemon.CommandMessage; | |
251 | 10 import alice.daemon.Connection; |
7 | 11 |
3 | 12 public class Command { |
13 | 13 public CommandType type; |
14
e3f1b21718b0
implements RemoteDataSegment
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
13
diff
changeset
|
14 public String key; |
33
20c67f673224
change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
15 public Receiver receiver; |
3 | 16 public Value val; |
17 public int index; | |
18 public int seq; | |
251 | 19 public Connection connection; // for remote |
13 | 20 public BlockingQueue<Command> replyQueue; |
7 | 21 public CodeSegment cs; |
28
98ab26e09a98
Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
22 public String reverseKey; |
190 | 23 public Object obj; |
251 | 24 public boolean flag; |
202 | 25 |
33
20c67f673224
change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
28
diff
changeset
|
26 public Command(CommandType cmdType, Receiver receiver, String key, Value val, int index, int seq, BlockingQueue<Command> replyQueue, CodeSegment cs, String reverseKey) { |
13 | 27 this.type = cmdType; |
18
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
28 this.receiver = receiver; |
16 | 29 this.key = key; |
3 | 30 this.val = val; |
31 this.index = index; | |
32 this.seq = seq; | |
13 | 33 this.replyQueue = replyQueue; |
7 | 34 this.cs = cs; |
28
98ab26e09a98
Configuration Manager work and implements reverseKey
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
35 this.reverseKey = reverseKey; |
251 | 36 this.flag = false; |
3 | 37 } |
251 | 38 |
252 | 39 public Command(CommandType cmdType, Receiver receiver, String key, Value val, int index, int seq, BlockingQueue<Command> replyQueue, CodeSegment cs, String reverseKey, boolean flag) { |
40 this.type = cmdType; | |
41 this.receiver = receiver; | |
42 this.key = key; | |
43 this.val = val; | |
44 this.index = index; | |
45 this.seq = seq; | |
46 this.replyQueue = replyQueue; | |
47 this.cs = cs; | |
48 this.reverseKey = reverseKey; | |
49 this.flag = flag; | |
50 } | |
51 | |
251 | 52 public Command(CommandType cmdType, Receiver receiver, String key, Value val, int index, int seq, Connection connection, CodeSegment cs, String reverseKey, boolean flag) { |
53 this.type = cmdType; | |
54 this.receiver = receiver; | |
55 this.key = key; | |
56 this.val = val; | |
57 this.index = index; | |
58 this.seq = seq; | |
59 this.connection = connection; | |
60 this.cs = cs; | |
61 this.reverseKey = reverseKey; | |
62 this.flag = flag; | |
63 } | |
64 | |
190 | 65 public Command(CommandType cmdType, Receiver receiver, String key, Object obj, int index, int seq, BlockingQueue<Command> replyQueue, CodeSegment cs, String reverseKey) { |
66 this.type = cmdType; | |
67 this.receiver = receiver; | |
68 this.key = key; | |
69 this.obj = obj; | |
70 this.index = index; | |
71 this.seq = seq; | |
72 this.replyQueue = replyQueue; | |
73 this.cs = cs; | |
74 this.reverseKey = reverseKey; | |
251 | 75 this.flag = false; |
190 | 76 } |
77 | |
78 public Command(CommandType cmdType, Receiver receiver, String key, Value val, Object obj, int index, int seq, BlockingQueue<Command> replyQueue, CodeSegment cs, String reverseKey) { | |
79 this.type = cmdType; | |
80 this.receiver = receiver; | |
81 this.key = key; | |
82 this.val = val; | |
191 | 83 this.obj = obj; |
190 | 84 this.index = index; |
85 this.seq = seq; | |
86 this.replyQueue = replyQueue; | |
87 this.cs = cs; | |
88 this.reverseKey = reverseKey; | |
251 | 89 this.flag = false; |
190 | 90 } |
91 | |
39 | 92 public String getCommandString() { |
93 String csName = "null"; | |
94 if (cs != null) { | |
95 csName = cs.toString(); | |
96 } | |
40 | 97 return this.type + "\t" + key + "\t" + val + "\tindex=" + index + "\tcs=" + csName; |
39 | 98 } |
250 | 99 public CommandMessage convert() { |
100 if (val==null&&obj!=null){ | |
101 try { | |
102 this.val = SingletonMessage.getInstance().unconvert(obj); | |
103 } catch (IOException e) { | |
104 e.printStackTrace(); | |
105 } | |
106 } | |
251 | 107 return new CommandMessage(type.id, index, seq, key, val, flag); |
250 | 108 } |
39 | 109 |
3 | 110 } |