Impala Public Jenkins has submitted this change and it was merged. Change subject: IMPALA-5389: simplify BufferDescriptor lifetime ......................................................................
IMPALA-5389: simplify BufferDescriptor lifetime This is cleanup to make the code easier to understand in anticipation of some trickier changes to I/O buffer management for IMPALA-4835. I do not expect any changes in behaviour as a result of this patch. * Use unique_ptr to make BufferDescriptor ownership transfer more explicit and allow enforcing that the buffers are not leaked via a DCHECK in ~BufferDescriptor. * Remove 'free_buffer_descs_' cache. TCMalloc is good at caching small objects and there will likely be a lot less lock contention compared with a single global lock. The cache did not avoid calls to malloc() anyway because appending to std::list<> requires allocating a list node. * Use std::deque instead of std::list in a couple of places - it offers O(1) push_*()/pop_*() at both ends and requires fewer calls into malloc()/free(). Testing: Ran ASAN and exhaustive builds. Change-Id: I007d098e9a1abb1f684be37b7f1ee6c03d3879b2 Reviewed-on: http://gerrit.cloudera.org:8080/7182 Reviewed-by: Tim Armstrong <[email protected]> Tested-by: Impala Public Jenkins --- M be/src/exec/hdfs-parquet-scanner.cc M be/src/exec/scanner-context.cc M be/src/exec/scanner-context.h M be/src/runtime/disk-io-mgr-scan-range.cc M be/src/runtime/disk-io-mgr-stress.cc M be/src/runtime/disk-io-mgr-test.cc M be/src/runtime/disk-io-mgr.cc M be/src/runtime/disk-io-mgr.h M be/src/runtime/row-batch.cc M be/src/runtime/row-batch.h M be/src/runtime/tmp-file-mgr.cc 11 files changed, 137 insertions(+), 202 deletions(-) Approvals: Impala Public Jenkins: Verified Tim Armstrong: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/7182 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: I007d098e9a1abb1f684be37b7f1ee6c03d3879b2 Gerrit-PatchSet: 4 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Tim Armstrong <[email protected]> Gerrit-Reviewer: Dan Hecht <[email protected]> Gerrit-Reviewer: Henry Robinson <[email protected]> Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]>
