morningman commented on a change in pull request #7216:
URL: https://github.com/apache/incubator-doris/pull/7216#discussion_r756552049
##########
File path: be/src/olap/delta_writer.cpp
##########
@@ -179,6 +180,26 @@ OLAPStatus DeltaWriter::write(Tuple* tuple) {
return OLAP_SUCCESS;
}
+OLAPStatus DeltaWriter::write(const RowBatch* row_batch, const
std::vector<int>& row_idxs) {
+ std::lock_guard<std::mutex> l(_lock);
+ if (!_is_init && !_is_cancelled) {
+ RETURN_NOT_OK(init());
+ }
+
+ if (_is_cancelled) {
+ return OLAP_ERR_ALREADY_CANCELLED;
+ }
+
+ for (const auto& row_idx : row_idxs) {
+ _mem_table->insert(row_batch->get_row(row_idx)->get_tuple(0));
+ if (_mem_table->memory_usage() >= config::write_buffer_size) {
Review comment:
I think we can move this memory check outside the for loop.
Maybe inaccurate, but its ok~
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]