Mercurial > hg > Database > Alice
view src/main/java/alice/datasegment/Command.java @ 366:abc54fa0c81b multicast
MulticastDataSegment's extend class change from DataSegmentManager from LocalDataSegmentManager
author | sugi |
---|---|
date | Sat, 17 May 2014 21:34:01 +0900 |
parents | 8f71c3e6f11d |
children | aefbe41fcf12 |
line wrap: on
line source
package alice.datasegment; import java.io.IOException; import java.util.concurrent.BlockingQueue; import org.msgpack.type.Value; import alice.codesegment.CodeSegment; import alice.codesegment.SingletonMessage; import alice.daemon.CommandMessage; import alice.daemon.Connection; public class Command { public CommandType type; public String key; public Receiver receiver; public Value val; public int index; public int seq; public Connection connection; // for remote public BlockingQueue<Command> replyQueue; public CodeSegment cs; public String reverseKey; public Object obj; public boolean flag; public Command(CommandType cmdType, Receiver receiver, String key, Value val, int index, int seq, BlockingQueue<Command> replyQueue, CodeSegment cs, String reverseKey) { this.type = cmdType; this.receiver = receiver; this.key = key; this.val = val; this.index = index; this.seq = seq; this.replyQueue = replyQueue; this.cs = cs; this.reverseKey = reverseKey; this.flag = false; } public Command(CommandType cmdType, Receiver receiver, String key, Value val, int index, int seq, BlockingQueue<Command> replyQueue, CodeSegment cs, String reverseKey, boolean flag) { this.type = cmdType; this.receiver = receiver; this.key = key; this.val = val; this.index = index; this.seq = seq; this.replyQueue = replyQueue; this.cs = cs; this.reverseKey = reverseKey; this.flag = flag; } public Command(CommandType cmdType, Receiver receiver, String key, Value val, int index, int seq, Connection connection, CodeSegment cs, String reverseKey, boolean flag) { this.type = cmdType; this.receiver = receiver; this.key = key; this.val = val; this.index = index; this.seq = seq; this.connection = connection; this.cs = cs; this.reverseKey = reverseKey; this.flag = flag; } public Command(CommandType cmdType, Receiver receiver, String key, Object obj, int index, int seq, BlockingQueue<Command> replyQueue, CodeSegment cs, String reverseKey) { this.type = cmdType; this.receiver = receiver; this.key = key; this.obj = obj; this.index = index; this.seq = seq; this.replyQueue = replyQueue; this.cs = cs; this.reverseKey = reverseKey; this.flag = false; } public Command(CommandType cmdType, Receiver receiver, String key, Value val, Object obj, int index, int seq, BlockingQueue<Command> replyQueue, CodeSegment cs, String reverseKey) { this.type = cmdType; this.receiver = receiver; this.key = key; this.val = val; this.obj = obj; this.index = index; this.seq = seq; this.replyQueue = replyQueue; this.cs = cs; this.reverseKey = reverseKey; this.flag = false; } public String getCommandString() { String csName = "null"; if (cs != null) { csName = cs.toString(); } return this.type + "\t" + key + "\t" + val + "\tindex=" + index + "\tcs=" + csName; } public CommandMessage convert() { if (val==null&&obj!=null){ try { this.val = SingletonMessage.getInstance().unconvert(obj); } catch (IOException e) { e.printStackTrace(); } } return new CommandMessage(type.id, index, seq, key, val, flag); } }