hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "guanyun (Jira)" <j...@apache.org>
Subject [jira] [Created] (HBASE-23506) CLONE - [C++] make RPC test mode transparent to initialization of RpcPipeline
Date Sun, 08 Dec 2019 13:35:03 GMT
guanyun created HBASE-23506:

             Summary: CLONE - [C++] make RPC test mode transparent to initialization of RpcPipeline
                 Key: HBASE-23506
                 URL: https://issues.apache.org/jira/browse/HBASE-23506
             Project: HBase
          Issue Type: Sub-task
            Reporter: guanyun

This is a follow up work of HBASE-18338.
In RpcPipelineFactory::newPipeline, the HBASE_CLIENT_RPC_TEST_MODE is used to exclude SaslHandler
which otherwise will cause RpcTestServer not receiving any requests.

+  if (!conf_->GetBool(
+      Configuration::HBASE_CLIENT_RPC_TEST_MODE,
+      Configuration::DEFAULT_HBASE_CLIENT_RPC_TEST_MODE)) {
+    secure = security::User::IsSecurityEnabled(*conf_);
+    pipeline->addBack(SaslHandler{user_util_.user_name(secure), conf_});
+  }

This is not clean. Handlers should be added to pipeline regardless of test or not, instead,
every handler can choose to discriminate test or not. Taking ClientHandler as an example:
folly::Future<folly::Unit> ClientHandler::write(Context *ctx, std::unique_ptr<Request>
r) {
  /* for RPC test, there's no need to send connection header */
  if (!conf_->GetBool(RpcSerde::HBASE_CLIENT_RPC_TEST_MODE,
                      RpcSerde::DEFAULT_HBASE_CLIENT_RPC_TEST_MODE)) {
    // We need to send the header once.
    // So use call_once to make sure that only one thread wins this.
    std::call_once((*once_flag_), [ctx, this]() {
      VLOG(3) << "Writing RPC Header to server: " << server_;
      auto header = serde_.Header(user_name_);

This message was sent by Atlassian Jira

View raw message