Csaba Ringhofer has posted comments on this change. ( http://gerrit.cloudera.org:8080/9576 )
Change subject: IMPALA-6638: Reduce file handle cache lock contention ...................................................................... Patch Set 2: Code-Review+1 (3 comments) Thanks for the explanation! I have left some optional comments, but the code is ok for me as it is. http://gerrit.cloudera.org:8080/#/c/9576/2/be/src/runtime/io/handle-cache.inline.h File be/src/runtime/io/handle-cache.inline.h: http://gerrit.cloudera.org:8080/#/c/9576/2/be/src/runtime/io/handle-cache.inline.h@134 PS2, Line 134: FileHandleEntry entry(new_fh, p.lru_list); : typename MapType::iterator new_it = p.cache.emplace(*fname, std::move(entry)); I would remove the constructor and move the arguments to emplace: emplace(*fname, new_fh, p.lru_list) or emplace(*fname, FileHandleEntry(new_fh, p.lru_list)) http://gerrit.cloudera.org:8080/#/c/9576/2/be/src/runtime/io/handle-cache.inline.h@137 PS2, Line 137: ++p.size; : if (p.size > p.capacity) EvictHandles(p); I would prefer to move this before the creation of the new entry, to make it clear that EvictHandles() can not have any effect on it. This would also make it a little little bit faster, because evicted elements would be removed from a smaller map. http://gerrit.cloudera.org:8080/#/c/9576/2/be/src/runtime/io/handle-cache.inline.h@139 PS2, Line 139: DCHECK(!new_elem->in_use); This DCHECK could be probably removed. -- To view, visit http://gerrit.cloudera.org:8080/9576 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4c695b21ca556e9c73c703c0c891e64939271c8d Gerrit-Change-Number: 9576 Gerrit-PatchSet: 2 Gerrit-Owner: Joe McDonnell <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Comment-Date: Mon, 12 Mar 2018 18:56:48 +0000 Gerrit-HasComments: Yes
