Todd Lipcon has submitted this change and it was merged.

Change subject: Refactor cache interface to handle allocation of values and 
keys together
......................................................................


Refactor cache interface to handle allocation of values and keys together

This changes the cache interface so that the cache itself now
allocates the LRUHandle, the key, and the value all together.
The insertion process is now "two-phase": first, we allocate a new
cache entry with the appropriate size, then fill in the value,
and then we pass the entry back to the cache for insertion.

Because the cache now owns all of the memory, the "deleter"
callback is no longer necessary to free cache values. Instead,
it's just an "eviction" callback, since we still need to
take action on eviction for the code cache (and for tests).

The point of this refactor is to enable the persistent NVM cache,
which needs to allocate LRUHandles on the heap, but the keys
and values in persistent memory.

Change-Id: Iedeb24c0233bf062a0a6450a9fd3a7c57499144f
Reviewed-on: http://gerrit.cloudera.org:8080/2957
Reviewed-by: Adar Dembo <[email protected]>
Tested-by: Todd Lipcon <[email protected]>
---
M src/kudu/cfile/block_cache-test.cc
M src/kudu/cfile/block_cache.cc
M src/kudu/cfile/block_cache.h
M src/kudu/cfile/block_handle.h
M src/kudu/cfile/cfile_reader.cc
M src/kudu/codegen/code_cache.cc
M src/kudu/codegen/code_cache.h
M src/kudu/util/cache-test.cc
M src/kudu/util/cache.cc
M src/kudu/util/cache.h
M src/kudu/util/nvm_cache.cc
11 files changed, 439 insertions(+), 365 deletions(-)

Approvals:
  Adar Dembo: Looks good to me, approved
  Todd Lipcon: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iedeb24c0233bf062a0a6450a9fd3a7c57499144f
Gerrit-PatchSet: 6
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Todd Lipcon <[email protected]>

Reply via email to