impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Armstrong (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-6134: Update code base to use impala::ConditionVariable
Date Tue, 31 Oct 2017 18:12:33 GMT
Tim Armstrong has posted comments on this change. ( http://gerrit.cloudera.org:8080/8428 )

Change subject: IMPALA-6134: Update code base to use impala::ConditionVariable
......................................................................


Patch Set 1:

(4 comments)

No serious concerns, nice to make our code more consistent.

http://gerrit.cloudera.org:8080/#/c/8428/1/be/src/util/condition-variable.h
File be/src/util/condition-variable.h:

http://gerrit.cloudera.org:8080/#/c/8428/1/be/src/util/condition-variable.h@38
PS1, Line 38:   void Wait(boost::unique_lock<boost::mutex>& lock) {
> I'm not yet familiar with this part of C++; why is 'inline' getting removed
"inline" is implied by the function being defined within the class body: https://isocpp.org/wiki/faq/inline-functions#inline-member-fns-more
. So the inline specifier has no effect. I think in general we have a lot of unnecessary inline
specifiers in the code.


http://gerrit.cloudera.org:8080/#/c/8428/1/be/src/util/condition-variable.h@48
PS1, Line 48:  const timespec* timeout
I feel like this should be a const&, since it has to be non-null. That would let us eliminate
one overload.


http://gerrit.cloudera.org:8080/#/c/8428/1/be/src/util/condition-variable.h@64
PS1, Line 64:   template <typename duration_type>
It looks like this is only ever used with microseconds - maybe we should narrow the scope
of the API to use only that type so it's a bit more obvious what is valid input. (We should
definitely add a comment regardless documenting the behaviour).


http://gerrit.cloudera.org:8080/#/c/8428/1/be/src/util/condition-variable.h@65
PS1, Line 65:   bool TimedWait(boost::unique_lock<boost::mutex>& lock,
This looks like it only has one callsite. There's another callsite in BlockingQueue::BlockingPutWithTimeout()
that does the addition in the caller. We should either consistently use this API or consistently
do the calculation in the caller. I don't feel strongly either way.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3085c6dcb42350b61244df6e7f091a1e7db356c9
Gerrit-Change-Number: 8428
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Borok-Nagy <boroknagyz@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <philip@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-Comment-Date: Tue, 31 Oct 2017 18:12:33 +0000
Gerrit-HasComments: Yes

Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message