impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zoltan Borok-Nagy (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-6134: Update code base to use impala::ConditionVariable
Date Thu, 02 Nov 2017 18:02:26 GMT
Zoltan Borok-Nagy has posted comments on this change. (

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

Patch Set 1:


> (1 comment)
 > Most of this looks mechanical, and it looked fine. You changed some
 > 1-line if's into 3-line ifs, which may be against house style.
 > We don't seem to have any tests for condition-variable.h. How did
 > you test this?

OK, I'll change the 3-line ifs back to 1-lines.
After the modifications, I ran the backend test suites on my local desktop.

Should I create tests for condition-variable.h? We don't seem to have unit tests yet.
File be/src/util/condition-variable.h:
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
About the 'struct' keyword: it is something that C requires, but in C++ it can be omitted.
If there were a function named 'timespec', then we would have to use the 'struct' keyword
in C++ as well to resolve ambiguity.
An example for that is 'stat' in POSIX, which is also a function and a struct.
PS1, Line 38:   void Wait(boost::unique_lock<boost::mutex>& lock) {
> "inline" is implied by the function being defined within the class body: ht
PS1, Line 64:   template <typename duration_type>
> It looks like this is only ever used with microseconds - maybe we should na
IMHO it is easier for the callers to specify a time duration than forcing them to calculate
a time point in the future. At least I think this is how it is used most of the time, so I
would choose this direction.

We also have calls with milliseconds(,, and seconds (
as well.

We can also narrow the scope by templates (though it is a bit ugly):
template <int N>
... subsecond_duration<time_duration, N> ...

Or, we can fix the callsites to always use microseconds.

What do you think of it?

To view, visit
To unsubscribe, visit

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 <>
Gerrit-Reviewer: Philip Zeyliger <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-Reviewer: Zoltan Borok-Nagy <>
Gerrit-Comment-Date: Thu, 02 Nov 2017 18:02:26 +0000
Gerrit-HasComments: Yes

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