Caideyipi commented on code in PR #16225:
URL: https://github.com/apache/iotdb/pull/16225#discussion_r2292505713


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/LoadTsFileManager.java:
##########
@@ -110,6 +115,14 @@ public class LoadTsFileManager {
       new AtomicReference<>(CONFIG.getLoadTsFileDirs());
   private static final AtomicReference<FolderManager> FOLDER_MANAGER = new 
AtomicReference<>();
 
+  private static final Cache<String, 
org.apache.tsfile.file.metadata.TableSchema> SCHEMA_CACHE =
+      Caffeine.newBuilder()
+          .maximumWeight(10L << 20)

Review Comment:
   Better make it configurable



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/LoadTsFileManager.java:
##########
@@ -473,18 +490,49 @@ private void write(DataPartitionInfo partitionInfo, 
ChunkData chunkData)
               .getSchema()
               .getTableSchemaMap()
               .computeIfAbsent(
-                  tableName, t -> 
TableSchema.of(table).toTsFileTableSchemaNoAttribute());
+                  tableName,
+                  t ->
+                      SCHEMA_CACHE.get(
+                          t,
+                          tablet ->
+                              TableSchema.of(
+                                      DataNodeTableCache.getInstance()
+                                          .getTable(

Review Comment:
   Why do we need to get this table again?



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/LoadTsFileManager.java:
##########
@@ -702,6 +750,7 @@ private void close() {
       }
       dataPartition2Writer = null;
       dataPartition2LastDevice = null;
+      endChunkGroup = null;

Review Comment:
   Do we have to do something to "dataPartition2Resource" and 
"device2Partition" here?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to