shuwenwei commented on code in PR #15257:
URL: https://github.com/apache/iotdb/pull/15257#discussion_r2050398932
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/selector/estimator/CompactionEstimateUtils.java:
##########
@@ -81,6 +84,22 @@ public static FileInfo
calculateFileInfo(TsFileSequenceReader reader) throws IOE
for (Map.Entry<String, List<ChunkMetadata>>
measurementChunkMetadataList :
measurementChunkMetadataListMap.entrySet()) {
int currentChunkMetadataListSize =
measurementChunkMetadataList.getValue().size();
+ long chunkMetadataMemCost = 0;
+ for (ChunkMetadata chunkMetadata :
measurementChunkMetadataList.getValue()) {
+ if (chunkMetadata != null) {
+ chunkMetadataMemCost =
+ ChunkMetadata.calculateRamSize(
+ chunkMetadata.getMeasurementUid(),
chunkMetadata.getDataType());
+ break;
+ }
+ }
+ long currentSeriesRamSize = chunkMetadataMemCost *
currentChunkMetadataListSize;
Review Comment:
In fact, chunkMetadata here should not be null, the judgment here is just
for safety
--
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]