Adar Dembo has posted comments on this change. Change subject: fs: add BlockManager::GetAllBlockIds() ......................................................................
Patch Set 1: (5 comments) http://gerrit.cloudera.org:8080/#/c/6360/1/src/kudu/fs/block_manager-test.cc File src/kudu/fs/block_manager-test.cc: PS1, Line 1279: The file block manager should skip these. > can you add: "... and thus they shouldn't appear in 'retrieved_ids' below." Done http://gerrit.cloudera.org:8080/#/c/6360/1/src/kudu/fs/block_manager.h File src/kudu/fs/block_manager.h: Line 247: virtual Status GetAllBlockIds(std::vector<BlockId>* block_ids) = 0; > can you add some note about the behavior this has with "in-flight" blocks? I'll add that although the function is thread-safe, none of the blocks are guaranteed to exist after the call; they may have been aborted, deleted, etc. http://gerrit.cloudera.org:8080/#/c/6360/1/src/kudu/fs/file_block_manager.cc File src/kudu/fs/file_block_manager.cc: PS1, Line 727: vector<vector<BlockId>> block_id_vecs(dds.size()); : vector<Status> statuses(dds.size()); : for (int i = 0; i < dds.size(); i++) { : dds[i]->ExecClosure(Bind(&GetAllBlockIdsForDataDir, : env_, : dds[i].get(), : &block_id_vecs[i], : &statuses[i])); : } > could this completely hog all the threads, if there are a lot of data dirs? Each data dir has its own single-thread threadpool that only runs that dir's closures. So yes, we'll be "hogging" all the threads, but that's by design. PS1, Line 747: block_ids->insert(block_ids->begin(), : ids.begin(), ids.end()); > nit no need to wrap Done http://gerrit.cloudera.org:8080/#/c/6360/1/src/kudu/tablet/compaction-test.cc File src/kudu/tablet/compaction-test.cc: PS1, Line 1088: std::sort(before_block_ids.begin(), before_block_ids.end(), : BlockIdCompare()); : std::sort(after_block_ids.begin(), after_block_ids.end(), : BlockIdCompare()); > nit no need to wrap Done -- To view, visit http://gerrit.cloudera.org:8080/6360 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I20e8ccf6e8a2deba88fcf5598fb404a1186b8262 Gerrit-PatchSet: 1 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Adar Dembo <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: David Ribeiro Alves <[email protected]> Gerrit-Reviewer: Dinesh Bhat <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <[email protected]> Gerrit-Reviewer: Todd Lipcon <[email protected]> Gerrit-HasComments: Yes
