diff src/alice/daemon/IncomingTcpConnection.java @ 28:98ab26e09a98

Configuration Manager work and implements reverseKey
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Tue, 17 Jan 2012 08:41:34 +0900
parents bb075e103cd3
children 92aeb6e34683
line wrap: on
line diff
--- a/src/alice/daemon/IncomingTcpConnection.java	Tue Jan 17 03:52:39 2012 +0900
+++ b/src/alice/daemon/IncomingTcpConnection.java	Tue Jan 17 08:41:34 2012 +0900
@@ -17,10 +17,11 @@
 	
 	public Connection connection;
 	public DataSegmentManager manager;
-	
-	public IncomingTcpConnection(Connection connection, DataSegmentManager manager) {
+	public String reverseKey;
+	public IncomingTcpConnection(Connection connection, DataSegmentManager manager, String reverseKey) {
 		this.manager = manager;
 		this.connection = connection;
+		this.reverseKey = reverseKey;
 	}
 	
 	public void run() {
@@ -52,24 +53,24 @@
 				DataSegmentKey dsKey = lmanager.getDataSegmentKey(msg.key);
 				switch (type) {
 				case UPDATE:
-					dsKey.addCommand(new Command(type, null, null, msg.val, 0, 0, null, null));
+					dsKey.addCommand(new Command(type, null, null, msg.val, 0, 0, null, null, reverseKey));
 					break;
 				case PUT:
-					dsKey.addCommand(new Command(type, null, null, msg.val, 0, 0, null, null));
+					dsKey.addCommand(new Command(type, null, null, msg.val, 0, 0, null, null, reverseKey));
 					break;
 				case PEEK:
 					//Command(CommandType cmdType, String argKey, Value val, int index, int seq, BlockingQueue<Command> replyQueue, CodeSegment cs) {
-					dsKey.addCommand(new Command(type, null, null, null, msg.index, msg.seq, connection.sendQueue, null));
+					dsKey.addCommand(new Command(type, null, null, null, msg.index, msg.seq, connection.sendQueue, null, null));
 					break;
 				case TAKE:
-					dsKey.addCommand(new Command(type, null, null, null, msg.index, msg.seq, connection.sendQueue, null));
+					dsKey.addCommand(new Command(type, null, null, null, msg.index, msg.seq, connection.sendQueue, null, null));
 					break;	
 				case REMOVE:
-					dsKey.addCommand(new Command(type, null, null, null, 0, 0, null, null));
+					dsKey.addCommand(new Command(type, null, null, null, 0, 0, null, null, null));
 					break;
 				case REPLY:
 					try {
-						manager.replyQueue.put(new Command(type, null, null, msg.val, msg.index, msg.seq, null, null));
+						manager.replyQueue.put(new Command(type, null, null, msg.val, msg.index, msg.seq, null, null, null));
 					} catch (InterruptedException e) {
 						e.printStackTrace();
 					}