commit 5c944b1dee1906b05b65b6fa6a28acaf95915536 Author: Enis Soztutar Date: Wed Jul 19 16:43:21 2017 -0700 HBASE-18371 [C++] Update folly and wangle dependencies - v3 diff --git hbase-native-client/core/async-batch-rpc-retrying-caller.h hbase-native-client/core/async-batch-rpc-retrying-caller.h index 4c04b91..194c439 100644 --- hbase-native-client/core/async-batch-rpc-retrying-caller.h +++ hbase-native-client/core/async-batch-rpc-retrying-caller.h @@ -21,9 +21,9 @@ #include #include +#include #include #include -#include #include #include #include diff --git hbase-native-client/core/async-rpc-retrying-caller.cc hbase-native-client/core/async-rpc-retrying-caller.cc index aee7d0b..cb058b1 100644 --- hbase-native-client/core/async-rpc-retrying-caller.cc +++ hbase-native-client/core/async-rpc-retrying-caller.cc @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "connection/rpc-client.h" #include "core/async-connection.h" @@ -94,9 +94,10 @@ void AsyncSingleRequestRpcRetryingCaller::LocateThenCall() { .then([this](std::shared_ptr loc) { Call(*loc); }) .onError([this](const exception_wrapper& e) { OnError(e, - [this]() -> std::string { + [this, e]() -> std::string { return "Locate '" + row_ + "' in " + table_name_->namespace_() + "::" + - table_name_->qualifier() + " failed, tries = " + std::to_string(tries_) + + table_name_->qualifier() + " failed with e.what()=" + + e.what().toStdString() + ", tries = " + std::to_string(tries_) + ", maxAttempts = " + std::to_string(max_attempts_) + ", timeout = " + TimeUtil::ToMillisStr(operation_timeout_nanos_) + " ms, time elapsed = " + TimeUtil::ElapsedMillisStr(this->start_ns_) + " ms"; @@ -116,6 +117,12 @@ void AsyncSingleRequestRpcRetryingCaller::OnError( return; } + if (tries_ > start_log_errors_count_) { + LOG(WARNING) << err_msg(); + } else { + VLOG(1) << err_msg(); + } + int64_t delay_ns; if (operation_timeout_nanos_.count() > 0) { int64_t max_delay_ns = RemainingTimeNs() - ConnectionUtils::kSleepDeltaNs; @@ -174,21 +181,21 @@ void AsyncSingleRequestRpcRetryingCaller::Call(const RegionLocation& loc) callable_(controller_, loc_ptr, rpc_client) .then([loc_ptr, this](const RESP& resp) { this->promise_->setValue(std::move(resp)); }) .onError([&, loc_ptr, this](const exception_wrapper& e) { - OnError(e, - [&, this]() -> std::string { - return "Call to " + folly::sformat("{0}:{1}", loc_ptr->server_name().host_name(), - loc_ptr->server_name().port()) + - " for '" + row_ + "' in " + loc_ptr->DebugString() + " of " + - table_name_->namespace_() + "::" + table_name_->qualifier() + - " failed, tries = " + std::to_string(tries_) + ", maxAttempts = " + - std::to_string(max_attempts_) + ", timeout = " + - TimeUtil::ToMillisStr(this->operation_timeout_nanos_) + - " ms, time elapsed = " + TimeUtil::ElapsedMillisStr(this->start_ns_) + - " ms"; - }, - [&, this](const exception_wrapper& error) { - conn_->region_locator()->UpdateCachedLocation(*loc_ptr, error); - }); + OnError( + e, + [&, this, e]() -> std::string { + return "Call to " + folly::sformat("{0}:{1}", loc_ptr->server_name().host_name(), + loc_ptr->server_name().port()) + + " for '" + row_ + "' in " + loc_ptr->DebugString() + " of " + + table_name_->namespace_() + "::" + table_name_->qualifier() + + " failed with e.what()=" + e.what().toStdString() + ", tries = " + + std::to_string(tries_) + ", maxAttempts = " + std::to_string(max_attempts_) + + ", timeout = " + TimeUtil::ToMillisStr(this->operation_timeout_nanos_) + + " ms, time elapsed = " + TimeUtil::ElapsedMillisStr(this->start_ns_) + " ms"; + }, + [&, this](const exception_wrapper& error) { + conn_->region_locator()->UpdateCachedLocation(*loc_ptr, error); + }); }); } diff --git hbase-native-client/core/raw-async-table.h hbase-native-client/core/raw-async-table.h index ca12be6..e651f8a 100644 --- hbase-native-client/core/raw-async-table.h +++ hbase-native-client/core/raw-async-table.h @@ -18,8 +18,8 @@ */ #pragma once +#include #include -#include #include #include #include diff --git hbase-native-client/core/table.cc hbase-native-client/core/table.cc index b89c1a2..3b7a87b 100644 --- hbase-native-client/core/table.cc +++ hbase-native-client/core/table.cc @@ -120,9 +120,9 @@ std::vector> Table::Get(const std::vectorwhat() << " for " + LOG(ERROR) << "Caught exception:- " << tresult.exception().what() << " for " << gets[num++].row(); - throw tresult.exception().getCopied(); + throw tresult.exception(); } } return results; diff --git hbase-native-client/docker-files/Dockerfile hbase-native-client/docker-files/Dockerfile index d5a1eab..efd9a9d 100644 --- hbase-native-client/docker-files/Dockerfile +++ hbase-native-client/docker-files/Dockerfile @@ -84,6 +84,39 @@ RUN git clone https://github.com/google/protobuf.git /usr/src/protobuf && \ make clean && \ ldconfig +# Update folly +RUN cd /usr/src/ && \ + ver=2017.06.19.00 && \ + wget https://github.com/facebook/folly/archive/v$ver.tar.gz && \ + tar zxf v$ver.tar.gz && \ + rm -rf v$ver.tar.gz && \ + cd folly-$ver/folly/test && \ + rm -rf gtest && \ + wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz && \ + tar zxf release-1.8.0.tar.gz && \ + rm -f release-1.8.0.tar.gz && \ + mv googletest-release-1.8.0 gtest && \ + cd ../ && \ + ldconfig && \ + autoreconf -ivf && \ + ./configure && \ + make && \ + make check && \ + make install + +# Update wangle +RUN cd /usr/src/ && \ + ver=2017.06.26.00 && \ + wget https://github.com/facebook/wangle/archive/v$ver.tar.gz && \ + tar zxf v$ver.tar.gz && \ + rm -rf v$ver.tar.gz && \ + cd wangle-$ver/wangle && \ + ldconfig && \ + cmake . -DBUILD_TESTS=OFF && \ + make && \ + ctest && \ + make install + ENTRYPOINT /usr/sbin/krb5kdc -P /var/run/krb5kdc.pid && /bin/bash WORKDIR /usr/src/hbase/hbase-native-client