RkGrit commented on code in PR #110:
URL: https://github.com/apache/tsfile/pull/110#discussion_r1650290443
##########
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();
+ }
+ }
+ return mem_total_size;
+}
+
+/**
+ * check occupied memory size, if it exceeds the chunkGroupSize threshold,
flush
+ * them to given OutputStream.
+ *
+ * @return true - size of tsfile or metadata reaches the threshold. false -
+ * otherwise
+ */
+int TsFileWriter::check_memory_size_and_may_flush_chunks() {
Review Comment:
I will fix the comments
--
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]