You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by en...@apache.org on 2017/07/26 19:18:22 UTC
hbase git commit: HBASE-18371 [C++] Update folly and wangle
dependencies
Repository: hbase
Updated Branches:
refs/heads/HBASE-14850 55ca4fe2c -> 72f3582e5
HBASE-18371 [C++] Update folly and wangle dependencies
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/72f3582e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/72f3582e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/72f3582e
Branch: refs/heads/HBASE-14850
Commit: 72f3582e5a03ef686e9fb61ac4e1cea914c72b8c
Parents: 55ca4fe
Author: Enis Soztutar <en...@apache.org>
Authored: Wed Jul 26 12:18:05 2017 -0700
Committer: Enis Soztutar <en...@apache.org>
Committed: Wed Jul 26 12:18:05 2017 -0700
----------------------------------------------------------------------
.../core/async-batch-rpc-retrying-caller.h | 2 +-
.../core/async-rpc-retrying-caller.cc | 43 ++++++++++++--------
hbase-native-client/core/raw-async-table.h | 2 +-
hbase-native-client/core/table.cc | 4 +-
hbase-native-client/docker-files/Dockerfile | 33 +++++++++++++++
5 files changed, 62 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/72f3582e/hbase-native-client/core/async-batch-rpc-retrying-caller.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/async-batch-rpc-retrying-caller.h b/hbase-native-client/core/async-batch-rpc-retrying-caller.h
index 4c04b91..194c439 100644
--- a/hbase-native-client/core/async-batch-rpc-retrying-caller.h
+++ b/hbase-native-client/core/async-batch-rpc-retrying-caller.h
@@ -21,9 +21,9 @@
#include <folly/ExceptionWrapper.h>
#include <folly/Format.h>
+#include <folly/Try.h>
#include <folly/futures/Future.h>
#include <folly/futures/Promise.h>
-#include <folly/futures/Try.h>
#include <folly/io/IOBuf.h>
#include <folly/io/async/HHWheelTimer.h>
#include <wangle/concurrent/CPUThreadPoolExecutor.h>
http://git-wip-us.apache.org/repos/asf/hbase/blob/72f3582e/hbase-native-client/core/async-rpc-retrying-caller.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/async-rpc-retrying-caller.cc b/hbase-native-client/core/async-rpc-retrying-caller.cc
index aee7d0b..cb058b1 100644
--- a/hbase-native-client/core/async-rpc-retrying-caller.cc
+++ b/hbase-native-client/core/async-rpc-retrying-caller.cc
@@ -23,7 +23,7 @@
#include <folly/ExceptionWrapper.h>
#include <folly/Format.h>
#include <folly/Logging.h>
-#include <folly/futures/Unit.h>
+#include <folly/Unit.h>
#include "connection/rpc-client.h"
#include "core/async-connection.h"
@@ -94,9 +94,10 @@ void AsyncSingleRequestRpcRetryingCaller<RESP>::LocateThenCall() {
.then([this](std::shared_ptr<RegionLocation> 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<RESP>::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<RESP>::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);
+ });
});
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/72f3582e/hbase-native-client/core/raw-async-table.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/raw-async-table.h b/hbase-native-client/core/raw-async-table.h
index ca12be6..e651f8a 100644
--- a/hbase-native-client/core/raw-async-table.h
+++ b/hbase-native-client/core/raw-async-table.h
@@ -18,8 +18,8 @@
*/
#pragma once
+#include <folly/Unit.h>
#include <folly/futures/Future.h>
-#include <folly/futures/Unit.h>
#include <chrono>
#include <memory>
#include <string>
http://git-wip-us.apache.org/repos/asf/hbase/blob/72f3582e/hbase-native-client/core/table.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/core/table.cc b/hbase-native-client/core/table.cc
index b89c1a2..3b7a87b 100644
--- a/hbase-native-client/core/table.cc
+++ b/hbase-native-client/core/table.cc
@@ -120,9 +120,9 @@ std::vector<std::shared_ptr<hbase::Result>> Table::Get(const std::vector<hbase::
if (tresult.hasValue()) {
results.push_back(tresult.value());
} else if (tresult.hasException()) {
- LOG(ERROR) << "Caught exception:- " << tresult.exception().getCopied()->what() << " for "
+ LOG(ERROR) << "Caught exception:- " << tresult.exception().what() << " for "
<< gets[num++].row();
- throw tresult.exception().getCopied();
+ throw tresult.exception();
}
}
return results;
http://git-wip-us.apache.org/repos/asf/hbase/blob/72f3582e/hbase-native-client/docker-files/Dockerfile
----------------------------------------------------------------------
diff --git a/hbase-native-client/docker-files/Dockerfile b/hbase-native-client/docker-files/Dockerfile
index d5a1eab..efd9a9d 100644
--- a/hbase-native-client/docker-files/Dockerfile
+++ b/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