You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by bo...@apache.org on 2020/03/31 14:18:21 UTC

[impala] branch master updated: Limit short versions of KUDU_* macros to Kudu source.

This is an automated email from the ASF dual-hosted git repository.

boroknagyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new d9a38c0  Limit short versions of KUDU_* macros to Kudu source.
d9a38c0 is described below

commit d9a38c0bac70f0cf552855183d73daf53aa09ef6
Author: Zoltan Borok-Nagy <bo...@cloudera.com>
AuthorDate: Mon Mar 30 17:40:46 2020 +0200

    Limit short versions of KUDU_* macros to Kudu source.
    
    So far we allowed short versions of Kudu macros in Impala by
    defining KUDU_HEADERS_USE_SHORT_STATUS_MACROS in all compilation units.
    I.e. DCHECK_OK meant KUDU_DCHECK_OK. This is a problem when we want to
    define our own DCHECK_OK for an Impala Status object.
    
    This commit limits KUDU_HEADERS_USE_SHORT_STATUS_MACROS to the Kudu
    source files.
    
    Unfortunately KUDU_HEADERS_USE_SHORT_STATUS_MACROS also controls some
    Kudu log macros, e.g. KUDU_LOG. With the macro KUDU_LOG is defined to
    LOG (glog). Without the macro KUDU_LOG is not defined, the Kudu library
    expects that the clients will include 'kudu/client/stubs.h' which will
    define KUDU_LOG to kudu::internal_logging::CerrLog. So far Impala didn't
    use stubs.h (we define KUDU_HEADERS_NO_STUBS), and I think we still want
    to use glog.
    So in 'common/logging.h' I defined the KUDU logging macros to glog
    macros (like if KUDU_HEADERS_USE_SHORT_STATUS_MACROS was still defined).
    
    Change-Id: I06a65353d2a9eecf956e4ceb8d21eda2eebc69d5
    Reviewed-on: http://gerrit.cloudera.org:8080/15596
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/CMakeLists.txt                   | 8 +++-----
 be/src/common/logging.h             | 5 +++++
 be/src/kudu/rpc/CMakeLists.txt      | 2 ++
 be/src/kudu/security/CMakeLists.txt | 2 ++
 be/src/kudu/util/CMakeLists.txt     | 2 ++
 be/src/util/webserver.cc            | 2 +-
 6 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index c7bd31a..a892b1f 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -213,11 +213,9 @@ set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${RULE_LAUNCH_PREFIX})
 # Thrift requires these definitions for some types that we use
 add_definitions(-DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DHAVE_NETDB_H)
 
-# Kudu flags. 1. Enable non KUDU_* prefixes for status macros to allow Kudu code to
-# compile without changing the macro. 2. Enable full support for all backing types of
-# kudu::Slices. 3. Don't include stubs.h
-add_definitions(-DKUDU_HEADERS_USE_SHORT_STATUS_MACROS -DKUDU_HEADERS_USE_RICH_SLICE
-  -DKUDU_HEADERS_NO_STUBS)
+# Kudu flags. 1. Enable full support for all backing types of kudu::Slices.
+# 2. Don't include stubs.h
+add_definitions(-DKUDU_HEADERS_USE_RICH_SLICE -DKUDU_HEADERS_NO_STUBS)
 
 # Set clang flags for cross-compiling to IR.
 # IR_COMPILE is #defined for the cross compile to remove code that bloats the IR.
diff --git a/be/src/common/logging.h b/be/src/common/logging.h
index d23d391..fd93e49 100644
--- a/be/src/common/logging.h
+++ b/be/src/common/logging.h
@@ -68,6 +68,11 @@
   DCHECK(a == b) << "[ " #a " = " << static_cast<int>(a) << " , " #b " = " \
                  << static_cast<int>(b) << " ]"
 
+/// Define Kudu logging macros to use glog macros.
+#define KUDU_LOG              LOG
+#define KUDU_CHECK            CHECK
+#define KUDU_DCHECK           DCHECK
+
 namespace impala {
 /// IR modules don't use these methods, and can't see the google namespace used in
 /// GetFullLogFilename()'s prototype.
diff --git a/be/src/kudu/rpc/CMakeLists.txt b/be/src/kudu/rpc/CMakeLists.txt
index b666de5..19b2f57 100644
--- a/be/src/kudu/rpc/CMakeLists.txt
+++ b/be/src/kudu/rpc/CMakeLists.txt
@@ -39,6 +39,8 @@ ADD_EXPORTABLE_LIBRARY(rpc_introspection_proto
   DEPS ${RPC_INTROSPECTION_PROTO_LIBS}
   NONLINK_DEPS ${RPC_INTROSPECTION_PROTO_TGTS})
 
+add_definitions(-DKUDU_HEADERS_USE_SHORT_STATUS_MACROS)
+
 ### RPC library
 set(KRPC_SRCS
     acceptor_pool.cc
diff --git a/be/src/kudu/security/CMakeLists.txt b/be/src/kudu/security/CMakeLists.txt
index ed087c0..ad7c0f6 100644
--- a/be/src/kudu/security/CMakeLists.txt
+++ b/be/src/kudu/security/CMakeLists.txt
@@ -29,6 +29,8 @@ if(NOT APPLE)
   target_link_libraries(krb5_realm_override dl)
 endif()
 
+add_definitions(-DKUDU_HEADERS_USE_SHORT_STATUS_MACROS)
+
 ##############################
 # token_proto
 ##############################
diff --git a/be/src/kudu/util/CMakeLists.txt b/be/src/kudu/util/CMakeLists.txt
index 7f894bd..6a5f1af 100644
--- a/be/src/kudu/util/CMakeLists.txt
+++ b/be/src/kudu/util/CMakeLists.txt
@@ -29,6 +29,8 @@ ADD_EXPORTABLE_LIBRARY(util_compression_proto
   DEPS protobuf
   NONLINK_DEPS ${UTIL_COMPRESSION_PROTO_TGTS})
 
+add_definitions(-DKUDU_HEADERS_USE_SHORT_STATUS_MACROS)
+
 #######################################
 # hash_proto
 #######################################
diff --git a/be/src/util/webserver.cc b/be/src/util/webserver.cc
index 9a0ef70..6a9183b 100644
--- a/be/src/util/webserver.cc
+++ b/be/src/util/webserver.cc
@@ -231,7 +231,7 @@ kudu::Status RunSpnegoStep(
 
   string resp_token_b64;
   bool is_complete;
-  RETURN_NOT_OK(kudu::gssapi::SpnegoStep(
+  KUDU_RETURN_NOT_OK(kudu::gssapi::SpnegoStep(
       neg_token, &resp_token_b64, &is_complete, authn_user));
 
   if (!resp_token_b64.empty()) {