impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Armstrong (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5389: simplify BufferDescriptor lifetime
Date Thu, 15 Jun 2017 00:49:58 GMT
Tim Armstrong has posted comments on this change.

Change subject: IMPALA-5389: simplify BufferDescriptor lifetime

Patch Set 1:

Commit Message:

PS1, Line 11: test.
> test?

PS1, Line 18: was did not
> did not
File be/src/runtime/

Line 85:   *buffer = nullptr;
> maybe prefer buffer->reset() here (for me it's clearer not to use the overl
Oops missed this, it just worked by coincidence. I changed it to a DCHECK, since there's no
way passing in a buffer makes sense.
File be/src/runtime/

PS1, Line 208: len_(0),
             :     eosr_(false),
             :     scan_range_offset_(0
> we've been moving towards initializing members with constants in the header

PS1, Line 700: unique_ptr<BufferDescriptor>
> make_unique(this, reader, range, buffer, buffer_size, reader->mem_tracker_)
It unfortunately doesn't work because the constructor is not accessible to make_unique() (this
appears to be a known problem with make_unique()).

PS1, Line 710: std
> remove std::?
File be/src/runtime/disk-io-mgr.h:

PS1, Line 150: recycling of the buffer descriptor
> Since we no longer reuse the buffer descriptor, I think this comment should
File be/src/runtime/row-batch.h:

PS1, Line 217: std::unique_ptr<DiskIoMgr::BufferDescriptor>&& buffer
> Right, since you can't pass a unique_ptr<> except by moving it, I think pas
Changed it for consistency - I don't see any instances of unique_ptr<>&& in
the codebase.

Yeah the advantage of passing by value is that it means that the callee always has to take
ownership. For unique_ptr copying the pointer doesn't really matter (with the rvalue ref we're
really passing in a pointer to a pointer).

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I007d098e9a1abb1f684be37b7f1ee6c03d3879b2
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tim Armstrong <>
Gerrit-Reviewer: Henry Robinson <>
Gerrit-Reviewer: Joe McDonnell <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-HasComments: Yes

View raw message