This is an automated email from the ASF dual-hosted git repository.

jiangtian pushed a commit to branch cluster_add_snappy
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/cluster_add_snappy by this 
push:
     new d5dacc5  remove redundant resize
d5dacc5 is described below

commit d5dacc5a40096e0e6af2e4de847b49dabc41dcf4
Author: jt <[email protected]>
AuthorDate: Thu Dec 3 10:23:57 2020 +0800

    remove redundant resize
---
 .../java/org/apache/iotdb/rpc/TSnappyElasticFramedTransport.java     | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git 
a/service-rpc/src/main/java/org/apache/iotdb/rpc/TSnappyElasticFramedTransport.java
 
b/service-rpc/src/main/java/org/apache/iotdb/rpc/TSnappyElasticFramedTransport.java
index 17a90b8..e883157 100644
--- 
a/service-rpc/src/main/java/org/apache/iotdb/rpc/TSnappyElasticFramedTransport.java
+++ 
b/service-rpc/src/main/java/org/apache/iotdb/rpc/TSnappyElasticFramedTransport.java
@@ -108,9 +108,6 @@ public class TSnappyElasticFramedTransport extends 
TFastFramedTransport {
       readCompressBuffer.getByteBuffer().limit(uncompressedLength);
       readCompressBuffer.getByteBuffer().position(0);
 
-      if (uncompressedLength < maxLength) {
-        readBuffer.resizeIfNecessary(maxLength);
-      }
       readBuffer.fill(readCompressBuffer, uncompressedLength);
     } catch (IOException e) {
       throw new TTransportException(e);
@@ -119,7 +116,7 @@ public class TSnappyElasticFramedTransport extends 
TFastFramedTransport {
 
   private TByteBuffer resizeCompressBuf(int size, TByteBuffer byteBuffer) {
     double expandFactor = 1.5;
-    double loadFactor = 0.5;
+    double loadFactor = 0.6;
     if (byteBuffer.getByteBuffer().capacity() < size) {
       int newCap = (int) Math.min(size * expandFactor, maxLength);
       byteBuffer = new TByteBuffer(ByteBuffer.allocate(newCap));

Reply via email to