diff paper/source/IncomingTcpConnection.java @ 3:a97aa059242f

add images & sources
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Fri, 05 Feb 2016 21:00:41 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/source/IncomingTcpConnection.java	Fri Feb 05 21:00:41 2016 +0900
@@ -0,0 +1,13 @@
+while (true) {
+    Command cmd = null;
+    ReceiveData rData = null;
+    CommandMessage msg = unpacker.read(CommandMessage.class);
+    CommandType type = CommandType.getCommandTypeFromId(msg.type);
+    switch (type) {
+    case UPDATE:
+    case PUT:
+        int dataSize = unpacker.readInt();
+        rData = new ReceiveData(unpacker.getSerializedByteArray(dataSize), msg.compressed, msg.serialized);
+        cmd = new Command(type, null, null, rData, 0, 0, null, null, reverseKey);
+        lmanager.getDataSegmentKey(msg.key).runCommand(cmd);
+        break;