gaodayue commented on a change in pull request #1590: Implement BetaRowsetWriter
URL: https://github.com/apache/incubator-doris/pull/1590#discussion_r312770504
##########
File path: be/src/olap/schema_change.cpp
##########
@@ -685,22 +680,19 @@ SchemaChangeDirectly::SchemaChangeDirectly(
const RowBlockChanger& row_block_changer) :
_row_block_changer(row_block_changer),
_row_block_allocator(nullptr),
- _src_cursor(nullptr),
- _dst_cursor(nullptr) { }
+ _cursor(nullptr) { }
SchemaChangeDirectly::~SchemaChangeDirectly() {
VLOG(3) << "~SchemaChangeDirectly()";
SAFE_DELETE(_row_block_allocator);
- SAFE_DELETE(_src_cursor);
- SAFE_DELETE(_dst_cursor);
+ SAFE_DELETE(_cursor);
}
-bool SchemaChangeDirectly::_write_row_block(RowsetWriterSharedPtr
rowset_writer, RowBlock* row_block) {
+bool SchemaChangeDirectly::_write_row_block(RowsetWriter* rowset_writer,
RowBlock* row_block) {
for (uint32_t i = 0; i < row_block->row_block_info().row_num; i++) {
- row_block->get_row(i, _src_cursor);
- copy_row(_dst_cursor, *_src_cursor, rowset_writer->mem_pool());
- if (OLAP_SUCCESS != rowset_writer->add_row(*_dst_cursor)) {
- LOG(WARNING) << "fail to attach writer";
+ row_block->get_row(i, _cursor);
Review comment:
Actually `src_cursor` and `dst_cursor` have the same schema, both are using
target tablet's schema (see `SchemaChangeDirectly::process` below). The reason
that original code has two cursors is the need to copy data into writer's
internal row block (line 701). Since the new design hides writer's internal
buffer from its clients, we no longer need two cursors, so I've combined them
into the single `_cursor`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]