You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Daniel Becker (Code Review)" <ge...@cloudera.org> on 2022/10/10 15:17:20 UTC

[Impala-ASF-CR] IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc

Daniel Becker has uploaded this change for review. ( http://gerrit.cloudera.org:8080/19118


Change subject: IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc
......................................................................

IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc

Before IMPALA-5690 we implemented operator<< for Thrift enums in Impala
code. These functions printed the names of the enums.

Then we upgraded to Thrift 0.9.3, but that release included THRIFT-2067,
which implemented operator<< for Thrift enums, but printed the number
value of enums instead of their names. To preserve the old behaviour in
Impala, we renamed our own implementations of operator<< to
PrintThriftEnum, a function that we defined for each Thrift enum we
used, and which returned a string with the names - not the numbers - of
the enums.

After upgrading Thrift to a version that included THRIFT-3921 (any
version starting from 0.11.0), these PrintThriftEnum functions are no
longer necessary as the operator<< provided by Thrift now prints the
names of enums, which is the behaviour we want.

This change removes all PrintThriftEnum functions. At the call sites
where the result of the function call was inserted into a stream, now the
enum is inserted directly (invoking the operator<< provided by Thrift).
At the call sites where a string object is expected, we replaced the
call to PrintThriftEnum with a call to a new function template,
PrintValue(), which converts any object for which operator<< is defined
to a string.

Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
---
M be/src/benchmarks/scheduler-benchmark.cc
M be/src/exec/exec-node.cc
M be/src/exec/hdfs-scan-node-base.cc
M be/src/exec/kudu/kudu-scanner.cc
M be/src/exec/parquet/parquet-column-readers.cc
M be/src/exec/parquet/parquet-metadata-utils.cc
M be/src/exec/partitioned-hash-join-builder.cc
M be/src/runtime/coordinator.cc
M be/src/runtime/fragment-instance-state.cc
M be/src/service/client-request-state.cc
M be/src/service/impala-http-handler.cc
M be/src/service/query-options.cc
M be/src/util/collection-metrics.cc
M be/src/util/debug-util.cc
M be/src/util/debug-util.h
M be/src/util/histogram-metric.cc
M be/src/util/metrics.cc
17 files changed, 50 insertions(+), 113 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/18/19118/1
-- 
To view, visit http://gerrit.cloudera.org:8080/19118
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
Gerrit-Change-Number: 19118
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Noemi Pap-Takacs <np...@cloudera.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>

[Impala-ASF-CR] IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/19118 )

Change subject: IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc
......................................................................


Patch Set 3: Verified+1


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
Gerrit-Change-Number: 19118
Gerrit-PatchSet: 3
Gerrit-Owner: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Noemi Pap-Takacs <np...@cloudera.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Thu, 20 Oct 2022 01:26:13 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc

Posted by "Csaba Ringhofer (Code Review)" <ge...@cloudera.org>.
Csaba Ringhofer has posted comments on this change. ( http://gerrit.cloudera.org:8080/19118 )

Change subject: IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc
......................................................................


Patch Set 2: Code-Review+2


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
Gerrit-Change-Number: 19118
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Noemi Pap-Takacs <np...@cloudera.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Wed, 19 Oct 2022 16:02:37 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc

Posted by "Daniel Becker (Code Review)" <ge...@cloudera.org>.
Daniel Becker has uploaded a new patch set (#2). ( http://gerrit.cloudera.org:8080/19118 )

Change subject: IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc
......................................................................

IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc

Before IMPALA-5690 we implemented operator<< for Thrift enums in Impala
code. These functions printed the names of the enums.

Then we upgraded to Thrift 0.9.3, but that release included THRIFT-2067,
which implemented operator<< for Thrift enums, but printed the number
value of enums instead of their names. To preserve the old behaviour in
Impala, we renamed our own implementations of operator<< to
PrintThriftEnum, a function that we defined for each Thrift enum we
used, and which returned a string with the names - not the numbers - of
the enums.

After upgrading Thrift to a version that included THRIFT-3921 (any
version starting from 0.11.0), these PrintThriftEnum functions are no
longer necessary as the operator<< provided by Thrift now prints the
names of enums, which is the behaviour we want.

This change removes all PrintThriftEnum functions. At the call sites
where the result of the function call was inserted into a stream, now the
enum is inserted directly (invoking the operator<< provided by Thrift).
At the call sites where a string object is expected, we replaced the
call to PrintThriftEnum with a call to a new function template,
PrintValue(), which converts any object for which operator<< is defined
to a string.

Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
---
M be/src/benchmarks/scheduler-benchmark.cc
M be/src/exec/exec-node.cc
M be/src/exec/hdfs-scan-node-base.cc
M be/src/exec/kudu/kudu-scanner.cc
M be/src/exec/parquet/parquet-column-readers.cc
M be/src/exec/parquet/parquet-metadata-utils.cc
M be/src/exec/partitioned-hash-join-builder.cc
M be/src/runtime/coordinator.cc
M be/src/runtime/fragment-instance-state.cc
M be/src/service/client-request-state.cc
M be/src/service/impala-http-handler.cc
M be/src/service/query-options.cc
M be/src/util/collection-metrics.cc
M be/src/util/debug-util.cc
M be/src/util/debug-util.h
M be/src/util/histogram-metric.cc
M be/src/util/metrics.cc
17 files changed, 50 insertions(+), 115 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/18/19118/2
-- 
To view, visit http://gerrit.cloudera.org:8080/19118
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
Gerrit-Change-Number: 19118
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Noemi Pap-Takacs <np...@cloudera.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>

[Impala-ASF-CR] IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc

Posted by "Peter Rozsa (Code Review)" <ge...@cloudera.org>.
Peter Rozsa has posted comments on this change. ( http://gerrit.cloudera.org:8080/19118 )

Change subject: IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc
......................................................................


Patch Set 1: Code-Review+1

(1 comment)

http://gerrit.cloudera.org:8080/#/c/19118/1/be/src/service/query-options.cc
File be/src/service/query-options.cc:

http://gerrit.cloudera.org:8080/#/c/19118/1/be/src/service/query-options.cc@76
PS1, Line 76: // TODO: In thrift 0.11.0 operator << is implemented for enums and this indirection can be
This comment could be removed



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
Gerrit-Change-Number: 19118
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Noemi Pap-Takacs <np...@cloudera.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Tue, 11 Oct 2022 09:04:00 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/19118 )

Change subject: IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc
......................................................................


Patch Set 1:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/11594/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
Gerrit-Change-Number: 19118
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Noemi Pap-Takacs <np...@cloudera.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Mon, 10 Oct 2022 15:38:19 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/19118 )

Change subject: IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc
......................................................................

IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc

Before IMPALA-5690 we implemented operator<< for Thrift enums in Impala
code. These functions printed the names of the enums.

Then we upgraded to Thrift 0.9.3, but that release included THRIFT-2067,
which implemented operator<< for Thrift enums, but printed the number
value of enums instead of their names. To preserve the old behaviour in
Impala, we renamed our own implementations of operator<< to
PrintThriftEnum, a function that we defined for each Thrift enum we
used, and which returned a string with the names - not the numbers - of
the enums.

After upgrading Thrift to a version that included THRIFT-3921 (any
version starting from 0.11.0), these PrintThriftEnum functions are no
longer necessary as the operator<< provided by Thrift now prints the
names of enums, which is the behaviour we want.

This change removes all PrintThriftEnum functions. At the call sites
where the result of the function call was inserted into a stream, now the
enum is inserted directly (invoking the operator<< provided by Thrift).
At the call sites where a string object is expected, we replaced the
call to PrintThriftEnum with a call to a new function template,
PrintValue(), which converts any object for which operator<< is defined
to a string.

Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
Reviewed-on: http://gerrit.cloudera.org:8080/19118
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
M be/src/benchmarks/scheduler-benchmark.cc
M be/src/exec/exec-node.cc
M be/src/exec/hdfs-scan-node-base.cc
M be/src/exec/kudu/kudu-scanner.cc
M be/src/exec/parquet/parquet-column-readers.cc
M be/src/exec/parquet/parquet-metadata-utils.cc
M be/src/exec/partitioned-hash-join-builder.cc
M be/src/runtime/coordinator.cc
M be/src/runtime/fragment-instance-state.cc
M be/src/service/client-request-state.cc
M be/src/service/impala-http-handler.cc
M be/src/service/query-options.cc
M be/src/util/collection-metrics.cc
M be/src/util/debug-util.cc
M be/src/util/debug-util.h
M be/src/util/histogram-metric.cc
M be/src/util/metrics.cc
17 files changed, 50 insertions(+), 115 deletions(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
Gerrit-Change-Number: 19118
Gerrit-PatchSet: 4
Gerrit-Owner: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Noemi Pap-Takacs <np...@cloudera.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>

[Impala-ASF-CR] IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/19118 )

Change subject: IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc
......................................................................


Patch Set 3:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/8723/ DRY_RUN=false


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
Gerrit-Change-Number: 19118
Gerrit-PatchSet: 3
Gerrit-Owner: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Noemi Pap-Takacs <np...@cloudera.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Wed, 19 Oct 2022 20:17:51 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/19118 )

Change subject: IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc
......................................................................


Patch Set 3: Code-Review+2


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
Gerrit-Change-Number: 19118
Gerrit-PatchSet: 3
Gerrit-Owner: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Noemi Pap-Takacs <np...@cloudera.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Wed, 19 Oct 2022 20:17:50 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/19118 )

Change subject: IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc
......................................................................


Patch Set 2:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/11605/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
Gerrit-Change-Number: 19118
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Daniel Becker <da...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Noemi Pap-Takacs <np...@cloudera.com>
Gerrit-Reviewer: Peter Rozsa <pr...@cloudera.com>
Gerrit-Comment-Date: Tue, 11 Oct 2022 14:40:14 +0000
Gerrit-HasComments: No