diff --git a/src/yb/yql/cql/cqlserver/cql_processor.cc b/src/yb/yql/cql/cqlserver/cql_processor.cc index 6250e0171c50..6637b5112889 100644 --- a/src/yb/yql/cql/cqlserver/cql_processor.cc +++ b/src/yb/yql/cql/cqlserver/cql_processor.cc @@ -122,8 +122,7 @@ CQLProcessor::CQLProcessor(CQLServiceImpl* service_impl, const CQLProcessorListP service_impl->messenger(), service_impl->client(), service_impl->metadata_cache(), service_impl->cql_metrics().get(), service_impl->clock(), - std::bind(&CQLServiceImpl::GetTransactionManager, service_impl), - service_impl->cql_rpc_env()), + std::bind(&CQLServiceImpl::GetTransactionManager, service_impl)), service_impl_(service_impl), cql_metrics_(service_impl->cql_metrics()), pos_(pos), diff --git a/src/yb/yql/cql/cqlserver/cql_rpcserver_env.h b/src/yb/yql/cql/cqlserver/cql_rpcserver_env.h deleted file mode 100644 index ae10cb9dad04..000000000000 --- a/src/yb/yql/cql/cqlserver/cql_rpcserver_env.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) YugaByte, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations -// under the License. -// - -#ifndef YB_YQL_CQL_CQLSERVER_CQL_RPCSERVER_ENV_H -#define YB_YQL_CQL_CQLSERVER_CQL_RPCSERVER_ENV_H - -namespace yb { -namespace cqlserver { - -class CQLRpcServerEnv { - public: - CQLRpcServerEnv(const std::string& rpc_address, const std::string& broadcast_rpc_address) - : rpc_address_(rpc_address), - broadcast_rpc_address_(broadcast_rpc_address.empty() ? rpc_address : - broadcast_rpc_address) { - } - - const std::string& rpc_address() const { return rpc_address_; } - - const std::string& broadcast_address() const { return broadcast_rpc_address_; } - - private: - // Cassandra equivalent of rpc_address, which is the address the node binds to. - const std::string rpc_address_; - // Cassandra equivalent for broadcast_rpc_address, which is the address the node tells other - // nodes in the cluster. - const std::string broadcast_rpc_address_; -}; - -} // namespace cqlserver -} // namespace yb - -#endif // YB_YQL_CQL_CQLSERVER_CQL_RPCSERVER_ENV_H diff --git a/src/yb/yql/cql/cqlserver/cql_service.cc b/src/yb/yql/cql/cqlserver/cql_service.cc index 613c39529ef6..713647649413 100644 --- a/src/yb/yql/cql/cqlserver/cql_service.cc +++ b/src/yb/yql/cql/cqlserver/cql_service.cc @@ -65,8 +65,6 @@ CQLServiceImpl::CQLServiceImpl(CQLServer* server, const CQLServerOptions& opts, server->tserver() ? server->tserver()->messenger() : nullptr), next_available_processor_(processors_.end()), messenger_(server->messenger()), - cql_rpcserver_env_(new CQLRpcServerEnv(server->first_rpc_address().address().to_string(), - opts.broadcast_rpc_address)), local_tablet_filter_(std::move(local_tablet_filter)) { // TODO(ENG-446): Handle metrics for all the methods individually. cql_metrics_ = std::make_shared(server->metric_entity()); diff --git a/src/yb/yql/cql/cqlserver/cql_service.h b/src/yb/yql/cql/cqlserver/cql_service.h index b1ad13485337..9b2363b27cc7 100644 --- a/src/yb/yql/cql/cqlserver/cql_service.h +++ b/src/yb/yql/cql/cqlserver/cql_service.h @@ -21,7 +21,6 @@ #include "yb/yql/cql/cqlserver/cql_message.h" #include "yb/yql/cql/cqlserver/cql_processor.h" -#include "yb/yql/cql/cqlserver/cql_rpcserver_env.h" #include "yb/yql/cql/cqlserver/cql_statement.h" #include "yb/yql/cql/cqlserver/cql_service.service.h" #include "yb/yql/cql/cqlserver/cql_server_options.h" @@ -95,9 +94,6 @@ class CQLServiceImpl : public CQLServerServiceIf, // Return the messenger. std::weak_ptr messenger() { return messenger_; } - // Return the CQL RPC environment. - CQLRpcServerEnv* cql_rpc_env() { return cql_rpcserver_env_.get(); } - client::TransactionManager* GetTransactionManager(); server::Clock* clock(); @@ -165,9 +161,6 @@ class CQLServiceImpl : public CQLServerServiceIf, // Used to requeue the cql_inbound call to handle the response callback(s). std::weak_ptr messenger_; - // RPC environment for CQL proxy. - std::unique_ptr cql_rpcserver_env_; - client::LocalTabletFilter local_tablet_filter_; std::atomic transaction_manager_{nullptr}; diff --git a/src/yb/yql/cql/ql/ql_processor.cc b/src/yb/yql/cql/ql/ql_processor.cc index 197669105e5a..63e7753e59f3 100644 --- a/src/yb/yql/cql/ql/ql_processor.cc +++ b/src/yb/yql/cql/ql/ql_processor.cc @@ -129,10 +129,8 @@ QLMetrics::QLMetrics(const scoped_refptr &metric_entity) { QLProcessor::QLProcessor(std::weak_ptr messenger, shared_ptr client, shared_ptr cache, QLMetrics* ql_metrics, const server::ClockPtr& clock, - TransactionManagerProvider transaction_manager_provider, - cqlserver::CQLRpcServerEnv* cql_rpcserver_env) - : ql_env_(messenger, client, cache, clock, std::move(transaction_manager_provider), - cql_rpcserver_env), + TransactionManagerProvider transaction_manager_provider) + : ql_env_(messenger, client, cache, clock, std::move(transaction_manager_provider)), analyzer_(&ql_env_), executor_(&ql_env_, ql_metrics), ql_metrics_(ql_metrics) { diff --git a/src/yb/yql/cql/ql/ql_processor.h b/src/yb/yql/cql/ql/ql_processor.h index 0f1ca35aac3c..5d80459b3aaf 100644 --- a/src/yb/yql/cql/ql/ql_processor.h +++ b/src/yb/yql/cql/ql/ql_processor.h @@ -21,8 +21,6 @@ #include "yb/client/callbacks.h" -#include "yb/yql/cql/cqlserver/cql_rpcserver_env.h" - #include "yb/yql/cql/ql/exec/executor.h" #include "yb/yql/cql/ql/parser/parser.h" #include "yb/yql/cql/ql/sem/analyzer.h" @@ -66,8 +64,7 @@ class QLProcessor { std::shared_ptr cache, QLMetrics* ql_metrics, const server::ClockPtr& clock, - TransactionManagerProvider transaction_manager_provider, - cqlserver::CQLRpcServerEnv* cql_rpcserver_env = nullptr); + TransactionManagerProvider transaction_manager_provider); virtual ~QLProcessor(); // Prepare a SQL statement (parse and analyze). A reference to the statement string is saved in diff --git a/src/yb/yql/cql/ql/util/ql_env.cc b/src/yb/yql/cql/ql/util/ql_env.cc index 9e977aef4f44..f4c5ba216616 100644 --- a/src/yb/yql/cql/ql/util/ql_env.cc +++ b/src/yb/yql/cql/ql/util/ql_env.cc @@ -62,15 +62,13 @@ using client::YBqlWriteOp; QLEnv::QLEnv(weak_ptr messenger, shared_ptr client, shared_ptr cache, const server::ClockPtr& clock, - TransactionManagerProvider transaction_manager_provider, - cqlserver::CQLRpcServerEnv* cql_rpcserver_env) + TransactionManagerProvider transaction_manager_provider) : client_(std::move(client)), metadata_cache_(std::move(cache)), session_(std::make_shared(client_, clock)), transaction_manager_provider_(std::move(transaction_manager_provider)), messenger_(messenger), - resume_execution_(Bind(&QLEnv::ResumeCQLCall, Unretained(this))), - cql_rpcserver_env_(cql_rpcserver_env) { + resume_execution_(Bind(&QLEnv::ResumeCQLCall, Unretained(this))) { CHECK(clock); } diff --git a/src/yb/yql/cql/ql/util/ql_env.h b/src/yb/yql/cql/ql/util/ql_env.h index 365e6af56532..4b450471923e 100644 --- a/src/yb/yql/cql/ql/util/ql_env.h +++ b/src/yb/yql/cql/ql/util/ql_env.h @@ -30,7 +30,6 @@ #include "yb/rpc/rpc_fwd.h" #include "yb/yql/cql/cqlserver/cql_rpc.h" -#include "yb/yql/cql/cqlserver/cql_rpcserver_env.h" #include "yb/yql/cql/ql/ql_session.h" #include "yb/util/enums.h" @@ -56,8 +55,7 @@ class QLEnv { QLEnv(std::weak_ptr messenger, std::shared_ptr client, std::shared_ptr cache, const server::ClockPtr& clock, - TransactionManagerProvider transaction_manager_provider, - cqlserver::CQLRpcServerEnv* cql_rpcserver_env = nullptr); + TransactionManagerProvider transaction_manager_provider); virtual ~QLEnv(); virtual client::YBTableCreator *NewTableCreator(); @@ -198,8 +196,6 @@ class QLEnv { // Reschedule the current call to be resumed at the given callback. void RescheduleCurrentCall(Callback* callback); - cqlserver::CQLRpcServerEnv* cql_rpcserver_env() { return cql_rpcserver_env_; } - private: // Helpers to process the asynchronously received response from ybclient. void FlushAsyncDone(const Status &s); @@ -248,8 +244,6 @@ class QLEnv { // The current keyspace. Used only in test environment when there is no current call. std::unique_ptr current_keyspace_; - - cqlserver::CQLRpcServerEnv* cql_rpcserver_env_; }; } // namespace ql