Mercurial > hg > Papers > 2015 > sugi-master
diff paper/source/IncomingTcpConnection.java @ 10:198cebfd31a3
modify chapter5
author | sugi |
---|---|
date | Sat, 10 Jan 2015 08:44:39 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paper/source/IncomingTcpConnection.java Sat Jan 10 08:44:39 2015 +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;