Mercurial > hg > Database > Alice
diff src/main/java/alice/daemon/IncomingTcpConnection.java @ 531:b6049fb123d8 dispose
resolve unzip, working TestRemoteAlice
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 03 May 2015 15:58:31 +0900 |
parents | 4aeebea0c9b5 |
children | 33f981dd91d2 |
line wrap: on
line diff
--- a/src/main/java/alice/daemon/IncomingTcpConnection.java Sun May 03 10:04:28 2015 +0900 +++ b/src/main/java/alice/daemon/IncomingTcpConnection.java Sun May 03 15:58:31 2015 +0900 @@ -6,7 +6,6 @@ import alice.datasegment.*; import org.msgpack.MessagePack; -import org.msgpack.type.Value; import org.msgpack.unpacker.Unpacker; import alice.topology.manager.keeparive.RespondData; @@ -61,7 +60,7 @@ case UPDATE: case PUT: System.out.println("in TCP PUT"); - rData = new ReceiveData(unpacker.getSerializedByteArray(unpacker.readInt()), msg.compressed, msg.dataSize);///read rData + rData = new ReceiveData(packer.read(unpacker.getSerializedByteArray(unpacker.readInt()), byte[].class), msg.compressed, msg.dataSize);///read rData if (msg.setTime) { rData.setTime = true; @@ -81,7 +80,7 @@ break; case PEEK: case TAKE: - System.out.println("in TCP TAKE:" + msg.compressed); + System.out.println("in TCP TAKE"); cmd = new Command(type, null, null, null, msg.index, msg.seq, null, null, connection); cmd.setCompressFlag(msg.compressed); @@ -97,19 +96,10 @@ lmanager.getDataSegmentKey(msg.key).runCommand(cmd);//ToDo:fix break; case REPLY: - System.out.println("in TCP REPLY:"); - System.out.println("After DataSize:" + msg.dataSize); + System.out.println("in TCP REPLY"); cmd = manager.getAndRemoveCmd(msg.seq); - byte[] unpack = unpacker.getSerializedByteArray(unpacker.readInt()); - //Value unpack2 = packer.read(byte []); - System.out.print("REPLY unpacker: "); - for (int i = 0; i < unpack.length; i++) { - System.out.print(Integer.toHexString(unpack[i] & 0xff)); - } - System.out.print("\n"); - - rData = new ReceiveData(unpack, msg.compressed, msg.dataSize); + rData = new ReceiveData(packer.read(unpacker.getSerializedByteArray(unpacker.readInt()), byte[].class), msg.compressed, msg.dataSize); Command rCmd = new Command(type, null, null, rData, msg.index, msg.seq, null, null, ""); cmd.setCompressFlag(msg.compressed);