Alexey Serbin has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18924 )

Change subject: [bootstrap] Reduce the memory size consumed when bootstrap
......................................................................


Patch Set 3: Code-Review+1

(10 comments)

http://gerrit.cloudera.org:8080/#/c/18924/3//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/18924/3//COMMIT_MSG@9
PS3, Line 9: bootstrap
bootstraps


http://gerrit.cloudera.org:8080/#/c/18924/3//COMMIT_MSG@9
PS3, Line 9: will load
loads


http://gerrit.cloudera.org:8080/#/c/18924/3//COMMIT_MSG@10
PS3, Line 10: will find
finds


http://gerrit.cloudera.org:8080/#/c/18924/3//COMMIT_MSG@10
PS3, Line 10: it seen
it has seen


http://gerrit.cloudera.org:8080/#/c/18924/3//COMMIT_MSG@12
PS3, Line 12: contains
contain


http://gerrit.cloudera.org:8080/#/c/18924/3//COMMIT_MSG@13
PS3, Line 13: will consume
consumes


http://gerrit.cloudera.org:8080/#/c/18924/3//COMMIT_MSG@15
PS3, Line 15: This patch optimize it to only find the maximum block id
            : of a tablet, instead of temporary store all block ids in
            : memory
This patch optimizes the tablet bootstrap to find the maximum block id for a 
tablet without storing all the blocks in the memory.


http://gerrit.cloudera.org:8080/#/c/18924/3/src/kudu/tablet/rowset_metadata.cc
File src/kudu/tablet/rowset_metadata.cc:

http://gerrit.cloudera.org:8080/#/c/18924/3/src/kudu/tablet/rowset_metadata.cc@302
PS3, Line 302:   BlockIdContainer blocks;
nit: since you have touched this code, would you mind adding 
'blocks.reserve(...)' to avoid multiple re-allocations for the 'blocks' vector?


http://gerrit.cloudera.org:8080/#/c/18924/3/src/kudu/tablet/tablet_metadata-test.cc
File src/kudu/tablet/tablet_metadata-test.cc:

http://gerrit.cloudera.org:8080/#/c/18924/3/src/kudu/tablet/tablet_metadata-test.cc@248
PS3, Line 248: tablet_meta->UpdateAndFlush(RowSetMetadataIds(), rs_metas, 
TabletMetadata::kNoMrsFlushed);
Wrap this into ASSERT_OK()?


http://gerrit.cloudera.org:8080/#/c/18924/3/src/kudu/tablet/tablet_metadata-test.cc@253
PS3, Line 253:   BlockId expect_max_block_id;
             :   for (const auto& block_id : block_ids) {
             :     expect_max_block_id = std::max(expect_max_block_id, 
block_id);
             :   }
nit: is it possible to add a copy/move constructor for BlockId() and shorten 
this into:

  const auto expected_max_block_id = std::max(block_ids.begin(), 
block_ids.end());

?

Using the std::max() algorithm might also help with more concise code in the 
newly introduced method RowSetMetadata::GetMaxLiveBlockId()



--
To view, visit http://gerrit.cloudera.org:8080/18924
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If4df35f63e99a3f8331da51114991515ea4ee496
Gerrit-Change-Number: 18924
Gerrit-PatchSet: 3
Gerrit-Owner: Yingchun Lai <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Yifan Zhang <[email protected]>
Gerrit-Reviewer: Yingchun Lai <[email protected]>
Gerrit-Comment-Date: Mon, 29 Aug 2022 17:45:45 +0000
Gerrit-HasComments: Yes

Reply via email to