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

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

commit 0f27dd26cae062504200268c2dbb005dab1d099d
Author: Daniel Becker <[email protected]>
AuthorDate: Wed May 14 17:49:38 2025 +0200

    IMPALA-14066 (Part 2): Fixed rebased Kudu source code to compile
    
    Based on Wehzhe Zhou's commit 92ce6fe, which fixed the code after the
    previous rebase. Also accounted for new changes.
    
    Change-Id: If4c3490689d0bfb55c082af44955d43b5169dece
    Reviewed-on: http://gerrit.cloudera.org:8080/22969
    Reviewed-by: Csaba Ringhofer <[email protected]>
    Tested-by: Daniel Becker <[email protected]>
---
 be/src/common/logging.cc                 |  2 +-
 be/src/kudu/rpc/CMakeLists.txt           | 26 ++++++---
 be/src/kudu/rpc/transfer.cc              |  2 +-
 be/src/kudu/security/CMakeLists.txt      | 21 +++++++-
 be/src/kudu/security/init.cc             | 11 ++--
 be/src/kudu/security/test/mini_kdc.cc    |  4 +-
 be/src/kudu/util/CMakeLists.txt          | 90 ++++++++++++++++++++++----------
 be/src/kudu/util/env_posix.cc            |  4 +-
 be/src/kudu/util/flags.cc                |  5 +-
 be/src/kudu/util/kudu_export.h           | 62 ++++++++++++++++++++++
 be/src/kudu/util/logging.cc              | 13 +++--
 be/src/kudu/util/web_callback_registry.h |  8 +++
 be/src/rpc/impala-service-pool.cc        |  4 +-
 13 files changed, 192 insertions(+), 60 deletions(-)

diff --git a/be/src/common/logging.cc b/be/src/common/logging.cc
index d47f6236f..c1524109c 100644
--- a/be/src/common/logging.cc
+++ b/be/src/common/logging.cc
@@ -331,7 +331,7 @@ void impala::ShutdownLogging() {
 
 void impala::LogCommandLineFlags() {
   LOG(INFO) << "Flags (see also /varz are on debug webserver):" << endl
-            << kudu::CommandlineFlagsIntoString(kudu::EscapeMode::NONE);
+      << kudu::CommandlineFlagsIntoString(kudu::EscapeMode::NONE, 
kudu::Selection::ALL);
 
   vector<google::CommandLineFlagInfo> flags;
   google::GetAllFlags(&flags, true);
diff --git a/be/src/kudu/rpc/CMakeLists.txt b/be/src/kudu/rpc/CMakeLists.txt
index 7a967c22a..c4eb997dc 100644
--- a/be/src/kudu/rpc/CMakeLists.txt
+++ b/be/src/kudu/rpc/CMakeLists.txt
@@ -15,6 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# Target including all protobuf-generated code.
+add_custom_target(kudu-rpc-proto-deps)
+
 #### Global header protobufs
 PROTOBUF_GENERATE_CPP(
   RPC_HEADER_PROTO_SRCS RPC_HEADER_PROTO_HDRS RPC_HEADER_PROTO_TGTS
@@ -26,6 +29,8 @@ ADD_EXPORTABLE_LIBRARY(rpc_header_proto
   DEPS protobuf pb_util_proto token_proto
   NONLINK_DEPS ${RPC_HEADER_PROTO_TGTS})
 
+add_dependencies(kudu-rpc-proto-deps ${RPC_HEADER_PROTO_TGTS})
+
 PROTOBUF_GENERATE_CPP(
   RPC_INTROSPECTION_PROTO_SRCS RPC_INTROSPECTION_PROTO_HDRS 
RPC_INTROSPECTION_PROTO_TGTS
   SOURCE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..
@@ -39,6 +44,10 @@ ADD_EXPORTABLE_LIBRARY(rpc_introspection_proto
   DEPS ${RPC_INTROSPECTION_PROTO_LIBS}
   NONLINK_DEPS ${RPC_INTROSPECTION_PROTO_TGTS})
 
+add_dependencies(kudu-rpc-proto-deps ${RPC_INTROSPECTION_PROTO_TGTS})
+
+add_definitions(-DKUDU_HEADERS_USE_SHORT_STATUS_MACROS)
+
 ### RPC library
 set(KRPC_SRCS
     acceptor_pool.cc
@@ -90,13 +99,16 @@ ADD_EXPORTABLE_LIBRARY(krpc
   DEPS ${KRPC_LIBS})
 
 ### RPC generator tool
-add_executable(protoc-gen-krpc protoc-gen-krpc.cc)
-target_link_libraries(protoc-gen-krpc
-    ${KUDU_BASE_LIBS}
-    rpc_header_proto
-    protoc
-    protobuf
-    gutil)
+add_executable(protoc-gen-krpc protoc-gen-krpc.cc
+  # Impala - add stub for kudu::VersionInfo
+  ${CMAKE_CURRENT_SOURCE_DIR}/../../common/kudu_version.cc
+  # Impala - add definition for any flag names shared between Impala / Kudu.
+  # TODO: Consider either removing code that depends on these flags, or 
namespacing them
+  # somehow.
+  ${CMAKE_CURRENT_SOURCE_DIR}/../../common/global-flags.cc)
+# IMPALA-8642: kudu_version.cc depends on gen-cpp/Status_types.h in target 
thrift-deps
+add_dependencies(protoc-gen-krpc thrift-deps)
+target_link_libraries(protoc-gen-krpc gutil glog gflags protoc protobuf 
rpc_header_proto ${KUDU_BASE_LIBS})
 
 ### RPC test
 if(NOT NO_TESTS)
diff --git a/be/src/kudu/rpc/transfer.cc b/be/src/kudu/rpc/transfer.cc
index 54405c25f..7d596a22c 100644
--- a/be/src/kudu/rpc/transfer.cc
+++ b/be/src/kudu/rpc/transfer.cc
@@ -43,7 +43,7 @@ DEFINE_bool(rpc_max_message_size_enable_validation, true,
             "This is a test-only flag.");
 TAG_FLAG(rpc_max_message_size_enable_validation, unsafe);
 
-DEFINE_int64(rpc_max_message_size, (50 * 1024 * 1024),
+DEFINE_int64_hidden(rpc_max_message_size, (50 * 1024 * 1024),
              "The maximum size of a message that any RPC that the server will 
accept. "
              "Must be at least 1MB.");
 TAG_FLAG(rpc_max_message_size, advanced);
diff --git a/be/src/kudu/security/CMakeLists.txt 
b/be/src/kudu/security/CMakeLists.txt
index 266aa352f..11cbf1940 100644
--- a/be/src/kudu/security/CMakeLists.txt
+++ b/be/src/kudu/security/CMakeLists.txt
@@ -19,6 +19,9 @@
 # The top-level CMakeLists sets a ${KRB5_REALM_OVERRIDE} variable which should
 # be linked first into all Kudu binaries.
 
+# Target including all protobuf-generated code.
+add_custom_target(kudu-security-proto-deps)
+
 ##############################
 # krb5_realm_override
 ##############################
@@ -29,6 +32,8 @@ if(NOT APPLE)
   target_link_libraries(krb5_realm_override dl)
 endif()
 
+add_definitions(-DKUDU_HEADERS_USE_SHORT_STATUS_MACROS)
+
 ##############################
 # token_proto
 ##############################
@@ -44,6 +49,7 @@ ADD_EXPORTABLE_LIBRARY(token_proto
   DEPS ${TOKEN_PROTO_LIBS}
   NONLINK_DEPS ${TOKEN_PROTO_TGTS})
 
+add_dependencies(kudu-security-proto-deps ${TOKEN_PROTO_TGTS})
 
 ##############################
 # security
@@ -95,12 +101,23 @@ ADD_EXPORTABLE_LIBRARY(security
   SRCS ${SECURITY_SRCS}
   DEPS ${SECURITY_LIBS})
 
+# Since Kudu tests are explicitly disabled, we want to expose some of their 
sources
+# to Impala using another variable.
+set(SECURITY_TEST_SRCS_FOR_IMPALA test/mini_kdc.cc)
+add_library(security-test-for-impala ${SECURITY_TEST_SRCS_FOR_IMPALA})
+target_link_libraries(security-test-for-impala
+  gutil
+  kudu_test_util
+  kudu_util
+  security)
+
 ##############################
 # mini_kdc
 ##############################
 
 # The mini_kdc is used only for tests.
-if (KUDU_CLI_TEST_TOOL_ENABLED)
+# Note: Impala needs it.
+#if (KUDU_CLI_TEST_TOOL_ENABLED)
   set(MINI_KDC_SRCS test/mini_kdc.cc)
 
   add_library(mini_kdc ${MINI_KDC_SRCS})
@@ -108,7 +125,7 @@ if (KUDU_CLI_TEST_TOOL_ENABLED)
     gutil
     kudu_test_util
     kudu_util)
-endif()
+#endif()
 
 ##############################
 # security_test_util
diff --git a/be/src/kudu/security/init.cc b/be/src/kudu/security/init.cc
index b4bbad6e1..5d015a6b4 100644
--- a/be/src/kudu/security/init.cc
+++ b/be/src/kudu/security/init.cc
@@ -73,16 +73,13 @@ DEFINE_bool(use_system_auth_to_local, 
kDefaultSystemAuthToLocal,
             "'kudu/foo.example.com@EXAMPLE' will map to 'kudu'.");
 TAG_FLAG(use_system_auth_to_local, advanced);
 
-DEFINE_string(principal, "kudu/_HOST",
-              "Kerberos principal that this daemon will log in as. The special 
token "
-              "_HOST will be replaced with the FQDN of the local host.");
+// Defined in Impala in common/global-flags.cc
+DECLARE_string(principal);
 TAG_FLAG(principal, advanced);
 TAG_FLAG(principal, stable);
 
-DEFINE_string(keytab_file, "",
-              "Path to the Kerberos Keytab file for this server. Specifying a "
-              "keytab file will cause the server to kinit, and enable Kerberos 
"
-              "to be used to authenticate RPC connections.");
+// Defined in Impala in common/global-flags.cc
+DECLARE_string(keytab_file);
 TAG_FLAG(keytab_file, stable);
 
 using std::mt19937;
diff --git a/be/src/kudu/security/test/mini_kdc.cc 
b/be/src/kudu/security/test/mini_kdc.cc
index 12abe5c7c..b8b0e1781 100644
--- a/be/src/kudu/security/test/mini_kdc.cc
+++ b/be/src/kudu/security/test/mini_kdc.cc
@@ -62,7 +62,9 @@ MiniKdc::MiniKdc(MiniKdcOptions options)
     options_.realm = "KRBTEST.COM";
   }
   if (options_.data_root.empty()) {
-    options_.data_root = JoinPathSegments(GetTestDataDirectory(), "krb5kdc");
+    // We hardcode "/tmp" here since the original function which initializes a 
random test
+    // directory (GetTestDataDirectory()), depends on gmock.
+    options_.data_root = JoinPathSegments("/tmp", "krb5kdc");
   }
   if (options_.ticket_lifetime.empty()) {
     options_.ticket_lifetime = "24h";
diff --git a/be/src/kudu/util/CMakeLists.txt b/be/src/kudu/util/CMakeLists.txt
index b6a64940e..d75438b3d 100644
--- a/be/src/kudu/util/CMakeLists.txt
+++ b/be/src/kudu/util/CMakeLists.txt
@@ -15,6 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# Target including all protobuf-generated code.
+add_custom_target(kudu-util-proto-deps)
+
 #######################################
 # block_bloom_filter_proto
 #######################################
@@ -29,6 +32,8 @@ ADD_EXPORTABLE_LIBRARY(block_bloom_filter_proto
   DEPS hash_proto pb_util_proto protobuf
   NONLINK_DEPS ${BLOCK_BLOOM_FILTER_PROTO_TGTS})
 
+add_dependencies(kudu-util-proto-deps ${BLOCK_BLOOM_FILTER_PROTO_TGTS})
+
 #######################################
 # util_compression_proto
 #######################################
@@ -43,6 +48,10 @@ ADD_EXPORTABLE_LIBRARY(util_compression_proto
   DEPS protobuf
   NONLINK_DEPS ${UTIL_COMPRESSION_PROTO_TGTS})
 
+add_dependencies(kudu-util-proto-deps ${UTIL_COMPRESSION_PROTO_TGTS})
+
+add_definitions(-DKUDU_HEADERS_USE_SHORT_STATUS_MACROS)
+
 #######################################
 # hash_proto
 #######################################
@@ -57,6 +66,8 @@ ADD_EXPORTABLE_LIBRARY(hash_proto
   DEPS protobuf
   NONLINK_DEPS ${HASH_PROTO_TGTS})
 
+add_dependencies(kudu-util-proto-deps ${HASH_PROTO_TGTS})
+
 #######################################
 # histogram_proto
 #######################################
@@ -71,6 +82,8 @@ ADD_EXPORTABLE_LIBRARY(histogram_proto
   DEPS protobuf
   NONLINK_DEPS ${HISTOGRAM_PROTO_TGTS})
 
+add_dependencies(kudu-util-proto-deps ${HISTOGRAM_PROTO_TGTS})
+
 #######################################
 # maintenance_manager_proto
 #######################################
@@ -85,6 +98,8 @@ ADD_EXPORTABLE_LIBRARY(maintenance_manager_proto
   DEPS protobuf
   NONLINK_DEPS ${MAINTENANCE_MANAGER_PROTO_TGTS})
 
+add_dependencies(kudu-util-proto-deps ${MAINTENANCE_MANAGER_PROTO_TGTS})
+
 #######################################
 # mem_tracker_proto
 #######################################
@@ -99,6 +114,8 @@ ADD_EXPORTABLE_LIBRARY(mem_tracker_proto
   DEPS protobuf
   NONLINK_DEPS ${MEM_TRACKER_PROTO_TGTS})
 
+add_dependencies(kudu-util-proto-deps ${MEM_TRACKER_PROTO_TGTS})
+
 #######################################
 # pb_util_proto
 #######################################
@@ -113,6 +130,8 @@ ADD_EXPORTABLE_LIBRARY(pb_util_proto
   DEPS protobuf
   NONLINK_DEPS ${PB_UTIL_PROTO_TGTS})
 
+add_dependencies(kudu-util-proto-deps ${PB_UTIL_PROTO_TGTS})
+
 #######################################
 # version_info_proto
 #######################################
@@ -127,6 +146,8 @@ ADD_EXPORTABLE_LIBRARY(version_info_proto
   DEPS protobuf
   NONLINK_DEPS ${VERSION_INFO_PROTO_TGTS})
 
+add_dependencies(kudu-util-proto-deps ${VERSION_INFO_PROTO_TGTS})
+
 ############################################################
 # Version stamp
 ############################################################
@@ -165,7 +186,8 @@ set(UTIL_SRCS
   block_bloom_filter.cc
   bloom_filter.cc
   cache.cc
-  char_util.cc
+  # Skipped in Impala builds.
+  #char_util.cc
   coding.cc
   condition_variable.cc
   cow_object.cc
@@ -181,7 +203,8 @@ set(UTIL_SRCS
   errno.cc
   faststring.cc
   fault_injection.cc
-  file_cache.cc
+  # Skipped in Impala builds.
+  #file_cache.cc
   file_cache_metrics.cc
   flags.cc
   flag_tags.cc
@@ -205,7 +228,8 @@ set(UTIL_SRCS
   memory/overwrite.cc
   mem_tracker.cc
   metrics.cc
-  minidump.cc
+  # Skipped in Impala builds.
+  #minidump.cc
   monotime.cc
   mutex.cc
   net/dns_resolver.cc
@@ -245,11 +269,14 @@ set(UTIL_SRCS
   trace_metrics.cc
   user.cc
   url-coding.cc
-  version_info.cc
+  # Remove from compilation, as it depends on generated method calls. Replaced 
by
+  # kudu_version.cc in Impala's common library.
+  #version_info.cc
   version_util.cc
   web_callback_registry.cc
   website_util.cc
-  yamlreader.cc
+  # Skipped in Impala builds.
+  #yamlreader.cc
   zlib.cc
 )
 
@@ -302,7 +329,8 @@ set(UTIL_LIBS
   openssl_crypto
   openssl_ssl
   version_info_proto
-  yaml
+  # Skipped in Impala builds.
+  #yaml
   zlib)
 
 if(NOT APPLE)
@@ -345,7 +373,8 @@ ADD_EXPORTABLE_LIBRARY(kudu_util_compression
 # Define LZ4_DISABLE_DEPRECATE_WARNINGS to mute warnings like:
 # "'int LZ4_compress(const char*, char*, int)' is deprecated".
 target_compile_definitions(kudu_util_compression PUBLIC 
LZ4_DISABLE_DEPRECATE_WARNINGS)
-target_compile_definitions(kudu_util_compression_exported PUBLIC 
LZ4_DISABLE_DEPRECATE_WARNINGS)
+# Skipped in Impala builds.
+#target_compile_definitions(kudu_util_compression_exported PUBLIC 
LZ4_DISABLE_DEPRECATE_WARNINGS)
 
 #######################################
 # kudu_curl_util
@@ -361,21 +390,23 @@ target_link_libraries(kudu_curl_util
 #######################################
 # kudu_cloud_util
 #######################################
-add_library(kudu_cloud_util
-  cloud/instance_detector.cc
-  cloud/instance_metadata.cc)
-target_link_libraries(kudu_cloud_util
-  kudu_curl_util)
+# Skipped in Impala builds as Impala doesn't use it.
+# add_library(kudu_cloud_util
+#   cloud/instance_detector.cc
+#   cloud/instance_metadata.cc)
+# target_link_libraries(kudu_cloud_util
+#   kudu_curl_util)
 
 #######################################
 # kudu_jwt_util
 #######################################
-add_library(kudu_jwt_util jwt-util.cc)
-target_link_libraries(kudu_jwt_util
-  gutil
-  security
-  kudu_curl_util
-  kudu_util)
+# Note: JWT support is already available in Impala so we use that.
+#add_library(kudu_jwt_util jwt-util.cc)
+#target_link_libraries(kudu_jwt_util
+#  gutil
+#  security
+#  kudu_curl_util
+#  kudu_util)
 
 #######################################
 # mini_oidc
@@ -429,22 +460,26 @@ endif()
 #######################################
 
 add_executable(protoc-gen-insertions protoc-gen-insertions.cc)
-target_link_libraries(protoc-gen-insertions gutil protobuf protoc 
${KUDU_BASE_LIBS})
+# Impala needs some extra dependency libs compared to Kudu.
+# Note that the order is important.
+target_link_libraries(protoc-gen-insertions gutil glog gflags protoc protobuf  
${KUDU_BASE_LIBS})
 
 #######################################
 # kudu_test_util
 #######################################
 # The kudu_test_util is used only for tests.
-if (KUDU_CLI_TEST_TOOL_ENABLED)
+# Note: Impala needs this.
+#if (KUDU_CLI_TEST_TOOL_ENABLED)
   add_library(kudu_test_util
     test_util.cc)
   target_link_libraries(kudu_test_util
     gflags
     glog
-    gmock
+    # Impala doesn't have gmock in its toolchain
+    #gmock
     gtest
     kudu_util)
-endif()
+#endif()
 
 #######################################
 # kudu_test_main
@@ -668,8 +703,9 @@ endif()
 #######################################
 # instance_detector-test
 #######################################
-ADD_KUDU_TEST(cloud/instance_detector-test)
-if(NOT NO_TESTS)
-  target_link_libraries(instance_detector-test
-    kudu_cloud_util)
-endif()
+# Impala doesn't need it.
+#ADD_KUDU_TEST(cloud/instance_detector-test)
+#if(NOT NO_TESTS)
+#  target_link_libraries(instance_detector-test
+#    kudu_cloud_util)
+#endif()
diff --git a/be/src/kudu/util/env_posix.cc b/be/src/kudu/util/env_posix.cc
index 007b923ae..fb9cd33b4 100644
--- a/be/src/kudu/util/env_posix.cc
+++ b/be/src/kudu/util/env_posix.cc
@@ -461,7 +461,7 @@ Status DoEncryptV(const EncryptionHeader* eh,
   const auto* cipher = GetEVPCipher(eh->algorithm);
   if (!cipher) {
     return Status::RuntimeError(
-        StringPrintf("no cipher for algorithm 0x%02x", eh->algorithm));
+        StringPrintf("no cipher for algorithm 0x%02x", (unsigned int) 
eh->algorithm));
   }
   auto ctx = ssl_make_unique(EVP_CIPHER_CTX_new());
   OPENSSL_RET_IF_NULL(ctx, "failed to create cipher context");
@@ -510,7 +510,7 @@ Status DoDecryptV(const EncryptionHeader* eh, uint64_t 
offset, ArrayView<Slice>
   const auto* cipher = GetEVPCipher(eh->algorithm);
   if (!cipher) {
     return Status::RuntimeError(
-        StringPrintf("no cipher for algorithm 0x%02x", eh->algorithm));
+        StringPrintf("no cipher for algorithm 0x%02x", (unsigned int) 
eh->algorithm));
   }
   auto ctx = ssl_make_unique(EVP_CIPHER_CTX_new());
   OPENSSL_RET_IF_NULL(ctx, "failed to create cipher context");
diff --git a/be/src/kudu/util/flags.cc b/be/src/kudu/util/flags.cc
index a069a2029..9b3b0a496 100644
--- a/be/src/kudu/util/flags.cc
+++ b/be/src/kudu/util/flags.cc
@@ -81,9 +81,8 @@ DEFINE_bool(dump_metrics_xml, false,
 TAG_FLAG(dump_metrics_xml, hidden);
 
 #ifdef TCMALLOC_ENABLED
-DEFINE_bool(enable_process_lifetime_heap_profiling, false, "Enables heap "
-    "profiling for the lifetime of the process. Profile output will be stored 
in the "
-    "directory specified by -heap_profile_path.");
+// Defined in Impala in common/global-flags.cc
+DECLARE_bool(enable_process_lifetime_heap_profiling);
 TAG_FLAG(enable_process_lifetime_heap_profiling, stable);
 TAG_FLAG(enable_process_lifetime_heap_profiling, advanced);
 
diff --git a/be/src/kudu/util/kudu_export.h b/be/src/kudu/util/kudu_export.h
new file mode 100644
index 000000000..3cbdf11c8
--- /dev/null
+++ b/be/src/kudu/util/kudu_export.h
@@ -0,0 +1,62 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// This file is generated during Kudu's build. Instead of recreating the 
necessary steps
+// in Impala's build process, we copy it into our repository. See
+// kudu/client/CMakeLists.txt in Kudu's repository for details.
+
+#ifndef KUDU_EXPORT_H
+#define KUDU_EXPORT_H
+
+#ifdef KUDU_STATIC_DEFINE
+#  define KUDU_EXPORT
+#  define KUDU_NO_EXPORT
+#else
+#  ifndef KUDU_EXPORT
+#    ifdef kudu_client_exported_EXPORTS
+        /* We are building this library */
+#      define KUDU_EXPORT __attribute__((visibility("default")))
+#    else
+        /* We are using this library */
+#      define KUDU_EXPORT __attribute__((visibility("default")))
+#    endif
+#  endif
+
+#  ifndef KUDU_NO_EXPORT
+#    define KUDU_NO_EXPORT __attribute__((visibility("hidden")))
+#  endif
+#endif
+
+#ifndef KUDU_DEPRECATED
+#  define KUDU_DEPRECATED __attribute__ ((__deprecated__))
+#endif
+
+#ifndef KUDU_DEPRECATED_EXPORT
+#  define KUDU_DEPRECATED_EXPORT KUDU_EXPORT KUDU_DEPRECATED
+#endif
+
+#ifndef KUDU_DEPRECATED_NO_EXPORT
+#  define KUDU_DEPRECATED_NO_EXPORT KUDU_NO_EXPORT KUDU_DEPRECATED
+#endif
+
+#if 0 /* DEFINE_NO_DEPRECATED */
+#  ifndef KUDU_NO_DEPRECATED
+#    define KUDU_NO_DEPRECATED
+#  endif
+#endif
+
+#endif
diff --git a/be/src/kudu/util/logging.cc b/be/src/kudu/util/logging.cc
index fbb41b024..ca4b90706 100644
--- a/be/src/kudu/util/logging.cc
+++ b/be/src/kudu/util/logging.cc
@@ -49,9 +49,8 @@
 #include "kudu/util/signal.h"
 #include "kudu/util/status.h"
 
-DEFINE_string(log_filename, "",
-    "Prefix of log filename - "
-    "full path is <log_dir>/<log_filename>.[INFO|WARN|ERROR|FATAL]");
+// Defined in Impala.
+DECLARE_string(log_filename);
 TAG_FLAG(log_filename, stable);
 
 DEFINE_bool(log_async, true,
@@ -64,9 +63,8 @@ DEFINE_int32(log_async_buffer_bytes_per_level, 2 * 1024 * 
1024,
              "level. Only relevant when --log_async is enabled.");
 TAG_FLAG(log_async_buffer_bytes_per_level, hidden);
 
-DEFINE_int32(max_log_files, 10,
-    "Maximum number of log files to retain per severity level. The most recent 
"
-    "log files are retained. If set to 0, all log files are retained.");
+// Defined in Impala.
+DECLARE_int32(max_log_files);
 TAG_FLAG(max_log_files, runtime);
 TAG_FLAG(max_log_files, stable);
 
@@ -277,7 +275,8 @@ void InitGoogleLoggingSafe(const char* arg) {
   IgnoreSigPipe();
 
   // For minidump support. Must be called before logging threads started.
-  CHECK_OK(BlockSigUSR1());
+  // Disabled by Impala, which does not link Kudu's minidump library.
+  //CHECK_OK(BlockSigUSR1());
 
   if (FLAGS_log_async) {
     EnableAsyncLogging();
diff --git a/be/src/kudu/util/web_callback_registry.h 
b/be/src/kudu/util/web_callback_registry.h
index 7b3e49bea..b77d4192d 100644
--- a/be/src/kudu/util/web_callback_registry.h
+++ b/be/src/kudu/util/web_callback_registry.h
@@ -64,6 +64,14 @@ class WebCallbackRegistry {
 
     // In the case of a POST, the posted data.
     std::string post_data;
+
+    // The socket address of the requester, <host>:<port>.
+    // Define this variable for IMPALA-9182.
+    std::string source_socket;
+
+    // Authenticated user, or 'anonymous' if no auth used
+    // Define this variable for IMPALA-10779.
+    std::string source_user = "anonymous";
   };
 
   // A response to an HTTP request whose body is rendered by template.
diff --git a/be/src/rpc/impala-service-pool.cc 
b/be/src/rpc/impala-service-pool.cc
index bdc3f3e82..bf3800a3a 100644
--- a/be/src/rpc/impala-service-pool.cc
+++ b/be/src/rpc/impala-service-pool.cc
@@ -231,13 +231,13 @@ kudu::Status ImpalaServicePool::QueueInboundCall(
     return kudu::Status::OK();
   }
 
-  boost::optional<kudu::rpc::InboundCall*> evicted;
+  std::optional<kudu::rpc::InboundCall*> evicted;
   auto queue_status = service_queue_.Put(c, &evicted);
   if (UNLIKELY(queue_status == kudu::rpc::QueueStatus::QUEUE_FULL)) {
     RejectTooBusy(c);
     return kudu::Status::OK();
   }
-  if (UNLIKELY(evicted != boost::none)) {
+  if (UNLIKELY(evicted.has_value())) {
     RejectTooBusy(*evicted);
   }
 

Reply via email to