Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/14988 )
Change subject: file cache: unify across file types ...................................................................... Patch Set 3: (8 comments) http://gerrit.cloudera.org:8080/#/c/14988/2//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/14988/2//COMMIT_MSG@21 PS2, Line 21: it > nit: remove Done http://gerrit.cloudera.org:8080/#/c/14988/2/src/kudu/util/file_cache-test.cc File src/kudu/util/file_cache-test.cc: http://gerrit.cloudera.org:8080/#/c/14988/2/src/kudu/util/file_cache-test.cc@374 PS2, Line 374: FileCache cache("test", env_, 1, /*entity=*/ nullptr); > Does it make sense to add a test to verify that the following is kept true, I should have removed that text; that sort of behavior is actually expressly forbidden (enforced by a DCHECK in OpenExistingFile). We could allow it, but it introduces complexity and a perf hit. Plus there's not much of a use case for it. http://gerrit.cloudera.org:8080/#/c/14988/2/src/kudu/util/file_cache.h File src/kudu/util/file_cache.h: http://gerrit.cloudera.org:8080/#/c/14988/2/src/kudu/util/file_cache.h@127 PS2, Line 127: : // Deletes a file by name through the cache. : // : // If there is an outstanding descriptor for the file, the deletion will be > Would a templatized method be a better choice here? Good idea. Done. http://gerrit.cloudera.org:8080/#/c/14988/2/src/kudu/util/file_cache.h@210 PS2, Line 210: > nit: const char* const ? Done http://gerrit.cloudera.org:8080/#/c/14988/2/src/kudu/util/file_cache.cc File src/kudu/util/file_cache.cc: http://gerrit.cloudera.org:8080/#/c/14988/2/src/kudu/util/file_cache.cc@487 PS2, Line 487: std: > Does it make sense to add DCHECK(desc) here? Done http://gerrit.cloudera.org:8080/#/c/14988/2/src/kudu/util/file_cache.cc@510 PS2, Line 510: ared > ditto Done http://gerrit.cloudera.org:8080/#/c/14988/2/src/kudu/util/file_cache.cc@625 PS2, Line 625: > readability nit here and elsewhere: maybe, rename it into 'descriptors' sin Fair point, but I'd rather rename 'desc' to 'd' to reflect its short scope. Done. http://gerrit.cloudera.org:8080/#/c/14988/2/src/kudu/util/file_cache.cc@682 PS2, Line 682: > Isn't it UB if this is descs->end()? Not following; if it == descs->end() (and mode isn't CREATE_IF_NOT_EXIST), we just return an empty shared_ptr. What's wrong with that? -- To view, visit http://gerrit.cloudera.org:8080/14988 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1e5cf6cadb7f0d45492af8b8a7541853d587409c Gerrit-Change-Number: 14988 Gerrit-PatchSet: 3 Gerrit-Owner: Adar Dembo <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241) Gerrit-Comment-Date: Wed, 08 Jan 2020 21:57:07 +0000 Gerrit-HasComments: Yes
