You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by mi...@apache.org on 2026/09/01 23:10:01 UTC
(impala) branch master updated (da61c7a40 -> 7a4fc9a92)
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
from da61c7a40 IMPALA-15236: Expose HBO match provenance
new de10c584d IMPALA-13976: Switch from boost::function/bind/mem_fn to std
new 7a4fc9a92 IMPALA-14759: Upgrade to Boost 1.91
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
CMakeLists.txt | 2 +-
be/CMakeLists.txt | 4 +++-
be/src/benchmarks/process-wide-locks-benchmark.cc | 6 +++---
be/src/benchmarks/thread-create-benchmark.cc | 4 +++-
be/src/catalog/catalog-server.cc | 9 +++++++--
be/src/common/names.h | 9 ---------
be/src/exec/base-sequence-scanner.cc | 5 ++++-
be/src/exec/blocking-join-node.cc | 3 ++-
be/src/exec/exec-node.cc | 3 ++-
be/src/exec/hdfs-scan-node-base.cc | 4 +++-
be/src/exec/hdfs-scan-node.cc | 5 +++++
be/src/exec/kudu/kudu-scan-node.cc | 6 ++++++
be/src/exec/kudu/kudu-table-sink.cc | 4 ++--
be/src/exec/scan-node.cc | 2 --
be/src/exec/scanner-context.cc | 4 +++-
be/src/exec/scanner-context.h | 3 ++-
be/src/exec/tuple-file-read-write-test.cc | 2 +-
be/src/rpc/authentication.cc | 6 +++---
be/src/rpc/rpc-trace.cc | 8 +++++++-
be/src/rpc/thrift-thread.cc | 4 ++--
be/src/runtime/buffered-tuple-stream-test.cc | 1 -
be/src/runtime/buffered-tuple-stream.cc | 1 -
be/src/runtime/buffered-tuple-stream.h | 1 -
be/src/runtime/bufferpool/buffer-allocator.cc | 6 ++++--
be/src/runtime/bufferpool/buffer-pool-internal.h | 5 +++--
be/src/runtime/bufferpool/buffer-pool-test.cc | 7 ++++---
be/src/runtime/bufferpool/buffer-pool.cc | 5 ++++-
be/src/runtime/client-cache.h | 17 +++++++++--------
be/src/runtime/coordinator-backend-state.cc | 4 ++--
be/src/runtime/exec-env.cc | 6 ++++++
be/src/runtime/fragment-instance-state.cc | 5 ++++-
be/src/runtime/io/data-cache-test.cc | 6 +++---
be/src/runtime/io/data-cache.cc | 4 ++++
be/src/runtime/io/disk-io-mgr-test.cc | 5 ++++-
be/src/runtime/io/scan-range.cc | 1 -
be/src/runtime/krpc-data-stream-mgr.cc | 7 ++++++-
be/src/runtime/krpc-data-stream-recvr.cc | 3 +++
be/src/runtime/krpc-data-stream-sender.cc | 16 ++++++++--------
be/src/runtime/mem-tracker-test.cc | 14 +++++++-------
be/src/runtime/multi-precision.h | 5 +++++
be/src/runtime/query-exec-mgr.cc | 3 +++
be/src/runtime/runtime-filter-bank.cc | 4 ++--
be/src/runtime/sorted-run-merger.h | 3 ++-
be/src/runtime/sorter.cc | 7 +++++--
be/src/runtime/thread-resource-mgr-test.cc | 6 +++++-
be/src/runtime/thread-resource-mgr.cc | 6 +++---
be/src/runtime/thread-resource-mgr.h | 7 +++----
be/src/runtime/tmp-file-mgr-test.cc | 4 ++++
be/src/scheduling/admission-control-service.cc | 4 ++++
be/src/scheduling/admission-controller.cc | 1 -
be/src/scheduling/cluster-membership-mgr.cc | 7 +++++++
be/src/service/child-query.cc | 4 +++-
be/src/service/client-request-state.cc | 5 +++--
be/src/service/impala-hs2-server.cc | 1 -
be/src/service/impala-server.cc | 4 +++-
be/src/statestore/statestore-subscriber.h | 9 +++++----
be/src/statestore/statestore.cc | 5 +++++
be/src/util/blocking-queue-test.cc | 7 ++++---
be/src/util/coding-util.cc | 4 ++--
be/src/util/default-path-handlers.cc | 1 -
be/src/util/internal-queue.h | 7 +++----
be/src/util/metrics.cc | 8 ++++++--
be/src/util/metrics.h | 1 -
be/src/util/pprof-path-handlers.cc | 5 ++++-
be/src/util/runtime-profile-counters.h | 3 ++-
be/src/util/runtime-profile-periodic.cc | 4 ++--
be/src/util/runtime-profile-test.cc | 5 ++---
be/src/util/runtime-profile.cc | 4 ++--
be/src/util/runtime-profile.h | 4 ++--
be/src/util/thread-pool.h | 13 ++++++-------
be/src/util/thread.h | 15 +++++++--------
be/src/util/uid-util.cc | 2 +-
be/src/util/webserver-test.cc | 6 +++++-
be/src/util/webserver.cc | 5 +++--
be/src/util/webserver.h | 6 +++---
bin/impala-config.sh | 10 +++++-----
docker/setup_build_context.py | 20 ++++++++++++++++++++
package/CMakeLists.txt | 9 +++++++++
78 files changed, 280 insertions(+), 151 deletions(-)
(impala) 02/02: IMPALA-14759: Upgrade to Boost 1.91
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit 7a4fc9a9256ed4b90bf275bc18b81318c6bd6bbe
Author: Joe McDonnell <jo...@cloudera.com>
AuthorDate: Thu Feb 19 13:55:07 2026 -0800
IMPALA-14759: Upgrade to Boost 1.91
This adopts Boost 1.91 to have access to a new / fast hash table
and other improvements. There are various small code changes
required to adapt to this change:
- Boost rudely defines INT128_MAX and related symbols in a way
that conflicts with be/src/kudu/util/int128.h. We need to
unset those variables in be/src/runtime/multi-precision.h
to avoid those conflicts.
- Boost moved UUID to use std::mt19937 rather than the boost
version.
- Boost filesystem dropped the is_regular() API in favor
of is_regular_file().
- Boost started embedding a GDB pretty-printer script in
binaries. For codegen, that bloats the codegen size and
provides not benefit, so this turns that off by specifying
-DBOOST_ALL_NO_EMBEDDED_GDB_SCRIPTS.
- Boost changed certain filesystem APIs to use const references,
so a couple locations needed changes to fix clang-tidy issues.
- Boost added a dependency on libquadmath on x86_64, which is
provided by GCC. This updates the x86_64 packaging code to
include libquadmath from our version of GCC. libquadmath does
not support ARM, so it isn't needed there.
This bumps the version of Avro C++ as part of the toolchain
update. Building against Avro C++ is not currently supported,
so this has no impact.
Testing:
- Ran a core job
Change-Id: I4d6ef3e4793faac9b6ca9b4730671dca4bf99da5
Reviewed-on: http://gerrit.cloudera.org:8080/24737
Reviewed-by: Michael Smith <mi...@cloudera.com>
Tested-by: Michael Smith <mi...@cloudera.com>
---
CMakeLists.txt | 2 +-
be/CMakeLists.txt | 4 +++-
be/src/exec/tuple-file-read-write-test.cc | 2 +-
be/src/rpc/authentication.cc | 6 +++---
be/src/runtime/io/data-cache-test.cc | 2 +-
be/src/runtime/io/scan-range.cc | 1 -
be/src/runtime/multi-precision.h | 5 +++++
be/src/util/uid-util.cc | 2 +-
bin/impala-config.sh | 10 +++++-----
docker/setup_build_context.py | 20 ++++++++++++++++++++
package/CMakeLists.txt | 9 +++++++++
11 files changed, 49 insertions(+), 14 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0a5ce2d97..5b8d1e066 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -212,7 +212,7 @@ if (CMAKE_DEBUG)
endif()
find_package(Boost CONFIG REQUIRED
- COMPONENTS thread regex filesystem system date_time random locale serialization
+ COMPONENTS thread regex filesystem date_time random locale serialization
NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
# Mark Boost as a system header to avoid compile warnings.
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index 412580f21..0b47c145c 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -348,10 +348,12 @@ add_definitions(-DKUDU_HEADERS_USE_RICH_SLICE -DKUDU_HEADERS_NO_STUBS)
# -Wno-return-type-c-linkage: UDFs return C++ classes but use C linkage to prevent
# mangling
# -DBOOST_NO_EXCEPTIONS: call a custom error handler for exceptions in codegen'd code.
+# -DBOOST_ALL_NO_EMBEDDED_GDB_SCRIPTS: don't embed gdb pretty-printer scripts for Boost
+# types. They bloat codegen sizes without providing any value.
set(CLANG_IR_CXX_FLAGS "-emit-llvm" "-c" "-std=c++17" "-DIR_COMPILE" "-DHAVE_INTTYPES_H"
"-DHAVE_NETINET_IN_H" "-DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG" "-DBOOST_NO_EXCEPTIONS"
"-DBOOST_BIND_GLOBAL_PLACEHOLDERS" "-DBOOST_ALLOW_DEPRECATED_HEADERS"
- "-DKUDU_HEADERS_NO_STUBS" "-fcolor-diagnostics"
+ "-DBOOST_ALL_NO_EMBEDDED_GDB_SCRIPTS" "-DKUDU_HEADERS_NO_STUBS" "-fcolor-diagnostics"
"-Wno-return-type-c-linkage" "-fsigned-char")
# -Wno-deprecated-declarations: OpenSSL3 deprecated various APIs currently used by
# Impala, so this disables those warnings when using OpenSSL3 until they can be
diff --git a/be/src/exec/tuple-file-read-write-test.cc b/be/src/exec/tuple-file-read-write-test.cc
index f633bf718..66601c7e1 100644
--- a/be/src/exec/tuple-file-read-write-test.cc
+++ b/be/src/exec/tuple-file-read-write-test.cc
@@ -76,7 +76,7 @@ public:
ASSERT_OK(FileSystemUtil::RemovePaths({tmp_dir_.string()}));
}
- string Path(string filename) const {
+ string Path(const string& filename) const {
return (tmp_dir_ / filename).string();
}
diff --git a/be/src/rpc/authentication.cc b/be/src/rpc/authentication.cc
index 691a6cddd..c7ec77787 100644
--- a/be/src/rpc/authentication.cc
+++ b/be/src/rpc/authentication.cc
@@ -77,7 +77,7 @@ using boost::mt19937;
using boost::uniform_int;
using namespace apache::thrift;
using namespace apache::thrift::transport;
-using namespace boost::filesystem; // for is_regular(), is_absolute()
+using namespace boost::filesystem; // for is_regular_file(), is_absolute()
using namespace strings;
DECLARE_bool(skip_external_kerberos_auth);
@@ -1365,7 +1365,7 @@ Status AuthManager::InitKerberosEnv() {
}
if (!FLAGS_keytab_file.empty()) {
- if (!is_regular(FLAGS_keytab_file)) {
+ if (!is_regular_file(FLAGS_keytab_file)) {
return Status(Substitute("Bad --keytab_file value: The file $0 is not a "
"regular file", FLAGS_keytab_file));
}
@@ -1396,7 +1396,7 @@ Status AuthManager::InitKerberosEnv() {
// JAVA_TOOL_OPTIONS in the environment.
if (!FLAGS_krb5_conf.empty()) {
// Ensure it points to a regular file
- if (!is_regular(FLAGS_krb5_conf)) {
+ if (!is_regular_file(FLAGS_krb5_conf)) {
return Status(Substitute("Bad --krb5_conf value: The file $0 is not a "
"regular file", FLAGS_krb5_conf));
}
diff --git a/be/src/runtime/io/data-cache-test.cc b/be/src/runtime/io/data-cache-test.cc
index aa0b6115e..783b0f2f6 100644
--- a/be/src/runtime/io/data-cache-test.cc
+++ b/be/src/runtime/io/data-cache-test.cc
@@ -178,7 +178,7 @@ class DataCacheBaseTest : public testing::Test {
ASSERT_OK(cache->CloseFilesAndVerifySizes());
}
- void MockDisk(std::string name, bool is_rotational) {
+ void MockDisk(const std::string& name, bool is_rotational) {
mock_fs_ = "/tmp" / boost::filesystem::unique_path();
ASSERT_OK(FileSystemUtil::RemoveAndCreateDirectory(mock_fs_.string()));
boost::filesystem::path proc_fs = mock_fs_ / "proc";
diff --git a/be/src/runtime/io/scan-range.cc b/be/src/runtime/io/scan-range.cc
index 463aa9c5b..374598fb3 100644
--- a/be/src/runtime/io/scan-range.cc
+++ b/be/src/runtime/io/scan-range.cc
@@ -27,7 +27,6 @@
using namespace impala;
using namespace impala::io;
-using namespace std;
using std::mutex;
using std::unique_lock;
diff --git a/be/src/runtime/multi-precision.h b/be/src/runtime/multi-precision.h
index 485355321..d2a09c319 100644
--- a/be/src/runtime/multi-precision.h
+++ b/be/src/runtime/multi-precision.h
@@ -44,6 +44,11 @@
#else
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
+// Boost multiprecision defines these macros, but these interfere with kudu/util/int128.h
+#undef INT128_MIN
+#undef INT128_MAX
+#undef UINT128_MIN
+#undef UINT128_MAX
#endif
#include <functional>
diff --git a/be/src/util/uid-util.cc b/be/src/util/uid-util.cc
index 9910cc4c9..a886b971e 100644
--- a/be/src/util/uid-util.cc
+++ b/be/src/util/uid-util.cc
@@ -24,7 +24,7 @@
namespace impala {
string GenerateUUIDString() {
- boost::uuids::basic_random_generator<boost::mt19937> gen;
+ boost::uuids::basic_random_generator<std::mt19937> gen;
boost::uuids::uuid u = gen();
string uuid(u.begin(), u.end());
return uuid;
diff --git a/bin/impala-config.sh b/bin/impala-config.sh
index f92c67a67..9338683af 100755
--- a/bin/impala-config.sh
+++ b/bin/impala-config.sh
@@ -81,13 +81,13 @@ export USE_AVRO_CPP=${USE_AVRO_CPP:=false}
# moving to a different build of the toolchain, e.g. when a version is bumped or a
# compile option is changed. The build id can be found in the output of the toolchain
# build jobs, it is constructed from the build number and toolchain git hash prefix.
-export IMPALA_TOOLCHAIN_BUILD_ID_AARCH64=189-f0dd1e02a0
-export IMPALA_TOOLCHAIN_BUILD_ID_X86_64=663-f0dd1e02a0
+export IMPALA_TOOLCHAIN_BUILD_ID_AARCH64=199-30fcdeb21b
+export IMPALA_TOOLCHAIN_BUILD_ID_X86_64=672-30fcdeb21b
export IMPALA_TOOLCHAIN_REPO=\
${IMPALA_TOOLCHAIN_REPO:-https://github.com/cloudera/native-toolchain.git}
export IMPALA_TOOLCHAIN_BRANCH=${IMPALA_TOOLCHAIN_BRANCH:-master}
export IMPALA_TOOLCHAIN_COMMIT_HASH=\
-${IMPALA_TOOLCHAIN_COMMIT_HASH-f0dd1e02a081aae0cec7669f5fdadc9d54a5d259}
+${IMPALA_TOOLCHAIN_COMMIT_HASH-30fcdeb21b0d73534a2e9d4c4328a9a7a3a3d52f}
# Compare the build ref in build IDs by removing everything up-to-and-including the
# first hyphen.
if [ "${IMPALA_TOOLCHAIN_BUILD_ID_AARCH64#*-}" \
@@ -110,7 +110,7 @@ export ARCH_NAME=$(uname -m)
# Versions of toolchain dependencies.
# -----------------------------------
if $USE_AVRO_CPP; then
- export IMPALA_AVRO_VERSION=1.11.1-p1
+ export IMPALA_AVRO_VERSION=1.12.2-p1
else
export IMPALA_AVRO_VERSION=1.7.4-p5
fi
@@ -119,7 +119,7 @@ export IMPALA_ABSEIL_CPP_VERSION=20250512.2
unset IMPALA_ABSEIL_CPP_URL
export IMPALA_BINUTILS_VERSION=2.42-p24
unset IMPALA_BINUTILS_URL
-export IMPALA_BOOST_VERSION=1.74.0-p1
+export IMPALA_BOOST_VERSION=1.91.0-p1
unset IMPALA_BOOST_URL
export IMPALA_BREAKPAD_VERSION=e09741c609dcd5f5274d40182c5e2cc9a002d5ba-p3
unset IMPALA_BREAKPAD_URL
diff --git a/docker/setup_build_context.py b/docker/setup_build_context.py
index f5e51ee97..b2ff74f93 100755
--- a/docker/setup_build_context.py
+++ b/docker/setup_build_context.py
@@ -22,6 +22,7 @@
import argparse
import glob
+import platform
import os
import shutil
from subprocess import check_call
@@ -162,6 +163,25 @@ if not found_libgcc_so:
raise Exception("No libgcc.so found in search path: {0}".format(
os.path.join(GCC_HOME, "lib64")))
+# libquadmath is needed for Boost charconv / locale on x86_64 (but not ARM)
+# platform.machine() is based on "uname -m".
+if platform.machine() == "x86_64":
+ # Add libquadmath binaries to LIB_DIR (needed for Boost charconv / locale)
+ found_libquadmath_so = False
+ for libquadmath_so in glob.glob(os.path.join(
+ GCC_HOME, "lib64/{0}*.so*".format("libquadmath"))):
+ found_libquadmath_so = True
+ symlink_file_into_dirs(libquadmath_so, TARGET_LIB_DIRS)
+
+ if not found_libquadmath_so:
+ raise Exception("No libquadmath.so found in search path: {0}".format(
+ os.path.join(GCC_HOME, "lib64")))
+elif platform.machine() == "aarch64":
+ if len(glob.glob(os.path.join(GCC_HOME, "lib64/{0}*.so*".format("libquadmath")))) != 0:
+ raise Exception("Found libquadmath.so, but it is not expected to exist on ARM64")
+else:
+ raise Exception("Unknown platform {0}".format(platform.machine()))
+
# Add libkudu_client binaries to LIB_DIR. Strip debug symbols for release builds.
found_kudu_so = False
for kudu_lib_dir in kudu_lib_dirs:
diff --git a/package/CMakeLists.txt b/package/CMakeLists.txt
index 8e4c4273f..afb37525a 100644
--- a/package/CMakeLists.txt
+++ b/package/CMakeLists.txt
@@ -42,6 +42,15 @@ if("${cpp_lib}" STREQUAL "")
endif()
install(FILES ${cpp_lib} DESTINATION ${IMPALA_INSTALLDIR}/lib/native)
+# Boost requires libquadmath on x86_64 (libquadmath is not supported on ARM)
+if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
+ FILE(GLOB quadmath_lib ${IMPALA_GCC_HOME}/lib64/libquadmath.so*)
+ if("${quadmath_lib}" STREQUAL "")
+ message(FATAL_ERROR "libquadmath.so was not found in '${IMPALA_GCC_HOME}/lib64'!")
+ endif()
+ install(FILES ${quadmath_lib} DESTINATION ${IMPALA_INSTALLDIR}/lib/native)
+endif()
+
set(KUDU_HOME $ENV{IMPALA_TOOLCHAIN_PACKAGES_HOME}/kudu-$ENV{IMPALA_KUDU_VERSION}/release)
# The parent folder is lib64 on centos/redhat, while on ubuntu it's lib.
FILE(GLOB kudu_lib ${KUDU_HOME}/lib*/libkudu_client.so*)
(impala) 01/02: IMPALA-13976: Switch from boost::function/bind/mem_fn to std
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit de10c584d144fa6459813a792da00abe784f8f5b
Author: Joe McDonnell <jo...@cloudera.com>
AuthorDate: Tue Oct 22 16:22:16 2024 -0700
IMPALA-13976: Switch from boost::function/bind/mem_fn to std
Impala's code uses boost::function/bind/mem_fn in several places, but
all of this has been incorporated into the standard library. When
trying to upgrade to newer Boost (1.91.0), the use of boost::bind
and other functionality created conflicts with the standard library.
Given that there is no real advantage to staying with the Boost
version of these, this switches all locations to the standard
library.
One difference is that boost::function has a different API from
std::function. boost::function uses empty() to determine if it is
null whereas std::function can simply be compared to null. Overall,
these differences are minor and this is simply a boilerplate change.
This leaves some uses of boost::function in udf-test-harness.h,
as that file claims to support C++98. These can be removed when
we move that to a more recent C++ version.
Testing:
- Ran a core job
Change-Id: I769d84b02fbe691b3bf2a6d3f52836d5b684bae0
Reviewed-on: http://gerrit.cloudera.org:8080/21967
Reviewed-by: Michael Smith <mi...@cloudera.com>
Reviewed-by: Yida Wu <wy...@gmail.com>
Tested-by: Michael Smith <mi...@cloudera.com>
---
be/src/benchmarks/process-wide-locks-benchmark.cc | 6 +++---
be/src/benchmarks/thread-create-benchmark.cc | 4 +++-
be/src/catalog/catalog-server.cc | 9 +++++++--
be/src/common/names.h | 9 ---------
be/src/exec/base-sequence-scanner.cc | 5 ++++-
be/src/exec/blocking-join-node.cc | 3 ++-
be/src/exec/exec-node.cc | 3 ++-
be/src/exec/hdfs-scan-node-base.cc | 4 +++-
be/src/exec/hdfs-scan-node.cc | 5 +++++
be/src/exec/kudu/kudu-scan-node.cc | 6 ++++++
be/src/exec/kudu/kudu-table-sink.cc | 4 ++--
be/src/exec/scan-node.cc | 2 --
be/src/exec/scanner-context.cc | 4 +++-
be/src/exec/scanner-context.h | 3 ++-
be/src/rpc/rpc-trace.cc | 8 +++++++-
be/src/rpc/thrift-thread.cc | 4 ++--
be/src/runtime/buffered-tuple-stream-test.cc | 1 -
be/src/runtime/buffered-tuple-stream.cc | 1 -
be/src/runtime/buffered-tuple-stream.h | 1 -
be/src/runtime/bufferpool/buffer-allocator.cc | 6 ++++--
be/src/runtime/bufferpool/buffer-pool-internal.h | 5 +++--
be/src/runtime/bufferpool/buffer-pool-test.cc | 7 ++++---
be/src/runtime/bufferpool/buffer-pool.cc | 5 ++++-
be/src/runtime/client-cache.h | 17 +++++++++--------
be/src/runtime/coordinator-backend-state.cc | 4 ++--
be/src/runtime/exec-env.cc | 6 ++++++
be/src/runtime/fragment-instance-state.cc | 5 ++++-
be/src/runtime/io/data-cache-test.cc | 4 ++--
be/src/runtime/io/data-cache.cc | 4 ++++
be/src/runtime/io/disk-io-mgr-test.cc | 5 ++++-
be/src/runtime/krpc-data-stream-mgr.cc | 7 ++++++-
be/src/runtime/krpc-data-stream-recvr.cc | 3 +++
be/src/runtime/krpc-data-stream-sender.cc | 16 ++++++++--------
be/src/runtime/mem-tracker-test.cc | 14 +++++++-------
be/src/runtime/query-exec-mgr.cc | 3 +++
be/src/runtime/runtime-filter-bank.cc | 4 ++--
be/src/runtime/sorted-run-merger.h | 3 ++-
be/src/runtime/sorter.cc | 7 +++++--
be/src/runtime/thread-resource-mgr-test.cc | 6 +++++-
be/src/runtime/thread-resource-mgr.cc | 6 +++---
be/src/runtime/thread-resource-mgr.h | 7 +++----
be/src/runtime/tmp-file-mgr-test.cc | 4 ++++
be/src/scheduling/admission-control-service.cc | 4 ++++
be/src/scheduling/admission-controller.cc | 1 -
be/src/scheduling/cluster-membership-mgr.cc | 7 +++++++
be/src/service/child-query.cc | 4 +++-
be/src/service/client-request-state.cc | 5 +++--
be/src/service/impala-hs2-server.cc | 1 -
be/src/service/impala-server.cc | 4 +++-
be/src/statestore/statestore-subscriber.h | 9 +++++----
be/src/statestore/statestore.cc | 5 +++++
be/src/util/blocking-queue-test.cc | 7 ++++---
be/src/util/coding-util.cc | 4 ++--
be/src/util/default-path-handlers.cc | 1 -
be/src/util/internal-queue.h | 7 +++----
be/src/util/metrics.cc | 8 ++++++--
be/src/util/metrics.h | 1 -
be/src/util/pprof-path-handlers.cc | 5 ++++-
be/src/util/runtime-profile-counters.h | 3 ++-
be/src/util/runtime-profile-periodic.cc | 4 ++--
be/src/util/runtime-profile-test.cc | 5 ++---
be/src/util/runtime-profile.cc | 4 ++--
be/src/util/runtime-profile.h | 4 ++--
be/src/util/thread-pool.h | 13 ++++++-------
be/src/util/thread.h | 15 +++++++--------
be/src/util/webserver-test.cc | 6 +++++-
be/src/util/webserver.cc | 5 +++--
be/src/util/webserver.h | 6 +++---
68 files changed, 231 insertions(+), 137 deletions(-)
diff --git a/be/src/benchmarks/process-wide-locks-benchmark.cc b/be/src/benchmarks/process-wide-locks-benchmark.cc
index 2bf747df4..33ed57cbe 100644
--- a/be/src/benchmarks/process-wide-locks-benchmark.cc
+++ b/be/src/benchmarks/process-wide-locks-benchmark.cc
@@ -17,9 +17,9 @@
#include <stdlib.h>
#include <stdio.h>
+#include <functional>
#include <iostream>
-#include <boost/bind.hpp>
#include <boost/thread/thread.hpp>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
@@ -112,8 +112,8 @@ void ImpalaThreadStarter(void (*func) (const TUniqueId&, int), int num_threads,
for (int i=0; i < num_threads; ++i) {
unique_ptr<Thread> thread;
- function<void ()> f =
- bind(func, query_ids[i], func_arg);
+ std::function<void ()> f =
+ std::bind(func, query_ids[i], func_arg);
Status s =
Thread::Create("mythreadgroup", "thread", f, &thread);
DCHECK(s.ok());
diff --git a/be/src/benchmarks/thread-create-benchmark.cc b/be/src/benchmarks/thread-create-benchmark.cc
index 7b572425f..32f404929 100644
--- a/be/src/benchmarks/thread-create-benchmark.cc
+++ b/be/src/benchmarks/thread-create-benchmark.cc
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include <functional>
#include <iostream>
#include "util/cpu-info.h"
#include "util/debug-util.h"
@@ -25,10 +26,11 @@
#include "util/stopwatch.h"
#include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
#include "common/names.h"
+using std::bind;
+using std::function;
using namespace impala;
// Benchmark for thread creation time using native threads and
diff --git a/be/src/catalog/catalog-server.cc b/be/src/catalog/catalog-server.cc
index 9467d6fec..f19161422 100644
--- a/be/src/catalog/catalog-server.cc
+++ b/be/src/catalog/catalog-server.cc
@@ -17,6 +17,8 @@
#include "catalog/catalog-server.h"
+#include <functional>
+
#include <gutil/strings/substitute.h>
#include <thrift/protocol/TDebugProtocol.h>
#include <thrift/protocol/TJSONProtocol.h>
@@ -41,8 +43,11 @@
#include "common/names.h"
-using boost::bind;
-using boost::mem_fn;
+using std::bind;
+using std::mem_fn;
+using std::placeholders::_1;
+using std::placeholders::_2;
+using std::placeholders::_3;
using namespace apache::thrift;
using namespace rapidjson;
using namespace strings;
diff --git a/be/src/common/names.h b/be/src/common/names.h
index 51730068c..5afd42cce 100644
--- a/be/src/common/names.h
+++ b/be/src/common/names.h
@@ -168,15 +168,6 @@ using boost::unordered_map;
using boost::unordered_set;
#endif
-#ifdef BOOST_FUNCTION_PROLOGUE_HPP
-using boost::function;
-#endif
-
-#ifdef BOOST_BIND_HPP_INCLUDED
-using boost::bind;
-using boost::mem_fn;
-#endif
-
#ifdef STRINGS_SUBSTITUTE_H_
using strings::Substitute;
#endif
diff --git a/be/src/exec/base-sequence-scanner.cc b/be/src/exec/base-sequence-scanner.cc
index f288342de..2befa4b2d 100644
--- a/be/src/exec/base-sequence-scanner.cc
+++ b/be/src/exec/base-sequence-scanner.cc
@@ -15,8 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#include <functional>
#include <memory>
-#include <boost/bind.hpp>
#include "exec/base-sequence-scanner.h"
@@ -34,6 +34,9 @@
using namespace impala;
using namespace impala::io;
+using std::bind;
+using std::placeholders::_1;
+
const int BaseSequenceScanner::HEADER_SIZE = 1024;
const int BaseSequenceScanner::SYNC_MARKER = -1;
diff --git a/be/src/exec/blocking-join-node.cc b/be/src/exec/blocking-join-node.cc
index 043fdc9c4..367099ae1 100644
--- a/be/src/exec/blocking-join-node.cc
+++ b/be/src/exec/blocking-join-node.cc
@@ -18,6 +18,7 @@
#include "exec/blocking-join-node.h"
#include <algorithm>
+#include <functional>
#include <sstream>
#include "exec/join-builder.h"
@@ -223,7 +224,7 @@ Status BlockingJoinNode::OpenImpl(RuntimeState* state, JoinBuilder** separate_bu
// overlapping. We also want to count the builder profile as local time.
// The separate join build does not have this problem, because
// the build is executed in a separate fragment with a separate profile tree.
- runtime_profile_->AddLocalTimeCounter(bind<int64_t>(
+ runtime_profile_->AddLocalTimeCounter(std::bind<int64_t>(
&BlockingJoinNode::LocalTimeCounterFn, runtime_profile_->total_time_counter(),
child(0)->runtime_profile()->total_time_counter(),
child(1)->runtime_profile()->total_time_counter(),
diff --git a/be/src/exec/exec-node.cc b/be/src/exec/exec-node.cc
index a0e0e6213..288c88c1e 100644
--- a/be/src/exec/exec-node.cc
+++ b/be/src/exec/exec-node.cc
@@ -18,6 +18,7 @@
#include "exec/exec-node.h"
#include <boost/algorithm/string/join.hpp>
+#include <functional>
#include <memory>
#include <sstream>
#include <unistd.h> // for sleep()
@@ -326,7 +327,7 @@ Status ExecNode::Prepare(RuntimeState* state) {
rows_returned_counter_ = ADD_COUNTER(runtime_profile_, "RowsReturned", TUnit::UNIT);
rows_returned_rate_ = runtime_profile()->AddDerivedCounter(
ROW_THROUGHPUT_COUNTER, TUnit::UNIT_PER_SECOND,
- bind<int64_t>(&RuntimeProfile::UnitsPerSecond, rows_returned_counter_,
+ std::bind<int64_t>(&RuntimeProfile::UnitsPerSecond, rows_returned_counter_,
runtime_profile()->total_time_counter()));
RETURN_IF_ERROR(ScalarExprEvaluator::Create(conjuncts_, state, pool_, expr_perm_pool(),
expr_results_pool(), &conjunct_evals_));
diff --git a/be/src/exec/hdfs-scan-node-base.cc b/be/src/exec/hdfs-scan-node-base.cc
index c170f7b0e..9ad32f0d4 100644
--- a/be/src/exec/hdfs-scan-node-base.cc
+++ b/be/src/exec/hdfs-scan-node-base.cc
@@ -17,6 +17,8 @@
#include "exec/hdfs-scan-node-base.h"
+#include <functional>
+
#include "exec/base-sequence-scanner.h"
#include "exec/hdfs-columnar-scanner.h"
#include "exec/hdfs-scan-node-mt.h"
@@ -608,7 +610,7 @@ Status HdfsScanNodeBase::Open(RuntimeState* state) {
PROFILE_TotalRawHdfsOpenFileTime.Instantiate(runtime_profile());
per_read_thread_throughput_counter_ =
PROFILE_PerReadThreadRawHdfsThroughput.Instantiate(runtime_profile(),
- bind<int64_t>(&RuntimeProfile::UnitsPerSecond, bytes_read_counter_,
+ std::bind<int64_t>(&RuntimeProfile::UnitsPerSecond, bytes_read_counter_,
hdfs_read_timer_));
scan_ranges_complete_counter_ =
PROFILE_ScanRangesComplete.Instantiate(runtime_profile());
diff --git a/be/src/exec/hdfs-scan-node.cc b/be/src/exec/hdfs-scan-node.cc
index e5d442cba..e006eb5a0 100644
--- a/be/src/exec/hdfs-scan-node.cc
+++ b/be/src/exec/hdfs-scan-node.cc
@@ -18,6 +18,7 @@
#include "exec/hdfs-scan-node.h"
#include <chrono>
+#include <functional>
#include <memory>
#include <sstream>
@@ -51,6 +52,10 @@ DEFINE_int32(max_row_batches, 0,
DECLARE_bool(skip_file_runtime_filtering);
#endif
+using std::bind;
+using std::mem_fn;
+using std::placeholders::_1;
+
using namespace impala;
using namespace impala::io;
diff --git a/be/src/exec/kudu/kudu-scan-node.cc b/be/src/exec/kudu/kudu-scan-node.cc
index 909d56b79..321361303 100644
--- a/be/src/exec/kudu/kudu-scan-node.cc
+++ b/be/src/exec/kudu/kudu-scan-node.cc
@@ -17,6 +17,8 @@
#include "exec/kudu/kudu-scan-node.h"
+#include <functional>
+
#include <thrift/protocol/TDebugProtocol.h>
#include "exec/exec-node-util.h"
@@ -37,6 +39,10 @@
#include "common/names.h"
+using std::bind;
+using std::mem_fn;
+using std::placeholders::_1;
+
DEFINE_int32(kudu_max_row_batches, 0, "The maximum size of the row batch queue, "
" for Kudu scanners.");
diff --git a/be/src/exec/kudu/kudu-table-sink.cc b/be/src/exec/kudu/kudu-table-sink.cc
index 69829710d..e42a94b0d 100644
--- a/be/src/exec/kudu/kudu-table-sink.cc
+++ b/be/src/exec/kudu/kudu-table-sink.cc
@@ -17,9 +17,9 @@
#include "exec/kudu/kudu-table-sink.h"
+#include <functional>
#include <sstream>
-#include <boost/bind.hpp>
#include <kudu/client/client.h>
#include <kudu/client/resource_metrics.h>
#include <kudu/client/write_op.h>
@@ -126,7 +126,7 @@ Status KuduTableSink::Prepare(RuntimeState* state, MemTracker* parent_mem_tracke
kudu_apply_timer_ = ADD_TIMER(profile(), "KuduApplyTimer");
rows_processed_rate_ = profile()->AddDerivedCounter(
"RowsProcessedRate", TUnit::UNIT_PER_SECOND,
- bind<int64_t>(&RuntimeProfile::UnitsPerSecond, total_rows_,
+ std::bind<int64_t>(&RuntimeProfile::UnitsPerSecond, total_rows_,
profile()->total_time_counter()));
return Status::OK();
diff --git a/be/src/exec/scan-node.cc b/be/src/exec/scan-node.cc
index 96e4d315b..5e93916b9 100644
--- a/be/src/exec/scan-node.cc
+++ b/be/src/exec/scan-node.cc
@@ -17,8 +17,6 @@
#include "exec/scan-node.h"
-#include <boost/bind.hpp>
-
#include "exec/data-source-scan-node.h"
#include "exec/hbase/hbase-scan-node.h"
#include "exec/kudu/kudu-scan-node-mt.h"
diff --git a/be/src/exec/scanner-context.cc b/be/src/exec/scanner-context.cc
index 2e453dc96..894c3dfe0 100644
--- a/be/src/exec/scanner-context.cc
+++ b/be/src/exec/scanner-context.cc
@@ -149,7 +149,9 @@ Status ScannerContext::Stream::GetNextBuffer(int64_t read_past_size) {
int64_t read_past_buffer_size = 0;
int64_t max_buffer_size = io_mgr->max_buffer_size();
- if (!read_past_size_cb_.empty()) read_past_buffer_size = read_past_size_cb_(offset);
+ if (read_past_size_cb_ != nullptr) {
+ read_past_buffer_size = read_past_size_cb_(offset);
+ }
if (read_past_buffer_size <= 0) {
// Either no callback was set or the callback did not return an estimate. Use
// the default doubling strategy.
diff --git a/be/src/exec/scanner-context.h b/be/src/exec/scanner-context.h
index d9a5dddb8..e589d72b5 100644
--- a/be/src/exec/scanner-context.h
+++ b/be/src/exec/scanner-context.h
@@ -19,6 +19,7 @@
#include <cstdint>
#include <deque>
+#include <functional>
#include <boost/scoped_ptr.hpp>
@@ -135,7 +136,7 @@ class ScannerContext {
///
/// The callback takes the file offset of the asynchronous read (this may be more
/// than file_offset() due to data being assembled in the boundary buffer).
- typedef boost::function<int (int64_t)> ReadPastSizeCallback;
+ typedef std::function<int (int64_t)> ReadPastSizeCallback;
void set_read_past_size_cb(ReadPastSizeCallback cb) { read_past_size_cb_ = move(cb); }
/// Return the number of bytes left in the range for this stream.
diff --git a/be/src/rpc/rpc-trace.cc b/be/src/rpc/rpc-trace.cc
index 146e78f8d..464c6502f 100644
--- a/be/src/rpc/rpc-trace.cc
+++ b/be/src/rpc/rpc-trace.cc
@@ -17,7 +17,8 @@
#include "rpc/rpc-trace.h"
-#include <boost/bind.hpp>
+#include <functional>
+
#include <boost/scoped_ptr.hpp>
#include <gutil/strings/substitute.h>
@@ -35,6 +36,11 @@ using namespace impala;
using namespace rapidjson;
using namespace strings;
+using std::bind;
+using std::mem_fn;
+using std::placeholders::_1;
+using std::placeholders::_2;
+
// Metric key format for rpc call duration metrics.
const string RPC_PROCESSING_TIME_DISTRIBUTION_METRIC_KEY = "rpc-method.$0.call_duration";
diff --git a/be/src/rpc/thrift-thread.cc b/be/src/rpc/thrift-thread.cc
index 8098e80a5..0e2517cbf 100644
--- a/be/src/rpc/thrift-thread.cc
+++ b/be/src/rpc/thrift-thread.cc
@@ -17,7 +17,7 @@
#include "rpc/thrift-thread.h"
-#include <boost/bind.hpp>
+#include <functional>
#include <sstream>
#include <thrift/concurrency/Exception.h>
@@ -36,7 +36,7 @@ void ThriftThread::start() {
// makes a copy of its arguments, notably runnable() which is a shared_ptr. That ensures
// it will live as long as the thread despite passing to RunRunnable by reference.
Status status = impala::Thread::Create(group_, name_,
- bind(&ThriftThread::RunRunnable, this, runnable(), &promise), &impala_thread_);
+ std::bind(&ThriftThread::RunRunnable, this, runnable(), &promise), &impala_thread_);
// Thread creation failed. Thrift expects an exception in this case. See
// the implementation of atc::PosixThreadFactory.cpp or atc::BoostThreadFactory.cpp.
diff --git a/be/src/runtime/buffered-tuple-stream-test.cc b/be/src/runtime/buffered-tuple-stream-test.cc
index 85890df38..5dc17020f 100644
--- a/be/src/runtime/buffered-tuple-stream-test.cc
+++ b/be/src/runtime/buffered-tuple-stream-test.cc
@@ -15,7 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/thread/thread.hpp>
diff --git a/be/src/runtime/buffered-tuple-stream.cc b/be/src/runtime/buffered-tuple-stream.cc
index 009733170..648e423e6 100644
--- a/be/src/runtime/buffered-tuple-stream.cc
+++ b/be/src/runtime/buffered-tuple-stream.cc
@@ -17,7 +17,6 @@
#include "runtime/buffered-tuple-stream.inline.h"
-#include <boost/bind.hpp>
#include <gutil/strings/substitute.h>
#include "codegen/llvm-codegen.h"
diff --git a/be/src/runtime/buffered-tuple-stream.h b/be/src/runtime/buffered-tuple-stream.h
index c20799136..e1c92d767 100644
--- a/be/src/runtime/buffered-tuple-stream.h
+++ b/be/src/runtime/buffered-tuple-stream.h
@@ -20,7 +20,6 @@
#include <set>
#include <vector>
-#include <boost/function.hpp>
#include <boost/scoped_ptr.hpp>
#include "common/atomic.h"
diff --git a/be/src/runtime/bufferpool/buffer-allocator.cc b/be/src/runtime/bufferpool/buffer-allocator.cc
index 8496ee112..760daf228 100644
--- a/be/src/runtime/bufferpool/buffer-allocator.cc
+++ b/be/src/runtime/bufferpool/buffer-allocator.cc
@@ -17,10 +17,9 @@
#include "runtime/bufferpool/buffer-allocator.h"
+#include <functional>
#include <mutex>
-#include <boost/bind.hpp>
-
#include "common/atomic.h"
#include "runtime/bufferpool/system-allocator.h"
#include "util/bit-util.h"
@@ -32,6 +31,9 @@
#include "common/names.h"
+using std::bind;
+using std::placeholders::_1;
+
namespace impala {
// Collect statistics once ALLOC_STAT_SAMPLE_RATE allocations. This allows collecting
diff --git a/be/src/runtime/bufferpool/buffer-pool-internal.h b/be/src/runtime/bufferpool/buffer-pool-internal.h
index a804a5bde..463c58e12 100644
--- a/be/src/runtime/bufferpool/buffer-pool-internal.h
+++ b/be/src/runtime/bufferpool/buffer-pool-internal.h
@@ -74,6 +74,7 @@
#pragma once
+#include <functional>
#include <iosfwd>
#include <memory>
#include <mutex>
@@ -181,8 +182,8 @@ class BufferPool::PageList {
return page;
}
- void Iterate(const boost::function<bool(Page*)>& fn) { list_.Iterate(fn); }
- void IterateFirstN(const boost::function<bool(Page*)>& fn, int n) {
+ void Iterate(const std::function<bool(Page*)>& fn) { list_.Iterate(fn); }
+ void IterateFirstN(const std::function<bool(Page*)>& fn, int n) {
list_.IterateFirstN(fn, n);
}
bool Contains(Page* page) { return list_.Contains(page); }
diff --git a/be/src/runtime/bufferpool/buffer-pool-test.cc b/be/src/runtime/bufferpool/buffer-pool-test.cc
index 2348adef9..0d6b6ec6b 100644
--- a/be/src/runtime/bufferpool/buffer-pool-test.cc
+++ b/be/src/runtime/bufferpool/buffer-pool-test.cc
@@ -16,11 +16,11 @@
// under the License.
#include <cstdlib>
+#include <functional>
#include <limits>
#include <string>
#include <vector>
#include <boost/algorithm/string/join.hpp>
-#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/thread/thread.hpp>
@@ -52,6 +52,7 @@
using boost::algorithm::join;
using boost::filesystem::directory_iterator;
+using std::bind;
using std::mt19937;
using std::uniform_int_distribution;
using std::uniform_real_distribution;
@@ -571,7 +572,7 @@ TEST_F(BufferPoolTest, ConcurrentRegistration) {
// Launch threads, each with a different set of query IDs.
thread_group workers;
for (int i = 0; i < num_threads; ++i) {
- workers.add_thread(new thread(boost::bind(&BufferPoolTest::RegisterQueriesAndClients,
+ workers.add_thread(new thread(bind(&BufferPoolTest::RegisterQueriesAndClients,
this, &pool, i, queries_per_thread, sum_initial_reservations, reservation_limit,
&thread_rngs[i])));
}
@@ -1148,7 +1149,7 @@ TEST_F(BufferPoolTest, ConcurrentPageCreation) {
// Launch threads, each with a different set of query IDs.
thread_group workers;
for (int i = 0; i < num_threads; ++i) {
- workers.add_thread(new thread(boost::bind(&BufferPoolTest::CreatePageLoop, this,
+ workers.add_thread(new thread(bind(&BufferPoolTest::CreatePageLoop, this,
&pool, file_group, &global_reservations_, ops_per_thread)));
}
diff --git a/be/src/runtime/bufferpool/buffer-pool.cc b/be/src/runtime/bufferpool/buffer-pool.cc
index 8b3dd69a0..355e3ebf9 100644
--- a/be/src/runtime/bufferpool/buffer-pool.cc
+++ b/be/src/runtime/bufferpool/buffer-pool.cc
@@ -17,9 +17,9 @@
#include "runtime/bufferpool/buffer-pool-internal.h"
+#include <functional>
#include <limits>
#include <sstream>
-#include <boost/bind.hpp>
#include "common/names.h"
#include "gutil/strings/substitute.h"
@@ -33,6 +33,9 @@
#include "util/scope-exit-trigger.h"
#include "util/time.h"
+using std::bind;
+using std::placeholders::_1;
+
DEFINE_int32(concurrent_scratch_ios_per_device, 2,
"Set this to influence the number of concurrent write I/Os issues to write data to "
"scratch files. This is multiplied by the number of active scratch directories to "
diff --git a/be/src/runtime/client-cache.h b/be/src/runtime/client-cache.h
index 46ec1e679..97bb0ec9b 100644
--- a/be/src/runtime/client-cache.h
+++ b/be/src/runtime/client-cache.h
@@ -18,6 +18,7 @@
#pragma once
#include <cstdint>
+#include <functional>
#include <list>
#include <map>
#include <memory>
@@ -26,8 +27,6 @@
#include <string>
#include <typeinfo>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
#include <boost/unordered_map.hpp>
#include <thrift/Thrift.h>
#include <thrift/transport/TTransportException.h>
@@ -83,8 +82,8 @@ class ClientCacheHelper {
public:
/// Callback method which produces a client object when one cannot be found in the
/// cache. Supplied by the ClientCache wrapper.
- typedef boost::function<ThriftClientImpl* (const TNetworkAddress& address,
- ClientKey* client_key)> ClientFactory;
+ typedef std::function<ThriftClientImpl* (const TNetworkAddress& address,
+ ClientKey* client_key)> ClientFactory;
/// Returns a client for the given address in 'client_key'. If a previously created
/// client is not available (i.e. there are no entries in the per-host cache), a new
@@ -416,8 +415,9 @@ class ClientCache {
ClientCache(const std::string& service_name = "", bool enable_ssl = false)
: client_cache_helper_(1, 0, 0, 0, 0) {
- client_factory_ = boost::bind<ThriftClientImpl*>(
- boost::mem_fn(&ClientCache::MakeClient), this, _1, _2, service_name, enable_ssl);
+ client_factory_ = std::bind<ThriftClientImpl*>(
+ std::mem_fn(&ClientCache::MakeClient), this, std::placeholders::_1,
+ std::placeholders::_2, service_name, enable_ssl);
}
/// Create a ClientCache where connections are tried num_tries times, with a pause of
@@ -430,8 +430,9 @@ class ClientCache {
: client_cache_helper_(
num_tries, wait_ms, send_timeout_ms, recv_timeout_ms, conn_timeout_ms) {
DCHECK_GE(conn_timeout_ms, 0);
- client_factory_ = boost::bind<ThriftClientImpl*>(
- boost::mem_fn(&ClientCache::MakeClient), this, _1, _2, service_name, enable_ssl);
+ client_factory_ = std::bind<ThriftClientImpl*>(
+ std::mem_fn(&ClientCache::MakeClient), this, std::placeholders::_1,
+ std::placeholders::_2, service_name, enable_ssl);
}
/// Close all clients connected to the supplied address, (e.g., in
diff --git a/be/src/runtime/coordinator-backend-state.cc b/be/src/runtime/coordinator-backend-state.cc
index d6bad9659..d0af17e61 100644
--- a/be/src/runtime/coordinator-backend-state.cc
+++ b/be/src/runtime/coordinator-backend-state.cc
@@ -848,8 +848,8 @@ void Coordinator::BackendState::PublishFilter(FilterState* state,
state->IncrementNumInflightRpcs(1);
proxy->PublishFilterAsync(rpc_params, &res, &controller,
- boost::bind(&Coordinator::BackendState::PublishFilterCompleteCb, this, &controller,
- state, mem_tracker));
+ std::bind(&Coordinator::BackendState::PublishFilterCompleteCb, this, &controller,
+ state, mem_tracker));
}
void Coordinator::BackendState::PublishFilterCompleteCb(
diff --git a/be/src/runtime/exec-env.cc b/be/src/runtime/exec-env.cc
index b0e063554..36fe09ccc 100644
--- a/be/src/runtime/exec-env.cc
+++ b/be/src/runtime/exec-env.cc
@@ -17,6 +17,7 @@
#include "runtime/exec-env.h"
+#include <functional>
#include <vector>
#include <boost/algorithm/string.hpp>
@@ -82,6 +83,11 @@
using boost::algorithm::join;
using kudu::rpc::GeneratedServiceIf;
+using std::bind;
+using std::mem_fn;
+using std::placeholders::_1;
+using std::placeholders::_2;
+using std::placeholders::_3;
using namespace strings;
DEFINE_string(catalog_service_host, "localhost",
diff --git a/be/src/runtime/fragment-instance-state.cc b/be/src/runtime/fragment-instance-state.cc
index 695e4827d..8be70121b 100644
--- a/be/src/runtime/fragment-instance-state.cc
+++ b/be/src/runtime/fragment-instance-state.cc
@@ -18,8 +18,9 @@
#include "runtime/fragment-instance-state.h"
+#include <functional>
#include <sstream>
-#include <boost/bind.hpp>
+
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/thread/thread_time.hpp>
#include <thrift/protocol/TDebugProtocol.h>
@@ -58,6 +59,8 @@
using google::protobuf::RepeatedPtrField;
using kudu::rpc::RpcContext;
using namespace apache::thrift;
+using std::bind;
+using std::mem_fn;
namespace impala {
diff --git a/be/src/runtime/io/data-cache-test.cc b/be/src/runtime/io/data-cache-test.cc
index 958dbef25..aa0b6115e 100644
--- a/be/src/runtime/io/data-cache-test.cc
+++ b/be/src/runtime/io/data-cache-test.cc
@@ -16,9 +16,9 @@
// under the License.
#include <algorithm>
-#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <fstream>
+#include <functional>
#include <gflags/gflags.h>
#include <rapidjson/document.h>
#include <sys/stat.h>
@@ -141,7 +141,7 @@ class DataCacheBaseTest : public testing::Test {
num_misses[i] = 0;
string thread_name = Substitute("thread-$0", i);
ASSERT_OK(Thread::Create("data-cache-test", thread_name,
- boost::bind(&DataCacheBaseTest::ThreadFn, this,
+ std::bind(&DataCacheBaseTest::ThreadFn, this,
use_per_thread_filename ? thread_name : "", cache, max_start_offset,
&barrier, &num_misses[i], &write_times_us[i]), &thread));
threads.emplace_back(std::move(thread));
diff --git a/be/src/runtime/io/data-cache.cc b/be/src/runtime/io/data-cache.cc
index cbfdb8724..83d01db52 100644
--- a/be/src/runtime/io/data-cache.cc
+++ b/be/src/runtime/io/data-cache.cc
@@ -19,6 +19,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <functional>
#include <mutex>
#include <string.h>
#include <unistd.h>
@@ -76,6 +77,9 @@ using kudu::WritableFile;
using strings::SkipEmpty;
using strings::Split;
using boost::shared_mutex;
+using std::bind;
+using std::placeholders::_1;
+using std::placeholders::_2;
#ifdef NDEBUG
#define ENABLE_CHECKSUMMING (false)
diff --git a/be/src/runtime/io/disk-io-mgr-test.cc b/be/src/runtime/io/disk-io-mgr-test.cc
index 304421402..e53f31d35 100644
--- a/be/src/runtime/io/disk-io-mgr-test.cc
+++ b/be/src/runtime/io/disk-io-mgr-test.cc
@@ -15,8 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#include <functional>
#include <sched.h>
-#include <boost/bind.hpp>
#include <boost/thread/thread.hpp>
#include <sys/stat.h>
@@ -44,7 +44,10 @@
#include "common/names.h"
+using std::bind;
+using std::mem_fn;
using std::mt19937;
+using std::placeholders::_1;
using std::uniform_int_distribution;
using std::uniform_real_distribution;
diff --git a/be/src/runtime/krpc-data-stream-mgr.cc b/be/src/runtime/krpc-data-stream-mgr.cc
index 2c0a61e23..f7c58c02f 100644
--- a/be/src/runtime/krpc-data-stream-mgr.cc
+++ b/be/src/runtime/krpc-data-stream-mgr.cc
@@ -17,6 +17,7 @@
#include "runtime/krpc-data-stream-mgr.h"
+#include <functional>
#include <iostream>
#include <mutex>
#include <boost/functional/hash.hpp>
@@ -46,6 +47,10 @@
#include "common/names.h"
+using std::bind;
+using std::placeholders::_1;
+using std::placeholders::_2;
+
/// This parameter controls the minimum amount of time a closed stream ID will stay in
/// closed_stream_cache_ before it is evicted. It needs to be set sufficiently high that
/// it will outlive all the calls to FindRecvr() for that stream ID, to distinguish
@@ -76,7 +81,7 @@ KrpcDataStreamMgr::KrpcDataStreamMgr(MetricGroup* metrics)
deserialize_pool_("data-stream-mgr", "deserialize",
num_deserialization_threads_,
FLAGS_datastream_service_deserialization_queue_size,
- boost::bind(&KrpcDataStreamMgr::DeserializeThreadFn, this, _1, _2)) {
+ bind(&KrpcDataStreamMgr::DeserializeThreadFn, this, _1, _2)) {
MetricGroup* dsm_metrics = metrics->GetOrCreateChildGroup("datastream-manager");
num_senders_waiting_ =
dsm_metrics->AddGauge("senders-blocked-on-recvr-creation", 0L);
diff --git a/be/src/runtime/krpc-data-stream-recvr.cc b/be/src/runtime/krpc-data-stream-recvr.cc
index c42cf7354..aeb3654e4 100644
--- a/be/src/runtime/krpc-data-stream-recvr.cc
+++ b/be/src/runtime/krpc-data-stream-recvr.cc
@@ -18,6 +18,7 @@
#include "runtime/krpc-data-stream-recvr.h"
#include <condition_variable>
+#include <functional>
#include <mutex>
#include <queue>
@@ -45,7 +46,9 @@
using kudu::MonoDelta;
using kudu::MonoTime;
using kudu::rpc::RpcContext;
+using std::bind;
using std::condition_variable_any;
+using std::mem_fn;
namespace impala {
diff --git a/be/src/runtime/krpc-data-stream-sender.cc b/be/src/runtime/krpc-data-stream-sender.cc
index 70a44cd98..339fcc5fc 100644
--- a/be/src/runtime/krpc-data-stream-sender.cc
+++ b/be/src/runtime/krpc-data-stream-sender.cc
@@ -17,10 +17,9 @@
#include "runtime/krpc-data-stream-sender.h"
-#include <boost/bind.hpp>
-
#include <chrono>
#include <condition_variable>
+#include <functional>
#include <iostream>
#include <thrift/protocol/TDebugProtocol.h>
@@ -69,6 +68,7 @@ DEFINE_int64_hidden(data_stream_sender_eos_timeout_ms, 60*60*1000,
"the timeout.");
using std::condition_variable_any;
+using std::placeholders::_1;
using namespace apache::thrift;
using kudu::rpc::RpcController;
using kudu::rpc::RpcSidecar;
@@ -214,7 +214,7 @@ class KrpcDataStreamSender::Channel : public CacheLineAligned {
int CalculateRowBatchCapacity() const;
// The type for a RPC worker function.
- typedef boost::function<Status()> DoRpcFn;
+ typedef std::function<Status()> DoRpcFn;
bool IsLocal() const { return is_local_; }
KrpcDataStreamSender* GetParent() { return parent_; }
@@ -499,7 +499,7 @@ void KrpcDataStreamSender::Channel::HandleFailedRPC(const DoRpcFn& rpc_fn,
RpcMgr* rpc_mgr = ExecEnv::GetInstance()->rpc_mgr();
// RetryCb() is scheduled to be called in a reactor context.
rpc_mgr->messenger()->ScheduleOnReactor(
- boost::bind(&KrpcDataStreamSender::Channel::RetryCb, this, rpc_fn, _1),
+ std::bind(&KrpcDataStreamSender::Channel::RetryCb, this, rpc_fn, _1),
MonoDelta::FromMilliseconds(FLAGS_rpc_retry_interval_ms));
return;
}
@@ -547,7 +547,7 @@ void KrpcDataStreamSender::Channel::TransmitDataCompleteCb() {
LogSlowFailedRpc("TransmitData", total_time, controller_status);
}
DoRpcFn rpc_fn =
- boost::bind(&KrpcDataStreamSender::Channel::DoTransmitDataRpc, this);
+ std::bind(&KrpcDataStreamSender::Channel::DoTransmitDataRpc, this);
const string& prepend =
Substitute("TransmitData() to $0 failed", NetworkAddressPBToString(address_));
HandleFailedRPC(rpc_fn, controller_status, prepend);
@@ -585,7 +585,7 @@ Status KrpcDataStreamSender::Channel::DoTransmitDataRpc() {
resp_.Clear();
proxy_->TransmitDataAsync(req, &resp_, &rpc_controller_,
- boost::bind(&KrpcDataStreamSender::Channel::TransmitDataCompleteCb, this));
+ std::bind(&KrpcDataStreamSender::Channel::TransmitDataCompleteCb, this));
// 'req' took ownership of 'header'. Need to release its ownership or 'header' will be
// deleted by destructor.
req.release_row_batch_header();
@@ -667,7 +667,7 @@ void KrpcDataStreamSender::Channel::EndDataStreamCompleteCb() {
LogSlowFailedRpc("EndDataStream", total_time_ns, controller_status);
}
DoRpcFn rpc_fn =
- boost::bind(&KrpcDataStreamSender::Channel::DoEndDataStreamRpc, this);
+ std::bind(&KrpcDataStreamSender::Channel::DoEndDataStreamRpc, this);
const string& prepend =
Substitute("EndDataStream() to $0 failed", NetworkAddressPBToString(address_));
HandleFailedRPC(rpc_fn, controller_status, prepend);
@@ -690,7 +690,7 @@ Status KrpcDataStreamSender::Channel::DoEndDataStreamRpc() {
eos_resp_.Clear();
rpc_start_time_ns_ = MonotonicNanos();
proxy_->EndDataStreamAsync(eos_req, &eos_resp_, &rpc_controller_,
- boost::bind(&KrpcDataStreamSender::Channel::EndDataStreamCompleteCb, this));
+ std::bind(&KrpcDataStreamSender::Channel::EndDataStreamCompleteCb, this));
return Status::OK();
}
diff --git a/be/src/runtime/mem-tracker-test.cc b/be/src/runtime/mem-tracker-test.cc
index 081edfdc8..688a77b98 100644
--- a/be/src/runtime/mem-tracker-test.cc
+++ b/be/src/runtime/mem-tracker-test.cc
@@ -15,8 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#include <functional>
#include <string>
-#include <boost/bind.hpp>
#include "runtime/mem-tracker.h"
#include "testutil/gtest-util.h"
@@ -327,7 +327,7 @@ TEST(MemTestTest, GcFunctions) {
// Attach GcFunction that releases 1 byte
GcFunctionHelper gc_func_helper(&t);
- t.AddGcFunction(boost::bind(&GcFunctionHelper::GcFunc, &gc_func_helper));
+ t.AddGcFunction(std::bind(&GcFunctionHelper::GcFunc, &gc_func_helper));
EXPECT_TRUE(t.TryConsume(2));
EXPECT_EQ(t.consumption(), 10);
EXPECT_FALSE(t.LimitExceeded(MemLimit::HARD));
@@ -351,9 +351,9 @@ TEST(MemTestTest, GcFunctions) {
// Add more GcFunctions, test that we only call them until the limit is no longer
// exceeded
GcFunctionHelper gc_func_helper2(&t);
- t.AddGcFunction(boost::bind(&GcFunctionHelper::GcFunc, &gc_func_helper2));
+ t.AddGcFunction(std::bind(&GcFunctionHelper::GcFunc, &gc_func_helper2));
GcFunctionHelper gc_func_helper3(&t);
- t.AddGcFunction(boost::bind(&GcFunctionHelper::GcFunc, &gc_func_helper3));
+ t.AddGcFunction(std::bind(&GcFunctionHelper::GcFunc, &gc_func_helper3));
t.Consume(1);
EXPECT_EQ(t.consumption(), 11);
EXPECT_FALSE(t.LimitExceeded(MemLimit::HARD));
@@ -368,11 +368,11 @@ TEST(MemTestTest, GcFunctions) {
// Attach three GcFunctions that each release 1 byte
GcFunctionHelper gc_extra_func_helper(&t_extra);
- t_extra.AddGcFunction(boost::bind(&GcFunctionHelper::GcFunc, &gc_extra_func_helper));
+ t_extra.AddGcFunction(std::bind(&GcFunctionHelper::GcFunc, &gc_extra_func_helper));
GcFunctionHelper gc_extra_func_helper2(&t_extra);
- t_extra.AddGcFunction(boost::bind(&GcFunctionHelper::GcFunc, &gc_extra_func_helper2));
+ t_extra.AddGcFunction(std::bind(&GcFunctionHelper::GcFunc, &gc_extra_func_helper2));
GcFunctionHelper gc_extra_func_helper3(&t_extra);
- t_extra.AddGcFunction(boost::bind(&GcFunctionHelper::GcFunc, &gc_extra_func_helper3));
+ t_extra.AddGcFunction(std::bind(&GcFunctionHelper::GcFunc, &gc_extra_func_helper3));
// Freeing extra bytes for GC doesn't change when we call GC. We can go up to the limit
// and it will not call GC.
diff --git a/be/src/runtime/query-exec-mgr.cc b/be/src/runtime/query-exec-mgr.cc
index 53a4ae55d..333c06cc0 100644
--- a/be/src/runtime/query-exec-mgr.cc
+++ b/be/src/runtime/query-exec-mgr.cc
@@ -18,6 +18,7 @@
#include "runtime/query-exec-mgr.h"
+#include <functional>
#include <memory>
#include <ostream>
#include <string>
@@ -43,6 +44,8 @@
#include "common/names.h"
+using std::bind;
+using std::placeholders::_2;
using std::unordered_set;
using std::vector;
using namespace impala;
diff --git a/be/src/runtime/runtime-filter-bank.cc b/be/src/runtime/runtime-filter-bank.cc
index 6b27390a3..d41eeb302 100644
--- a/be/src/runtime/runtime-filter-bank.cc
+++ b/be/src/runtime/runtime-filter-bank.cc
@@ -564,7 +564,7 @@ void RuntimeFilterBank::DistributeCompleteFilter(
if (to_coordinator) {
proxy->UpdateFilterAsync(params, res, controller,
- boost::bind(
+ std::bind(
&RuntimeFilterBank::UpdateFilterCompleteCb, this, controller, res, false));
if (complete_filter->RequireSubAggregation()) {
@@ -576,7 +576,7 @@ void RuntimeFilterBank::DistributeCompleteFilter(
}
} else {
proxy->UpdateFilterFromRemoteAsync(params, res, controller,
- boost::bind(
+ std::bind(
&RuntimeFilterBank::UpdateFilterCompleteCb, this, controller, res, true));
}
diff --git a/be/src/runtime/sorted-run-merger.h b/be/src/runtime/sorted-run-merger.h
index ba3186248..7c90a9a65 100644
--- a/be/src/runtime/sorted-run-merger.h
+++ b/be/src/runtime/sorted-run-merger.h
@@ -17,6 +17,7 @@
#pragma once
+#include <functional>
#include <mutex>
#include <boost/scoped_ptr.hpp>
@@ -55,7 +56,7 @@ class SortedRunMerger {
/// is owned by the supplier (i.e. not SortedRunMerger). eos is indicated by a NULL
/// batch being returned. The returned batch can have any number of rows (including
/// zero).
- typedef boost::function<Status (RowBatch**)> RunBatchSupplierFn;
+ typedef std::function<Status (RowBatch**)> RunBatchSupplierFn;
typedef void (*HeapifyHelperFn)(SortedRunMerger*, int);
SortedRunMerger(const TupleRowComparator& comparator, const RowDescriptor* row_desc,
diff --git a/be/src/runtime/sorter.cc b/be/src/runtime/sorter.cc
index dee4c749d..58236b907 100644
--- a/be/src/runtime/sorter.cc
+++ b/be/src/runtime/sorter.cc
@@ -17,7 +17,7 @@
#include "runtime/sorter-internal.h"
-#include <boost/bind.hpp>
+#include <functional>
#include <gutil/strings/substitute.h>
#include "codegen/llvm-codegen.h"
@@ -36,6 +36,9 @@
#include "common/names.h"
using namespace strings;
+using std::bind;
+using std::mem_fn;
+using std::placeholders::_1;
namespace impala {
@@ -1571,7 +1574,7 @@ Status Sorter::CreateMerger(int num_runs, bool external) {
new SortedRunMerger(*compare_less_than_, output_row_desc_, profile_, external,
codegend_heapify_helper_fn_));
- vector<function<Status (RowBatch**)>> merge_runs;
+ vector<std::function<Status (RowBatch**)>> merge_runs;
merge_runs.reserve(num_runs);
for (int i = 0; i < num_runs; ++i) {
Run* run = runs_to_merge->front();
diff --git a/be/src/runtime/thread-resource-mgr-test.cc b/be/src/runtime/thread-resource-mgr-test.cc
index 1005d1e75..4784dd63f 100644
--- a/be/src/runtime/thread-resource-mgr-test.cc
+++ b/be/src/runtime/thread-resource-mgr-test.cc
@@ -15,8 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+#include <functional>
#include <string>
-#include <boost/bind.hpp>
#include "runtime/thread-resource-mgr.h"
#include "testutil/gtest-util.h"
@@ -24,6 +24,10 @@
#include "common/names.h"
+using std::bind;
+using std::mem_fn;
+using std::placeholders::_1;
+
namespace impala {
class NotifiedCounter {
diff --git a/be/src/runtime/thread-resource-mgr.cc b/be/src/runtime/thread-resource-mgr.cc
index 6fd0d7b51..c2917c55c 100644
--- a/be/src/runtime/thread-resource-mgr.cc
+++ b/be/src/runtime/thread-resource-mgr.cc
@@ -83,9 +83,9 @@ int ThreadResourcePool::AddThreadAvailableCb(ThreadAvailableCb fn) {
void ThreadResourcePool::RemoveThreadAvailableCb(int id) {
unique_lock<mutex> l(lock_);
- DCHECK(!thread_callbacks_[id].empty());
+ DCHECK(thread_callbacks_[id] != nullptr);
DCHECK_GT(num_callbacks_.Load(), 0);
- thread_callbacks_[id].clear();
+ thread_callbacks_[id] = nullptr;
num_callbacks_.Add(-1);
}
@@ -101,7 +101,7 @@ void ThreadResourcePool::InvokeCallbacks() {
while (num_available_threads() > 0 && num_invoked < num_callbacks_.Load()) {
DCHECK_LT(next_callback_idx_, thread_callbacks_.size());
ThreadAvailableCb fn = thread_callbacks_[next_callback_idx_];
- if (LIKELY(!fn.empty())) {
+ if (LIKELY(fn != nullptr)) {
++num_invoked;
fn(this);
}
diff --git a/be/src/runtime/thread-resource-mgr.h b/be/src/runtime/thread-resource-mgr.h
index e0f65169f..27a7db14d 100644
--- a/be/src/runtime/thread-resource-mgr.h
+++ b/be/src/runtime/thread-resource-mgr.h
@@ -19,10 +19,9 @@
#include <stdlib.h>
-#include <mutex>
-#include <boost/function.hpp>
-
+#include <functional>
#include <list>
+#include <mutex>
#include "common/atomic.h"
#include "common/status.h"
@@ -114,7 +113,7 @@ class ThreadResourcePool {
/// when it is called, a thread is available (the quota could have changed again in
/// between). It is simply that something might have happened (similar to condition
/// variable semantics).
- typedef boost::function<void (ThreadResourcePool*)> ThreadAvailableCb;
+ typedef std::function<void (ThreadResourcePool*)> ThreadAvailableCb;
~ThreadResourcePool() { DCHECK(parent_ == nullptr) << "Must unregister pool"; }
diff --git a/be/src/runtime/tmp-file-mgr-test.cc b/be/src/runtime/tmp-file-mgr-test.cc
index 9b44d1415..e88e4362c 100644
--- a/be/src/runtime/tmp-file-mgr-test.cc
+++ b/be/src/runtime/tmp-file-mgr-test.cc
@@ -17,6 +17,7 @@
#include <cstdio>
#include <cstdlib>
+#include <functional>
#include <limits>
#include <mutex>
#include <numeric>
@@ -48,6 +49,9 @@
using boost::filesystem::path;
using boost::uuids::random_generator;
+using std::bind;
+using std::mem_fn;
+using std::placeholders::_1;
DECLARE_bool(disk_spill_encryption);
DECLARE_int64(disk_spill_compression_buffer_limit_bytes);
diff --git a/be/src/scheduling/admission-control-service.cc b/be/src/scheduling/admission-control-service.cc
index edfafd751..400a0fe4c 100644
--- a/be/src/scheduling/admission-control-service.cc
+++ b/be/src/scheduling/admission-control-service.cc
@@ -17,6 +17,8 @@
#include "scheduling/admission-control-service.h"
+#include <functional>
+
#include "common/constant-strings.h"
#include "common/names.h"
#include "common/status-serialization.h"
@@ -38,6 +40,8 @@
#include "util/promise.h"
using kudu::rpc::RpcContext;
+using std::bind;
+using std::placeholders::_2;
static const string QUEUE_LIMIT_MSG = "(Advanced) Limit on RPC payloads consumption for "
"AdmissionControlService. "
diff --git a/be/src/scheduling/admission-controller.cc b/be/src/scheduling/admission-controller.cc
index 955e56d07..a2b22c52c 100644
--- a/be/src/scheduling/admission-controller.cc
+++ b/be/src/scheduling/admission-controller.cc
@@ -17,7 +17,6 @@
#include "scheduling/admission-controller.h"
-#include <boost/mem_fn.hpp>
#include <gutil/strings/stringpiece.h>
#include <gutil/strings/substitute.h>
diff --git a/be/src/scheduling/cluster-membership-mgr.cc b/be/src/scheduling/cluster-membership-mgr.cc
index 85e2a5a34..f642380ce 100644
--- a/be/src/scheduling/cluster-membership-mgr.cc
+++ b/be/src/scheduling/cluster-membership-mgr.cc
@@ -17,6 +17,8 @@
#include "scheduling/cluster-membership-mgr.h"
+#include <functional>
+
#include <boost/algorithm/string/join.hpp>
#include <gutil/strings/split.h>
#include <gutil/strings/stringpiece.h>
@@ -34,6 +36,11 @@ DECLARE_string(expected_executor_group_sets);
DECLARE_string(cluster_membership_topic_id);
DECLARE_int32(cluster_membership_retained_removed_coords);
+using std::bind;
+using std::mem_fn;
+using std::placeholders::_1;
+using std::placeholders::_2;
+
namespace {
using namespace impala;
diff --git a/be/src/service/child-query.cc b/be/src/service/child-query.cc
index 70cd43250..87b1723c1 100644
--- a/be/src/service/child-query.cc
+++ b/be/src/service/child-query.cc
@@ -17,6 +17,8 @@
#include "service/child-query.h"
+#include <functional>
+
#include "common/status-serialization.h"
#include "service/impala-server.inline.h"
#include "service/client-request-state.h"
@@ -194,7 +196,7 @@ Status ChildQueryExecutor::ExecAsync(vector<ChildQuery>&& child_queries) {
if (is_cancelled_) return Status::OK();
child_queries_ = move(child_queries);
RETURN_IF_ERROR(Thread::Create("query-exec-state", "async child queries",
- bind(&ChildQueryExecutor::ExecChildQueries, this), &child_queries_thread_));
+ std::bind(&ChildQueryExecutor::ExecChildQueries, this), &child_queries_thread_));
is_running_ = true;
return Status::OK();
}
diff --git a/be/src/service/client-request-state.cc b/be/src/service/client-request-state.cc
index b6514f254..ff008a9ea 100644
--- a/be/src/service/client-request-state.cc
+++ b/be/src/service/client-request-state.cc
@@ -22,6 +22,7 @@
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
+#include <functional>
#include <limits>
#include <gutil/strings/substitute.h>
#include <rapidjson/rapidjson.h>
@@ -152,8 +153,8 @@ ClientRequestState::ClientRequestState(const TQueryCtx& query_ctx, Frontend* fro
num_rows_fetched_counter_ = ADD_COUNTER(server_profile_, "NumRowsFetched", TUnit::UNIT);
row_materialization_rate_ =
server_profile_->AddDerivedCounter("RowMaterializationRate", TUnit::UNIT_PER_SECOND,
- bind<int64_t>(&RuntimeProfile::UnitsPerSecond, num_rows_fetched_counter_,
- row_materialization_timer_));
+ std::bind<int64_t>(&RuntimeProfile::UnitsPerSecond, num_rows_fetched_counter_,
+ row_materialization_timer_));
num_rows_fetched_from_cache_counter_ =
ADD_COUNTER(server_profile_, "NumRowsFetchedFromCache", TUnit::UNIT);
client_wait_timer_ = ADD_TIMER(server_profile_, "ClientFetchWaitTimer");
diff --git a/be/src/service/impala-hs2-server.cc b/be/src/service/impala-hs2-server.cc
index a925f7076..ce5d41674 100644
--- a/be/src/service/impala-hs2-server.cc
+++ b/be/src/service/impala-hs2-server.cc
@@ -23,7 +23,6 @@
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/join.hpp>
-#include <boost/bind.hpp>
#include <boost/unordered_set.hpp>
#include <gtest/gtest.h>
#include <gutil/strings/substitute.h>
diff --git a/be/src/service/impala-server.cc b/be/src/service/impala-server.cc
index 5c967ae03..89265e8e4 100644
--- a/be/src/service/impala-server.cc
+++ b/be/src/service/impala-server.cc
@@ -20,6 +20,7 @@
#include <unistd.h>
#include <algorithm>
#include <exception>
+#include <functional>
#include <sstream>
#include <string_view>
#ifdef CALLONCEHACK
@@ -30,7 +31,6 @@
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/trim.hpp>
-#include <boost/bind.hpp>
#include <boost/unordered_set.hpp>
#include <gutil/strings/split.h>
#include <gutil/strings/substitute.h>
@@ -125,6 +125,8 @@ using google::protobuf::RepeatedPtrField;
using kudu::GetRandomSeed32;
using kudu::rpc::RpcContext;
using kudu::security::SecurityDefaults;
+using std::bind;
+using std::placeholders::_2;
using namespace apache::hive::service::cli::thrift;
using namespace apache::thrift;
using namespace apache::thrift::transport;
diff --git a/be/src/statestore/statestore-subscriber.h b/be/src/statestore/statestore-subscriber.h
index 67b98810b..9eb993122 100644
--- a/be/src/statestore/statestore-subscriber.h
+++ b/be/src/statestore/statestore-subscriber.h
@@ -17,6 +17,7 @@
#pragma once
+#include <functional>
#include <mutex>
#include <string>
@@ -104,8 +105,8 @@ class StatestoreSubscriber {
/// Callbacks may publish new updates to any topic via the
/// topic_updates parameter, although updates for unknown topics
/// (i.e. those with no subscribers) will be ignored.
- typedef boost::function<void (const TopicDeltaMap& state,
- std::vector<TTopicDelta>* topic_updates)> UpdateCallback;
+ typedef std::function<void (const TopicDeltaMap& state,
+ std::vector<TTopicDelta>* topic_updates)> UpdateCallback;
/// Adds a topic to the set of topics that updates will be received for.
Status AddTopic(const Statestore::TopicId& topic_id, bool is_transient,
@@ -128,7 +129,7 @@ class StatestoreSubscriber {
/// ignored by coordinators and catalogds after statestore is restarted. In this case,
/// active_catalogd_version is set as invalid value -1. catalogd_registration has
/// invalid value and should not be used by callee.
- typedef boost::function<void (
+ typedef std::function<void (
bool is_registration_reply, int64_t active_catalogd_version,
const TCatalogRegistration& catalogd_registration)> UpdateCatalogdCallback;
@@ -137,7 +138,7 @@ class StatestoreSubscriber {
/// CompleteRegistrationCallback is invoked when the registration with the statestore
/// is completed.
- typedef boost::function<void ()>CompleteRegistrationCallback;
+ typedef std::function<void ()>CompleteRegistrationCallback;
/// Adds a callback for registration completion.
void AddCompleteRegistrationTopic(const CompleteRegistrationCallback& callback);
diff --git a/be/src/statestore/statestore.cc b/be/src/statestore/statestore.cc
index 379163540..37210e7ea 100644
--- a/be/src/statestore/statestore.cc
+++ b/be/src/statestore/statestore.cc
@@ -18,6 +18,7 @@
#include "statestore/statestore.h"
#include <algorithm>
+#include <functional>
#include <tuple>
#include <utility>
@@ -56,8 +57,12 @@ using boost::shared_lock;
using boost::shared_mutex;
using boost::upgrade_lock;
using boost::upgrade_to_unique_lock;
+using std::bind;
using std::forward_as_tuple;
+using std::mem_fn;
using std::piecewise_construct;
+using std::placeholders::_1;
+using std::placeholders::_2;
using namespace apache::thrift;
using namespace impala;
using namespace rapidjson;
diff --git a/be/src/util/blocking-queue-test.cc b/be/src/util/blocking-queue-test.cc
index 918e1568b..32be454dd 100644
--- a/be/src/util/blocking-queue-test.cc
+++ b/be/src/util/blocking-queue-test.cc
@@ -16,6 +16,7 @@
// under the License.
#include <unistd.h>
+#include <functional>
#include <mutex>
#include <boost/thread/thread.hpp>
@@ -150,14 +151,14 @@ class MultiThreadTest { // NOLINT: members are not arranged for minimal padding
void Run() {
for (int i = 0; i < nthreads_; ++i) {
threads_.push_back(shared_ptr<thread>(
- new thread(boost::bind(&MultiThreadTest::InserterThread, this, i))));
+ new thread(std::bind(&MultiThreadTest::InserterThread, this, i))));
threads_.push_back(shared_ptr<thread>(
- new thread(boost::bind(&MultiThreadTest::RemoverThread, this))));
+ new thread(std::bind(&MultiThreadTest::RemoverThread, this))));
}
// We add an extra thread to ensure that there aren't enough elements in
// the queue to go around. This way, we test removal after Shutdown.
threads_.push_back(shared_ptr<thread>(
- new thread(boost::bind(
+ new thread(std::bind(
&MultiThreadTest::RemoverThread, this))));
for (int i = 0; i < threads_.size(); ++i) {
threads_[i]->join();
diff --git a/be/src/util/coding-util.cc b/be/src/util/coding-util.cc
index 3228dc33e..6d2bd7753 100644
--- a/be/src/util/coding-util.cc
+++ b/be/src/util/coding-util.cc
@@ -18,13 +18,13 @@
#include "util/coding-util.h"
#include <cctype>
+#include <functional>
#include <iomanip>
#include <limits>
#include <sstream>
#include <unordered_set>
#include <boost/algorithm/string.hpp>
-#include <boost/function.hpp>
#include <sasl/sasl.h>
#include "common/compiler-util.h"
@@ -40,7 +40,7 @@ namespace impala {
// It is more convenient to maintain the set of characters that are safe to use
// directly in URLs without escaping
-static function<bool (char)> IsUrlSafe = is_any_of(".-*_");
+static std::function<bool (char)> IsUrlSafe = is_any_of(".-*_");
// Hive selectively encodes characters. This is the whitelist of
// characters it will encode.
diff --git a/be/src/util/default-path-handlers.cc b/be/src/util/default-path-handlers.cc
index db28b6ba7..ef8e56193 100644
--- a/be/src/util/default-path-handlers.cc
+++ b/be/src/util/default-path-handlers.cc
@@ -20,7 +20,6 @@
#include <fstream>
#include <sstream>
#include <boost/algorithm/string.hpp>
-#include <boost/bind.hpp>
#include <gutil/strings/substitute.h>
#include <gnu/libc-version.h>
#include <sys/stat.h>
diff --git a/be/src/util/internal-queue.h b/be/src/util/internal-queue.h
index 9b858bd59..e1eae6d57 100644
--- a/be/src/util/internal-queue.h
+++ b/be/src/util/internal-queue.h
@@ -19,10 +19,9 @@
#ifndef IMPALA_UTIL_INTERNAL_QUEUE_H
#define IMPALA_UTIL_INTERNAL_QUEUE_H
+#include <functional>
#include <mutex>
-#include <boost/function.hpp>
-
#include "util/fake-lock.h"
#include "util/spinlock.h"
@@ -267,7 +266,7 @@ class InternalQueueBase {
// Iterate over elements of queue, calling 'fn' for each element. If 'fn' returns
// false, terminate iteration. It is invalid to call other InternalQueue methods
// from 'fn'.
- void Iterate(const boost::function<bool(T*)>& fn) {
+ void Iterate(const std::function<bool(T*)>& fn) {
std::lock_guard<LockType> lock(lock_);
for (Node* current = head_; current != nullptr; current = current->next) {
if (!fn(reinterpret_cast<T*>(current))) return;
@@ -278,7 +277,7 @@ class InternalQueueBase {
// larger than the size of the queue, iteration will finish after the last element
// reached. If 'fn' returns false, terminate iteration. It is invalid to call other
// InternalQueue methods from 'fn'.
- void IterateFirstN(const boost::function<bool(T*)>& fn, int n) {
+ void IterateFirstN(const std::function<bool(T*)>& fn, int n) {
std::lock_guard<LockType> lock(lock_);
for (Node* current = head_; (current != nullptr) && (n > 0);
current = current->next) {
diff --git a/be/src/util/metrics.cc b/be/src/util/metrics.cc
index 2623a3be2..e2ebfebf8 100644
--- a/be/src/util/metrics.cc
+++ b/be/src/util/metrics.cc
@@ -17,12 +17,11 @@
#include "util/metrics.h"
+#include <functional>
#include <sstream>
#include <stack>
#include <boost/algorithm/string/join.hpp>
-#include <boost/bind.hpp>
-#include <boost/mem_fn.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <gutil/strings/substitute.h>
#include <rapidjson/stringbuffer.h>
@@ -36,6 +35,11 @@
#include "common/names.h"
+using std::bind;
+using std::mem_fn;
+using std::placeholders::_1;
+using std::placeholders::_2;
+using std::placeholders::_3;
using namespace impala;
using namespace rapidjson;
using namespace strings;
diff --git a/be/src/util/metrics.h b/be/src/util/metrics.h
index 6e5bd8e88..82bbbd1ba 100644
--- a/be/src/util/metrics.h
+++ b/be/src/util/metrics.h
@@ -22,7 +22,6 @@
#include <mutex>
#include <string>
#include <vector>
-#include <boost/function.hpp>
#include <boost/scoped_ptr.hpp>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
#include <rapidjson/fwd.h>
diff --git a/be/src/util/pprof-path-handlers.cc b/be/src/util/pprof-path-handlers.cc
index bb3b5eb76..d10cd5b2c 100644
--- a/be/src/util/pprof-path-handlers.cc
+++ b/be/src/util/pprof-path-handlers.cc
@@ -17,8 +17,8 @@
#include "util/pprof-path-handlers.h"
-#include <boost/bind.hpp>
#include <fstream>
+#include <functional>
#include <sys/stat.h>
#include "common/logging.h"
@@ -27,6 +27,9 @@
#include "common/names.h"
+using std::bind;
+using std::placeholders::_1;
+using std::placeholders::_2;
using namespace google;
using namespace impala;
using namespace rapidjson;
diff --git a/be/src/util/runtime-profile-counters.h b/be/src/util/runtime-profile-counters.h
index ed6c2eb43..733ac61e6 100644
--- a/be/src/util/runtime-profile-counters.h
+++ b/be/src/util/runtime-profile-counters.h
@@ -21,6 +21,7 @@
#include <algorithm>
#include <boost/scoped_ptr.hpp>
#include <boost/unordered_map.hpp>
+#include <functional>
#include <sys/resource.h>
#include <sys/time.h>
@@ -259,7 +260,7 @@ class SamplingCounterPrototype : public ProfileEntryPrototype {
}
RuntimeProfileBase::Counter* Instantiate(
- RuntimeProfile* profile, boost::function<int64_t()> sample_fn) {
+ RuntimeProfile* profile, std::function<int64_t()> sample_fn) {
return profile->AddSamplingCounter(name(), std::move(sample_fn));
}
};
diff --git a/be/src/util/runtime-profile-periodic.cc b/be/src/util/runtime-profile-periodic.cc
index fb8dc6871..99a6537a4 100644
--- a/be/src/util/runtime-profile-periodic.cc
+++ b/be/src/util/runtime-profile-periodic.cc
@@ -17,7 +17,7 @@
#include "util/runtime-profile-counters.h"
-#include <boost/bind.hpp>
+#include <functional>
#include "common/object-pool.h"
#include "util/periodic-counter-updater.h"
@@ -156,7 +156,7 @@ RuntimeProfile::TimeSeriesCounter* RuntimeProfile::AddSamplingTimeSeriesCounter(
const string& name, Counter* src_counter, bool is_system) {
DCHECK(src_counter != NULL);
return AddSamplingTimeSeriesCounter(name, src_counter->unit(),
- bind(&Counter::value, src_counter), is_system);
+ std::bind(&Counter::value, src_counter), is_system);
}
RuntimeProfile::ChunkedTimeSeriesCounter::ChunkedTimeSeriesCounter(
diff --git a/be/src/util/runtime-profile-test.cc b/be/src/util/runtime-profile-test.cc
index f6901b181..d6184ddf1 100644
--- a/be/src/util/runtime-profile-test.cc
+++ b/be/src/util/runtime-profile-test.cc
@@ -17,11 +17,10 @@
#include <stdlib.h>
#include <algorithm>
+#include <functional>
#include <iostream>
#include <random>
-#include <boost/bind.hpp>
-
#include "common/object-pool.h"
#include "testutil/gtest-util.h"
#include "testutil/rand-util.h"
@@ -626,7 +625,7 @@ TEST(CountersTest, DerivedCounters) {
RuntimeProfile::DerivedCounter* throughput_counter =
profile->AddDerivedCounter("throughput", TUnit::BYTES,
- bind<int64_t>(&RuntimeProfile::UnitsPerSecond, bytes_counter, ticks_counter));
+ std::bind<int64_t>(&RuntimeProfile::UnitsPerSecond, bytes_counter, ticks_counter));
bytes_counter->Set(10);
EXPECT_EQ(throughput_counter->value(), 10);
diff --git a/be/src/util/runtime-profile.cc b/be/src/util/runtime-profile.cc
index 99fe863bc..7c81ad870 100644
--- a/be/src/util/runtime-profile.cc
+++ b/be/src/util/runtime-profile.cc
@@ -19,6 +19,7 @@
#include <algorithm>
#include <charconv>
+#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
@@ -29,7 +30,6 @@
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/join.hpp>
-#include <boost/bind.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <rapidjson/prettywriter.h>
#include <rapidjson/stringbuffer.h>
@@ -3123,4 +3123,4 @@ std::ostream& operator<<(std::ostream& os, const RuntimeProfileBase::Type type)
return os;
}
-}
\ No newline at end of file
+}
diff --git a/be/src/util/runtime-profile.h b/be/src/util/runtime-profile.h
index 7588bf2ca..6e38a7538 100644
--- a/be/src/util/runtime-profile.h
+++ b/be/src/util/runtime-profile.h
@@ -17,10 +17,10 @@
#pragma once
+#include <functional>
#include <iosfwd>
#include <mutex>
-#include <boost/function.hpp>
#include <rapidjson/document.h>
#include "common/atomic.h"
#include "common/status.h"
@@ -164,7 +164,7 @@ class RuntimeProfileBase {
class AveragedCounter;
class SummaryStatsCounter;
- typedef boost::function<int64_t()> SampleFunction;
+ typedef std::function<int64_t()> SampleFunction;
virtual ~RuntimeProfileBase();
diff --git a/be/src/util/thread-pool.h b/be/src/util/thread-pool.h
index 6653ecc2d..fa3412f96 100644
--- a/be/src/util/thread-pool.h
+++ b/be/src/util/thread-pool.h
@@ -17,10 +17,9 @@
#pragma once
+#include <functional>
#include <mutex>
-#include <boost/bind/mem_fn.hpp>
-
#include "util/aligned-new.h"
#include "util/blocking-queue.h"
#include "util/condition-variable.h"
@@ -36,7 +35,7 @@ class ThreadPool : public CacheLineAligned {
/// Signature of a work-processing function. Takes the integer id of the thread which is
/// calling it (ids run from 0 to num_threads - 1) and a reference to the item to
/// process.
- typedef boost::function<void (int thread_id, const T& workitem)> WorkFunction;
+ typedef std::function<void (int thread_id, const T& workitem)> WorkFunction;
/// Creates a new thread pool without starting any threads. Code must call
/// Init() on this thread pool before any calls to Offer().
@@ -71,7 +70,7 @@ class ThreadPool : public CacheLineAligned {
threadname << thread_prefix_ << "(" << i + 1 << ":" << num_threads_ << ")";
std::unique_ptr<Thread> t;
Status status = Thread::Create(group_, threadname.str(),
- boost::bind<void>(boost::mem_fn(&ThreadPool<T>::WorkerThread), this, i), &t,
+ std::bind<void>(std::mem_fn(&ThreadPool<T>::WorkerThread), this, i), &t,
fault_injection_eligible_);
if (!status.ok()) {
// The thread pool initialization failed. Shutdown any threads that were
@@ -218,16 +217,16 @@ class ThreadPool : public CacheLineAligned {
};
/// Utility thread-pool that accepts callable work items, and simply invokes them.
-class CallableThreadPool : public ThreadPool<boost::function<void()>> {
+class CallableThreadPool : public ThreadPool<std::function<void()>> {
public:
CallableThreadPool(const std::string& group, const std::string& thread_prefix,
uint32_t num_threads, uint32_t queue_size) :
- ThreadPool<boost::function<void()>>(
+ ThreadPool<std::function<void()>>(
group, thread_prefix, num_threads, queue_size, &CallableThreadPool::Worker) {
}
private:
- static void Worker(int thread_id, const boost::function<void()>& f) {
+ static void Worker(int thread_id, const std::function<void()>& f) {
f();
}
};
diff --git a/be/src/util/thread.h b/be/src/util/thread.h
index 5144fb4b5..87959b05d 100644
--- a/be/src/util/thread.h
+++ b/be/src/util/thread.h
@@ -18,11 +18,10 @@
#ifndef IMPALA_UTIL_THREAD_H
#define IMPALA_UTIL_THREAD_H
+#include <functional>
#include <memory>
#include <vector>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/thread/thread_only.hpp>
@@ -78,7 +77,7 @@ class Thread {
static Status Create(const std::string& category, const std::string& name,
const F& f, const A1& a1, std::unique_ptr<Thread>* thread,
bool fault_injection_eligible = false) {
- return StartThread(category, name, boost::bind(f, a1), thread,
+ return StartThread(category, name, std::bind(f, a1), thread,
fault_injection_eligible);
}
@@ -86,7 +85,7 @@ class Thread {
static Status Create(const std::string& category, const std::string& name,
const F& f, const A1& a1, const A2& a2, std::unique_ptr<Thread>* thread,
bool fault_injection_eligible = false) {
- return StartThread(category, name, boost::bind(f, a1, a2), thread,
+ return StartThread(category, name, std::bind(f, a1, a2), thread,
fault_injection_eligible);
}
@@ -94,7 +93,7 @@ class Thread {
static Status Create(const std::string& category, const std::string& name,
const F& f, const A1& a1, const A2& a2, const A3& a3,
std::unique_ptr<Thread>* thread, bool fault_injection_eligible = false) {
- return StartThread(category, name, boost::bind(f, a1, a2, a3), thread,
+ return StartThread(category, name, std::bind(f, a1, a2, a3), thread,
fault_injection_eligible);
}
@@ -102,7 +101,7 @@ class Thread {
static Status Create(const std::string& category, const std::string& name,
const F& f, const A1& a1, const A2& a2, const A3& a3, const A4& a4,
std::unique_ptr<Thread>* thread, bool fault_injection_eligible = false) {
- return StartThread(category, name, boost::bind(f, a1, a2, a3, a4), thread,
+ return StartThread(category, name, std::bind(f, a1, a2, a3, a4), thread,
fault_injection_eligible);
}
@@ -110,7 +109,7 @@ class Thread {
static Status Create(const std::string& category, const std::string& name,
const F& f, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5,
std::unique_ptr<Thread>* thread, bool fault_injection_eligible = false) {
- return StartThread(category, name, boost::bind(f, a1, a2, a3, a4, a5), thread,
+ return StartThread(category, name, std::bind(f, a1, a2, a3, a4, a5), thread,
fault_injection_eligible);
}
@@ -141,7 +140,7 @@ class Thread {
static const int64_t UNINITIALISED_THREAD_ID = -2;
/// Function object that wraps the user-supplied function to run in a separate thread.
- typedef boost::function<void ()> ThreadFunctor;
+ typedef std::function<void ()> ThreadFunctor;
/// The actual thread object that runs the user's method via SuperviseThread().
boost::scoped_ptr<boost::thread> thread_;
diff --git a/be/src/util/webserver-test.cc b/be/src/util/webserver-test.cc
index 3ba1f7b40..d4a53fada 100644
--- a/be/src/util/webserver-test.cc
+++ b/be/src/util/webserver-test.cc
@@ -16,9 +16,10 @@
// under the License.
#include <array>
+#include <fstream>
+#include <functional>
#include <memory>
#include <string>
-#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <gutil/strings/substitute.h>
#include <openssl/ssl.h>
@@ -54,6 +55,9 @@ DECLARE_bool(cookie_require_secure);
#include "common/names.h"
using boost::asio::ip::tcp;
+using std::bind;
+using std::placeholders::_1;
+using std::placeholders::_2;
namespace filesystem = boost::filesystem;
using namespace impala;
using namespace rapidjson;
diff --git a/be/src/util/webserver.cc b/be/src/util/webserver.cc
index 3415cf100..84848bd14 100644
--- a/be/src/util/webserver.cc
+++ b/be/src/util/webserver.cc
@@ -21,10 +21,8 @@
#include <fstream>
#include <string>
#include <boost/algorithm/string.hpp>
-#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
-#include <boost/mem_fn.hpp>
#include <boost/thread/shared_mutex.hpp>
#include <gssapi/gssapi_krb5.h>
#include <shared_mutex>
@@ -80,6 +78,9 @@ using boost::algorithm::to_lower;
using boost::filesystem::exists;
using boost::upgrade_to_unique_lock;
using kudu::HttpStatusCode;
+using std::bind;
+using std::placeholders::_1;
+using std::placeholders::_2;
using namespace google;
using namespace strings;
using namespace rapidjson;
diff --git a/be/src/util/webserver.h b/be/src/util/webserver.h
index b7a528e22..2e052d6ac 100644
--- a/be/src/util/webserver.h
+++ b/be/src/util/webserver.h
@@ -17,9 +17,9 @@
#pragma once
+#include <functional>
#include <map>
#include <string>
-#include <boost/function.hpp>
#include <boost/thread/pthread/shared_mutex.hpp>
#include <shared_mutex>
#include <rapidjson/fwd.h>
@@ -70,9 +70,9 @@ class Webserver {
using WebRequest = kudu::WebCallbackRegistry::WebRequest;
using HttpStatusCode = kudu::HttpStatusCode;
- typedef boost::function<void (const WebRequest& req, rapidjson::Document* json)>
+ typedef std::function<void (const WebRequest& req, rapidjson::Document* json)>
UrlCallback;
- typedef boost::function<void (const WebRequest& req, std::stringstream* output,
+ typedef std::function<void (const WebRequest& req, std::stringstream* output,
HttpStatusCode* response)> RawUrlCallback;
/// Any callback may add a member to their Json output with key ENABLE_RAW_HTML_KEY;