view src/alice/datasegment/Command.java @ 40:20616fe4d28a

add log viewer
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Tue, 31 Jan 2012 15:19:35 +0900
parents 3155337e754e
children a85ff8dc16c1
line wrap: on
line source

package alice.datasegment;

import java.util.concurrent.BlockingQueue;

import org.msgpack.type.Value;

import alice.codesegment.CodeSegment;

public class Command {
	public CommandType type;
	public String key;
	public Receiver receiver;
	public Value val;
	public int index;
	public int seq;
	public BlockingQueue<Command> replyQueue;
	public CodeSegment cs;
	public String reverseKey;
	
	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;
	}
	
	public String getCommandString() {
		String csName = "null";
		if (cs != null) {
			csName = cs.toString();
		}
		return this.type + "\t" + key + "\t" + val + "\tindex=" + index + "\tcs=" + csName;
	}
	
}