You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/03/30 12:52:05 UTC

[GitHub] [iotdb] neuyilan edited a comment on pull request #2904: [IOTDB-1257] Make a little bit improvement of config and fix some bugs for setting logic

neuyilan edited a comment on pull request #2904:
URL: https://github.com/apache/iotdb/pull/2904#issuecomment-810199315


   @ericpai 
   1. The original meaning of the `resizeifnecessary` function is that when the size of my request is larger than the size already declared by thrift, I will try to reduce the size; otherwise, I need to expand the size.
   
   2. If the automatic adjustment is correct, the initial value of 64KB or 16MB is OK, but if the initial setting is too large, some memory will be wasted before the adjustment ends. At present, the reason why all requests become 16MB is that the parameters passed in by calling the function of `resizeifnecessary` are incorrect. The parameter to call the `resizeifnecessary` function should be the size of the request, not `softmaxlength`.  https://github.com/apache/iotdb/blob/master/service-rpc/src/main/java/org/apache/iotdb/rpc/AutoResizingBuffer.java#L50
   3. Callers don't need to care about when they need to expand or when they need to shrink. These things are shielded for callers. When the caller starts a read request or ends a written request, just call the following function is ok. What we need to do is to write a good strategy for expansion and reduction.
   
   `
   public void resizeIfNecessary(int requestSize) { 
    int currentCapacity = this.array.length;
       if (currentCapacity < size) {
         enlargeIfNecessary(size);
       } else {
         shrinkIfNecessary(size);
       }
     }
   
   `


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org