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/07/01 13:16:01 UTC

[GitHub] [iotdb] HTHou commented on a change in pull request #3484: Array pool

HTHou commented on a change in pull request #3484:
URL: https://github.com/apache/iotdb/pull/3484#discussion_r662278998



##########
File path: server/src/main/java/org/apache/iotdb/db/rescon/PrimitiveArrayManager.java
##########
@@ -290,20 +293,20 @@ public static void updateSchemaDataTypeNum(
    */
   private static boolean isCurrentDataTypeExceeded(TSDataType dataType) {
     int total = 0;
-    for (int num : bufferedArraysNumMap.values()) {
-      total += num;
+    for (ArrayDeque<Object> value : bufferedArraysMap.values()) {
+      total += value.size();
     }
+    int arrayNumInBuffer =
+        bufferedArraysMap.get(dataType) == null ? 0 : bufferedArraysMap.get(dataType).size();

Review comment:
       ```suggestion
       int arrayNumInBuffer =
           bufferedArraysMap.contains(dataType) ? bufferedArraysMap.get(dataType).size() : 0;
   ```




-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

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