changeset 532:33f981dd91d2 dispose

add ToDo comment
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Sun, 03 May 2015 19:40:24 +0900
parents b6049fb123d8
children b3c9554ccb1b
files src/main/java/alice/daemon/IncomingTcpConnection.java src/main/java/alice/datasegment/Command.java src/main/java/alice/datasegment/ReceiveData.java
diffstat 3 files changed, 5 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/alice/daemon/IncomingTcpConnection.java	Sun May 03 15:58:31 2015 +0900
+++ b/src/main/java/alice/daemon/IncomingTcpConnection.java	Sun May 03 19:40:24 2015 +0900
@@ -98,7 +98,9 @@
                 case REPLY:
                     System.out.println("in TCP REPLY");
                     cmd = manager.getAndRemoveCmd(msg.seq);
-
+                    // ToDo: do not pack again on compressedMessagePack
+                    // after size of copressedData get to ByteBuffer of compressed data using
+                    // readPayloadAsReference().toByteBuffer()
                     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, "");
--- a/src/main/java/alice/datasegment/Command.java	Sun May 03 15:58:31 2015 +0900
+++ b/src/main/java/alice/datasegment/Command.java	Sun May 03 19:40:24 2015 +0900
@@ -95,6 +95,7 @@
                 case PUT:
                 case REPLY:
                     if(compressFlag){
+                        // ToDo: Do not pack again
                         data = packer.write(rData.getZMessagePack());
                         compressed = true;
                     } else {
--- a/src/main/java/alice/datasegment/ReceiveData.java	Sun May 03 15:58:31 2015 +0900
+++ b/src/main/java/alice/datasegment/ReceiveData.java	Sun May 03 19:40:24 2015 +0900
@@ -108,7 +108,7 @@
             }
 
             if (zMessagePack != null && messagePack == null) {
-                messagePack = unzip(zMessagePack, dataSize);///ToDo:read header and set length
+                messagePack = unzip(zMessagePack, dataSize);
             }
 
             return packer.read(messagePack, clazz);
@@ -255,23 +255,6 @@
         return b;
     }
 
-    public static int byteArrayToInt(byte[] b)
-    {
-        return   b[3] & 0xFF |
-                (b[2] & 0xFF) << 8 |
-                (b[1] & 0xFF) << 16 |
-                (b[0] & 0xFF) << 24;
-    }
-
-    public static byte[] intToByteArray(int a)
-    {
-        return new byte[] {
-                (byte) ((a >> 24) & 0xFF),
-                (byte) ((a >> 16) & 0xFF),
-                (byte) ((a >> 8) & 0xFF),
-                (byte) (a & 0xFF)
-        };
-    }
 
     public int getDataSize(){
         return this.dataSize;