jt2594838 commented on code in PR #110:
URL: https://github.com/apache/tsfile/pull/110#discussion_r1642067392


##########
cpp/src/writer/tsfile_writer.cc:
##########
@@ -242,6 +241,44 @@ int TsFileWriter::do_check_schema(const std::string 
&device_name,
     return ret;
 }
 
+int64_t TsFileWriter::calculate_mem_size_for_all_group() {
+    int64_t mem_total_size = 0;
+    DeviceSchemaIter device_iter;
+    for (device_iter = schemas_.begin(); device_iter != schemas_.end();
+         device_iter++) {
+        MeasurementSchemaGroup *chunk_group = device_iter->second;
+        MeasurementSchemaMap &map = chunk_group->measurement_schema_map_;
+        for (MeasurementSchemaMapIter ms_iter = map.begin();
+             ms_iter != map.end(); ms_iter++) {
+            MeasurementSchema *m_schema = ms_iter->second;
+            ChunkWriter *&chunk_writer = m_schema->chunk_writer_;
+            mem_total_size += chunk_writer->estimate_max_series_mem_size();
+        }

Review Comment:
   So, line 255 may use a null pointer.
   The nullability of chunk_writer should be checked.



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