Daniel Becker has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/20494 )

Change subject: IMPALA-12390 (part 4): Enable unnecessary-value-param
......................................................................


Patch Set 2:

(8 comments)

I've only gone through the first 45 files, will try to finish it later.
Also, running an ASAN test job would be a good idea because this patch touches 
ownership in many places.

http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/codegen/codegen-anyval-read-write-info.cc
File be/src/codegen/codegen-anyval-read-write-info.cc:

http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/codegen/codegen-anyval-read-write-info.cc@145
PS2, Line 145: name
Couldn't we take it by const reference? Now LlvmCodeGen::CreateBinaryPhiNode() 
takes a const ref.


http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/codegen/codegen-anyval-read-write-info.cc@150
PS2, Line 150: name
Couldn't we take it by const ref if we can do it for CodegenNullPhiNode()?


http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/TAcceptQueueServer.cpp
File be/src/rpc/TAcceptQueueServer.cpp:

http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/TAcceptQueueServer.cpp@210
PS2, Line 210:     const shared_ptr<TTransport>& io_transport, const 
shared_ptr<TTransport>& client) {
Is there a reason why we don't take 'io_transport' and 'client' as raw pointers?


http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/authentication.cc
File be/src/rpc/authentication.cc:

http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/authentication.cc@627
PS2, Line 627: string&
Is it OK if we modify this string? GetUsernameFromBasicAuthHeader() calls 
TryStripPrefixString() from gutil, which swaps it with its argument 'result' 
(https://github.com/apache/impala/blob/4d15558b5eaa69e872917c8bbf69dc1dc2146bc5/be/src/gutil/strings/strip.cc#L35)

In GetUsernameFromBasicAuthHeader() we pass an empty string as the 'result' 
argument, so 'auth_header' may end up being empty.


http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/authentication.cc@641
PS2, Line 641: string&
See L627.


http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/thrift-thread.cc
File be/src/rpc/thrift-thread.cc:

http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/thrift-thread.cc@70
PS2, Line 70:   // Passing runnable in to this method (rather than reading from 
this->runnable())
This comment indicates that taking by (const) reference may not be correct here.


http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/runtime/io/disk-io-mgr-test.cc
File be/src/runtime/io/disk-io-mgr-test.cc:

http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/runtime/io/disk-io-mgr-test.cc@720
PS2, Line 720: sub_ranges
InitRange() takes 'sub_ranges' by value and moves it into ScanRange::Reset(). 
Shouldn't SingleReaderTestBody() also take 'sub_ranges' by value and move it 
into InitRange()?


http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/runtime/io/disk-io-mgr-test.cc@1085
PS2, Line 1085: sub_ranges
See L720, although here we also use 'sub_ranges' on L1097. I'm not sure whether 
it's better to leave it like this or take 'sub_ranges' by value and move it 
only on L1097. The second option is more error-prone in case we add a third 
usage later, although this is true in every function where we use the pattern 
"accept by value - move into place".



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8aa5d98596d82f615a0a728e0235e7dd9d8b5003
Gerrit-Change-Number: 20494
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Smith <[email protected]>
Gerrit-Reviewer: Anonymous Coward <[email protected]>
Gerrit-Reviewer: Daniel Becker <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Comment-Date: Thu, 21 Sep 2023 16:09:07 +0000
Gerrit-HasComments: Yes

Reply via email to