Joe McDonnell has posted comments on this change. ( http://gerrit.cloudera.org:8080/21122 )
Change subject: IMPALA-12883: Support updating the charge on an entry in the cache ...................................................................... Patch Set 5: (6 comments) http://gerrit.cloudera.org:8080/#/c/21122/5/be/src/util/cache/lirs-cache-test.cc File be/src/util/cache/lirs-cache-test.cc: http://gerrit.cloudera.org:8080/#/c/21122/5/be/src/util/cache/lirs-cache-test.cc@274 PS5, Line 274: > nit. unnecessary new line The comments in this file were somewhat like Python function comments (i.e. inside the function as the first few lines). Changed them to live above the TEST_F declaration, which is more C++ style. Dropped the extra space as part of that. http://gerrit.cloudera.org:8080/#/c/21122/5/be/src/util/cache/lirs-cache-test.cc@424 PS5, Line 424: > nit. unnecessary new line Done http://gerrit.cloudera.org:8080/#/c/21122/5/be/src/util/cache/lirs-cache-test.cc@455 PS5, Line 455: > nit. unnecessary new line Done http://gerrit.cloudera.org:8080/#/c/21122/5/be/src/util/cache/lirs-cache.cc File be/src/util/cache/lirs-cache.cc: http://gerrit.cloudera.org:8080/#/c/21122/5/be/src/util/cache/lirs-cache.cc@990 PS5, Line 990: CHECK(false); > Maybe add a logging for unexpected state? Done http://gerrit.cloudera.org:8080/#/c/21122/5/be/src/util/cache/rl-cache.cc File be/src/util/cache/rl-cache.cc: http://gerrit.cloudera.org:8080/#/c/21122/5/be/src/util/cache/rl-cache.cc@324 PS5, Line 324: while (usage_ > capacity_ && rl_.next != &rl_) { : RLHandle* old = rl_.next; : RL_Remove(old); : table_.Remove(old->key(), old->hash()); : if (Unref(old)) { : old->next = to_remove_head; : to_remove_head = old; : } : } > This section of code is identical to a part of RLCacheShard<policy>::Insert Refactored this to do something similar to what LIRS does with its LIRSThreadState. That let's this use a shared EnforceCapacity function and a shared CleanupThreadState function. http://gerrit.cloudera.org:8080/#/c/21122/5/be/src/util/cache/rl-cache.cc@336 PS5, Line 336: while (to_remove_head != nullptr) { : RLHandle* next = to_remove_head->next; : FreeEntry(to_remove_head); : to_remove_head = next; : } > Same as above Done -- To view, visit http://gerrit.cloudera.org:8080/21122 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I34f54fb3a91a77821651c25d8d3bc3a2a3945025 Gerrit-Change-Number: 21122 Gerrit-PatchSet: 5 Gerrit-Owner: Joe McDonnell <joemcdonn...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Joe McDonnell <joemcdonn...@cloudera.com> Gerrit-Reviewer: Kurt Deschler <kdesc...@cloudera.com> Gerrit-Reviewer: Michael Smith <michael.sm...@cloudera.com> Gerrit-Reviewer: Yida Wu <wydbaggio...@gmail.com> Gerrit-Comment-Date: Fri, 15 Mar 2024 23:45:39 +0000 Gerrit-HasComments: Yes