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/01/11 02:36:06 UTC

[GitHub] [iotdb] zhanglingzhe0820 commented on a change in pull request #2080: Add continuous compaction in level compaction strategy

zhanglingzhe0820 commented on a change in pull request #2080:
URL: https://github.com/apache/iotdb/pull/2080#discussion_r554664431



##########
File path: server/src/main/java/org/apache/iotdb/db/engine/cache/FileStatistics.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.engine.cache;
+
+import static org.apache.iotdb.tsfile.utils.RamUsageEstimator.NUM_BYTES_INT;
+import static org.apache.iotdb.tsfile.utils.RamUsageEstimator.NUM_BYTES_LONG;
+import static org.apache.iotdb.tsfile.utils.RamUsageEstimator.NUM_BYTES_OBJECT_REF;
+
+public class FileStatistics {
+
+  private long numOfPoints;
+  private int sensorNum;
+
+  public FileStatistics(long numOfPoints, int sensorNum) {
+    this.numOfPoints = numOfPoints;
+    this.sensorNum = sensorNum;
+  }
+
+  public long getNumOfPoints() {
+    return numOfPoints;
+  }
+
+  public void setNumOfPoints(long numOfPoints) {
+    this.numOfPoints = numOfPoints;
+  }
+
+  public int getSensorNum() {
+    return sensorNum;
+  }
+
+  public void setSensorNum(int sensorNum) {
+    this.sensorNum = sensorNum;
+  }
+
+
+  public long calculateRamSize() {
+    return NUM_BYTES_OBJECT_REF + NUM_BYTES_LONG + NUM_BYTES_INT;

Review comment:
       okay

##########
File path: server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
##########
@@ -421,6 +427,11 @@
    */
   private long allocateMemoryForChunkCache = allocateMemoryForRead / 10;
 
+  /**
+   * Memory allocated for file statistics cache in compaction process
+   */
+  private long allocateMemoryForFileStatisticsCache = allocateMemoryForRead / 100;

Review comment:
       solved




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