Skip to content

Commit

Permalink
#410: Remove unused CQLRpcServerEnv
Browse files Browse the repository at this point in the history
Summary: The class CQLRpcServerEnv was used to implement system.local virtual table locally in YCQL proxy in yb-tserver. The system table has since then been moved to yb-master so the class should be removed.

Test Plan: Jenkins

Reviewers: mihnea

Reviewed By: mihnea

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D5238
  • Loading branch information
robertpang committed Aug 1, 2018
1 parent 7b925bd commit 9bc7dc1
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 73 deletions.
3 changes: 1 addition & 2 deletions src/yb/yql/cql/cqlserver/cql_processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
43 changes: 0 additions & 43 deletions src/yb/yql/cql/cqlserver/cql_rpcserver_env.h

This file was deleted.

2 changes: 0 additions & 2 deletions src/yb/yql/cql/cqlserver/cql_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<CQLMetrics>(server->metric_entity());
Expand Down
7 changes: 0 additions & 7 deletions src/yb/yql/cql/cqlserver/cql_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -95,9 +94,6 @@ class CQLServiceImpl : public CQLServerServiceIf,
// Return the messenger.
std::weak_ptr<rpc::Messenger> messenger() { return messenger_; }

// Return the CQL RPC environment.
CQLRpcServerEnv* cql_rpc_env() { return cql_rpcserver_env_.get(); }

client::TransactionManager* GetTransactionManager();

server::Clock* clock();
Expand Down Expand Up @@ -165,9 +161,6 @@ class CQLServiceImpl : public CQLServerServiceIf,
// Used to requeue the cql_inbound call to handle the response callback(s).
std::weak_ptr<rpc::Messenger> messenger_;

// RPC environment for CQL proxy.
std::unique_ptr<CQLRpcServerEnv> cql_rpcserver_env_;

client::LocalTabletFilter local_tablet_filter_;

std::atomic<client::TransactionManager*> transaction_manager_{nullptr};
Expand Down
6 changes: 2 additions & 4 deletions src/yb/yql/cql/ql/ql_processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ QLMetrics::QLMetrics(const scoped_refptr<yb::MetricEntity> &metric_entity) {
QLProcessor::QLProcessor(std::weak_ptr<rpc::Messenger> messenger, shared_ptr<YBClient> client,
shared_ptr<YBMetaDataCache> 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) {
Expand Down
5 changes: 1 addition & 4 deletions src/yb/yql/cql/ql/ql_processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -66,8 +64,7 @@ class QLProcessor {
std::shared_ptr<client::YBMetaDataCache> 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
Expand Down
6 changes: 2 additions & 4 deletions src/yb/yql/cql/ql/util/ql_env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,13 @@ using client::YBqlWriteOp;
QLEnv::QLEnv(weak_ptr<rpc::Messenger> messenger, shared_ptr<YBClient> client,
shared_ptr<YBMetaDataCache> 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<YBSession>(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);
}

Expand Down
8 changes: 1 addition & 7 deletions src/yb/yql/cql/ql/util/ql_env.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -56,8 +55,7 @@ class QLEnv {
QLEnv(std::weak_ptr<rpc::Messenger> messenger, std::shared_ptr<client::YBClient> client,
std::shared_ptr<client::YBMetaDataCache> 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();
Expand Down Expand Up @@ -198,8 +196,6 @@ class QLEnv {
// Reschedule the current call to be resumed at the given callback.
void RescheduleCurrentCall(Callback<void(void)>* 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);
Expand Down Expand Up @@ -248,8 +244,6 @@ class QLEnv {

// The current keyspace. Used only in test environment when there is no current call.
std::unique_ptr<std::string> current_keyspace_;

cqlserver::CQLRpcServerEnv* cql_rpcserver_env_;
};

} // namespace ql
Expand Down

0 comments on commit 9bc7dc1

Please sign in to comment.