Repository: incubator-impala
Updated Branches:
  refs/heads/master 7a1ff1e5e -> ab287955d


IMPALA-5670: Misc. tidying of ExecEnv

* Remove duplicated c'tor code for ExecEnv() and delegate it onto
  6-argument c'tor.
* Make some RM-related flags hidden
* Remove unused and untested 'use_statestore' branch in ExecEnv which
  created a scheduler with static hosts rather than those sent by the
  statestore.
* Remove corresponding scheduler c'tor to handle the above path.
* Remove unused 'use_statestore' parameter from
  InProcessImpalaServer::StartAsBackendOnly() and
  InProcessImpalaServer::StartWithClientServers().

Change-Id: I3886bc0edfae0c65c302e1a1812632e60668cd4c
Reviewed-on: http://gerrit.cloudera.org:8080/7445
Tested-by: Impala Public Jenkins
Reviewed-by: Henry Robinson <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/ab287955
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/ab287955
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/ab287955

Branch: refs/heads/master
Commit: ab287955d00939531b5bc6b9871fcb24def9d38e
Parents: 7a1ff1e
Author: Henry Robinson <[email protected]>
Authored: Mon Jul 17 11:23:31 2017 -0700
Committer: Henry Robinson <[email protected]>
Committed: Wed Jul 19 23:39:24 2017 +0000

----------------------------------------------------------------------
 be/src/exprs/expr-test.cc              |   4 +-
 be/src/runtime/exec-env.cc             | 152 +++++++---------------------
 be/src/runtime/exec-env.h              |  28 ++---
 be/src/scheduling/scheduler.cc         |  15 ---
 be/src/scheduling/scheduler.h          |   5 -
 be/src/service/impalad-main.cc         |   3 -
 be/src/service/session-expiry-test.cc  |   4 +-
 be/src/testutil/in-process-servers.cc  |   8 +-
 be/src/testutil/in-process-servers.h   |   9 +-
 be/src/testutil/mini-impala-cluster.cc |   8 +-
 docs/topics/impala_config_options.xml  |   9 +-
 docs/topics/impala_upgrading.xml       |   4 +-
 12 files changed, 71 insertions(+), 178 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ab287955/be/src/exprs/expr-test.cc
----------------------------------------------------------------------
diff --git a/be/src/exprs/expr-test.cc b/be/src/exprs/expr-test.cc
index 45815dd..3b33c47 100644
--- a/be/src/exprs/expr-test.cc
+++ b/be/src/exprs/expr-test.cc
@@ -7323,7 +7323,9 @@ int main(int argc, char **argv) {
   FLAGS_abort_on_config_error = false;
   VLOG_CONNECTION << "creating test env";
   VLOG_CONNECTION << "starting backends";
-  InProcessImpalaServer* impala_server = 
InProcessImpalaServer::StartWithEphemeralPorts();
+  InProcessStatestore* ips = InProcessStatestore::StartWithEphemeralPorts();
+  InProcessImpalaServer* impala_server =
+      InProcessImpalaServer::StartWithEphemeralPorts("localhost", ips->port());
   executor_ = new ImpaladQueryExecutor(impala_server->hostname(),
       impala_server->beeswax_port());
   ABORT_IF_ERROR(executor_->Setup());

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ab287955/be/src/runtime/exec-env.cc
----------------------------------------------------------------------
diff --git a/be/src/runtime/exec-env.cc b/be/src/runtime/exec-env.cc
index a84034a..6d5fb7a 100644
--- a/be/src/runtime/exec-env.cc
+++ b/be/src/runtime/exec-env.cc
@@ -27,7 +27,6 @@
 #include "common/logging.h"
 #include "common/object-pool.h"
 #include "exec/kudu-util.h"
-#include "gen-cpp/CatalogService.h"
 #include "gen-cpp/ImpalaInternalService.h"
 #include "runtime/backend-client.h"
 #include "runtime/bufferpool/buffer-pool.h"
@@ -48,14 +47,10 @@
 #include "scheduling/scheduler.h"
 #include "service/frontend.h"
 #include "statestore/statestore-subscriber.h"
-#include "util/bit-util.h"
-#include "util/debug-util.h"
 #include "util/debug-util.h"
 #include "util/default-path-handlers.h"
 #include "util/hdfs-bulk-ops.h"
 #include "util/mem-info.h"
-#include "util/mem-info.h"
-#include "util/memory-metrics.h"
 #include "util/memory-metrics.h"
 #include "util/metrics.h"
 #include "util/network-util.h"
@@ -66,15 +61,10 @@
 
 #include "common/names.h"
 
-using boost::algorithm::is_any_of;
 using boost::algorithm::join;
-using boost::algorithm::split;
-using boost::algorithm::to_lower;
-using boost::algorithm::token_compress_on;
 using namespace strings;
 
-DEFINE_bool(use_statestore, true,
-    "Use an external statestore process to manage cluster membership");
+DEFINE_bool_hidden(use_statestore, true, "Deprecated, do not use");
 DEFINE_string(catalog_service_host, "localhost",
     "hostname where CatalogService is running");
 DEFINE_bool(enable_webserver, true, "If true, debug webserver is enabled");
@@ -92,22 +82,23 @@ DECLARE_int32(num_cores);
 DECLARE_int32(be_port);
 DECLARE_string(mem_limit);
 DECLARE_bool(is_coordinator);
+DECLARE_int32(webserver_port);
 
 // TODO: Remove the following RM-related flags in Impala 3.0.
-DEFINE_bool(enable_rm, false, "Deprecated");
-DEFINE_int32(llama_callback_port, 28000, "Deprecated");
-DEFINE_string(llama_host, "", "Deprecated");
-DEFINE_int32(llama_port, 15000, "Deprecated");
-DEFINE_string(llama_addresses, "", "Deprecated");
-DEFINE_int64(llama_registration_timeout_secs, 30, "Deprecated");
-DEFINE_int64(llama_registration_wait_secs, 3, "Deprecated");
-DEFINE_int64(llama_max_request_attempts, 5, "Deprecated");
-DEFINE_string(cgroup_hierarchy_path, "", "Deprecated");
-DEFINE_string(staging_cgroup, "impala_staging", "Deprecated");
-DEFINE_int32(resource_broker_cnxn_attempts, 1, "Deprecated");
-DEFINE_int32(resource_broker_cnxn_retry_interval_ms, 3000, "Deprecated");
-DEFINE_int32(resource_broker_send_timeout, 0, "Deprecated");
-DEFINE_int32(resource_broker_recv_timeout, 0, "Deprecated");
+DEFINE_bool_hidden(enable_rm, false, "Deprecated");
+DEFINE_int32_hidden(llama_callback_port, 28000, "Deprecated");
+DEFINE_string_hidden(llama_host, "", "Deprecated");
+DEFINE_int32_hidden(llama_port, 15000, "Deprecated");
+DEFINE_string_hidden(llama_addresses, "", "Deprecated");
+DEFINE_int64_hidden(llama_registration_timeout_secs, 30, "Deprecated");
+DEFINE_int64_hidden(llama_registration_wait_secs, 3, "Deprecated");
+DEFINE_int64_hidden(llama_max_request_attempts, 5, "Deprecated");
+DEFINE_string_hidden(cgroup_hierarchy_path, "", "Deprecated");
+DEFINE_string_hidden(staging_cgroup, "impala_staging", "Deprecated");
+DEFINE_int32_hidden(resource_broker_cnxn_attempts, 1, "Deprecated");
+DEFINE_int32_hidden(resource_broker_cnxn_retry_interval_ms, 3000, 
"Deprecated");
+DEFINE_int32_hidden(resource_broker_send_timeout, 0, "Deprecated");
+DEFINE_int32_hidden(resource_broker_recv_timeout, 0, "Deprecated");
 
 // TODO-MT: rename or retire
 DEFINE_int32(coordinator_rpc_threads, 12, "(Advanced) Number of threads 
available to "
@@ -138,71 +129,9 @@ struct ExecEnv::KuduClientPtr {
 ExecEnv* ExecEnv::exec_env_ = nullptr;
 
 ExecEnv::ExecEnv()
-  : obj_pool_(new ObjectPool),
-    metrics_(new MetricGroup("impala-metrics")),
-    stream_mgr_(new DataStreamMgr(metrics_.get())),
-    impalad_client_cache_(
-        new 
ImpalaBackendClientCache(FLAGS_backend_client_connection_num_retries, 0,
-            FLAGS_backend_client_rpc_timeout_ms, 
FLAGS_backend_client_rpc_timeout_ms, "",
-            !FLAGS_ssl_client_ca_certificate.empty())),
-    catalogd_client_cache_(
-        new 
CatalogServiceClientCache(FLAGS_catalog_client_connection_num_retries, 0,
-            FLAGS_catalog_client_rpc_timeout_ms, 
FLAGS_catalog_client_rpc_timeout_ms, "",
-            !FLAGS_ssl_client_ca_certificate.empty())),
-    htable_factory_(new HBaseTableFactory()),
-    disk_io_mgr_(new DiskIoMgr()),
-    webserver_(new Webserver()),
-    mem_tracker_(nullptr),
-    pool_mem_trackers_(new PoolMemTrackerRegistry),
-    thread_mgr_(new ThreadResourceMgr),
-    hdfs_op_thread_pool_(
-        CreateHdfsOpThreadPool("hdfs-worker-pool", 
FLAGS_num_hdfs_worker_threads, 1024)),
-    tmp_file_mgr_(new TmpFileMgr),
-    request_pool_service_(new RequestPoolService(metrics_.get())),
-    frontend_(new Frontend()),
-    exec_rpc_thread_pool_(new CallableThreadPool("exec-rpc-pool", "worker",
-        FLAGS_coordinator_rpc_threads, numeric_limits<int32_t>::max())),
-    async_rpc_pool_(new CallableThreadPool("rpc-pool", "async-rpc-sender", 8, 
10000)),
-    query_exec_mgr_(new QueryExecMgr()),
-    buffer_reservation_(nullptr),
-    buffer_pool_(nullptr),
-    enable_webserver_(FLAGS_enable_webserver),
-    is_fe_tests_(false),
-    backend_address_(MakeNetworkAddress(FLAGS_hostname, FLAGS_be_port)) {
-  // Initialize the scheduler either dynamically (with a statestore) or 
statically (with
-  // a standalone single backend)
-  if (FLAGS_use_statestore) {
-    TNetworkAddress subscriber_address =
-        MakeNetworkAddress(FLAGS_hostname, FLAGS_state_store_subscriber_port);
-    TNetworkAddress statestore_address =
-        MakeNetworkAddress(FLAGS_state_store_host, FLAGS_state_store_port);
-
-    statestore_subscriber_.reset(new StatestoreSubscriber(
-        Substitute("impalad@$0", TNetworkAddressToString(backend_address_)),
-        subscriber_address, statestore_address, metrics_.get()));
-
-    if (FLAGS_is_coordinator) {
-      scheduler_.reset(new Scheduler(statestore_subscriber_.get(),
-          statestore_subscriber_->id(), backend_address_, metrics_.get(),
-          webserver_.get(), request_pool_service_.get()));
-    }
+  : ExecEnv(FLAGS_hostname, FLAGS_be_port, FLAGS_state_store_subscriber_port,
+        FLAGS_webserver_port, FLAGS_state_store_host, FLAGS_state_store_port) 
{}
 
-    if (!FLAGS_disable_admission_control) {
-      admission_controller_.reset(new 
AdmissionController(statestore_subscriber_.get(),
-          request_pool_service_.get(), metrics_.get(), backend_address_));
-    } else {
-      LOG(INFO) << "Admission control is disabled.";
-    }
-  } else if (FLAGS_is_coordinator) {
-    vector<TNetworkAddress> addresses;
-    addresses.push_back(MakeNetworkAddress(FLAGS_hostname, FLAGS_be_port));
-    scheduler_.reset(new Scheduler(
-        addresses, metrics_.get(), webserver_.get(), 
request_pool_service_.get()));
-  }
-  exec_env_ = this;
-}
-
-// TODO: Need refactor to get rid of duplicated code.
 ExecEnv::ExecEnv(const string& hostname, int backend_port, int subscriber_port,
     int webserver_port, const string& statestore_host, int statestore_port)
   : obj_pool_(new ObjectPool),
@@ -219,7 +148,6 @@ ExecEnv::ExecEnv(const string& hostname, int backend_port, 
int subscriber_port,
     htable_factory_(new HBaseTableFactory()),
     disk_io_mgr_(new DiskIoMgr()),
     webserver_(new Webserver(webserver_port)),
-    mem_tracker_(nullptr),
     pool_mem_trackers_(new PoolMemTrackerRegistry),
     thread_mgr_(new ThreadResourceMgr),
     hdfs_op_thread_pool_(
@@ -230,39 +158,29 @@ ExecEnv::ExecEnv(const string& hostname, int 
backend_port, int subscriber_port,
         FLAGS_coordinator_rpc_threads, numeric_limits<int32_t>::max())),
     async_rpc_pool_(new CallableThreadPool("rpc-pool", "async-rpc-sender", 8, 
10000)),
     query_exec_mgr_(new QueryExecMgr()),
-    buffer_reservation_(nullptr),
-    buffer_pool_(nullptr),
     enable_webserver_(FLAGS_enable_webserver && webserver_port > 0),
-    is_fe_tests_(false),
-    backend_address_(MakeNetworkAddress(FLAGS_hostname, FLAGS_be_port)) {
+    backend_address_(MakeNetworkAddress(hostname, backend_port)) {
   request_pool_service_.reset(new RequestPoolService(metrics_.get()));
 
-  if (FLAGS_use_statestore && statestore_port > 0) {
-    TNetworkAddress subscriber_address =
-        MakeNetworkAddress(hostname, subscriber_port);
-    TNetworkAddress statestore_address =
-        MakeNetworkAddress(statestore_host, statestore_port);
+  TNetworkAddress subscriber_address = MakeNetworkAddress(hostname, 
subscriber_port);
+  TNetworkAddress statestore_address =
+      MakeNetworkAddress(statestore_host, statestore_port);
 
-    statestore_subscriber_.reset(new StatestoreSubscriber(
-        Substitute("impalad@$0", TNetworkAddressToString(backend_address_)),
-        subscriber_address, statestore_address, metrics_.get()));
+  statestore_subscriber_.reset(new StatestoreSubscriber(
+      Substitute("impalad@$0", TNetworkAddressToString(backend_address_)),
+      subscriber_address, statestore_address, metrics_.get()));
 
-    if (FLAGS_is_coordinator) {
-      scheduler_.reset(new Scheduler(statestore_subscriber_.get(),
-          statestore_subscriber_->id(), backend_address_, metrics_.get(),
-          webserver_.get(), request_pool_service_.get()));
-    }
+  if (FLAGS_is_coordinator) {
+    scheduler_.reset(new Scheduler(statestore_subscriber_.get(),
+        statestore_subscriber_->id(), backend_address_, metrics_.get(), 
webserver_.get(),
+        request_pool_service_.get()));
+  }
 
-    if (FLAGS_disable_admission_control) LOG(INFO) << "Admission control is 
disabled.";
-    if (!FLAGS_disable_admission_control) {
-      admission_controller_.reset(new 
AdmissionController(statestore_subscriber_.get(),
-          request_pool_service_.get(), metrics_.get(), backend_address_));
-    }
-  } else if (FLAGS_is_coordinator) {
-    vector<TNetworkAddress> addresses;
-    addresses.push_back(MakeNetworkAddress(hostname, backend_port));
-    scheduler_.reset(new Scheduler(
-        addresses, metrics_.get(), webserver_.get(), 
request_pool_service_.get()));
+  if (FLAGS_disable_admission_control) {
+    LOG(INFO) << "Admission control is disabled.";
+  } else {
+    admission_controller_.reset(new 
AdmissionController(statestore_subscriber_.get(),
+        request_pool_service_.get(), metrics_.get(), backend_address_));
   }
   exec_env_ = this;
 }

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ab287955/be/src/runtime/exec-env.h
----------------------------------------------------------------------
diff --git a/be/src/runtime/exec-env.h b/be/src/runtime/exec-env.h
index 8437b41..4674072 100644
--- a/be/src/runtime/exec-env.h
+++ b/be/src/runtime/exec-env.h
@@ -53,16 +53,16 @@ class RequestPoolService;
 class ReservationTracker;
 class Scheduler;
 class StatestoreSubscriber;
-class TestExecEnv;
-
 class ThreadResourceMgr;
 class TmpFileMgr;
 class Webserver;
 
-/// Execution environment for queries/plan fragments.
-/// Contains all required global structures, and handles to
-/// singleton services. Clients must call StartServices exactly
-/// once to properly initialise service state.
+/// Execution environment for Impala daemon. Contains all required global 
structures, and
+/// handles to singleton services. Clients must call StartServices() exactly 
once to
+/// properly initialise service state.
+///
+/// There should only be one ExecEnv instance. It should always be accessed by 
calling
+/// ExecEnv::GetInstance().
 class ExecEnv {
  public:
   ExecEnv();
@@ -76,8 +76,12 @@ class ExecEnv {
   static ExecEnv* GetInstance() { return exec_env_; }
 
   /// Destructor - only used in backend tests that create new environment per 
test.
-  virtual ~ExecEnv();
+  ~ExecEnv();
+
+  /// Starts any dependent services in their correct order
+  Status StartServices();
 
+  /// TODO: Should ExecEnv own the ImpalaServer as well?
   void SetImpalaServer(ImpalaServer* server) { impala_server_ = server; }
 
   DataStreamMgr* stream_mgr() { return stream_mgr_.get(); }
@@ -113,9 +117,6 @@ class ExecEnv {
 
   const TNetworkAddress& backend_address() const { return backend_address_; }
 
-  /// Starts any dependent services in their correct order
-  virtual Status StartServices();
-
   /// Initializes the exec env for running FE tests.
   Status InitForFeTests();
 
@@ -134,8 +135,7 @@ class ExecEnv {
   Status GetKuduClient(
       const std::vector<std::string>& master_addrs, kudu::client::KuduClient** 
client);
 
- protected:
-  /// Leave protected so that subclasses can override
+ private:
   boost::scoped_ptr<ObjectPool> obj_pool_;
   boost::scoped_ptr<MetricGroup> metrics_;
   boost::scoped_ptr<DataStreamMgr> stream_mgr_;
@@ -165,7 +165,7 @@ class ExecEnv {
   boost::scoped_ptr<BufferPool> buffer_pool_;
 
   /// Not owned by this class
-  ImpalaServer* impala_server_;
+  ImpalaServer* impala_server_ = nullptr;
 
   bool enable_webserver_;
 
@@ -173,7 +173,7 @@ class ExecEnv {
   friend class TestEnv;
 
   static ExecEnv* exec_env_;
-  bool is_fe_tests_;
+  bool is_fe_tests_ = false;
 
   /// Address of the Impala backend server instance
   TNetworkAddress backend_address_;

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ab287955/be/src/scheduling/scheduler.cc
----------------------------------------------------------------------
diff --git a/be/src/scheduling/scheduler.cc b/be/src/scheduling/scheduler.cc
index 988a0b4..d746785 100644
--- a/be/src/scheduling/scheduler.cc
+++ b/be/src/scheduling/scheduler.cc
@@ -70,21 +70,6 @@ Scheduler::Scheduler(StatestoreSubscriber* subscriber, const 
string& backend_id,
   local_backend_descriptor_.address = backend_address;
 }
 
-Scheduler::Scheduler(const vector<TNetworkAddress>& backends, MetricGroup* 
metrics,
-    Webserver* webserver, RequestPoolService* request_pool_service)
-  : executors_config_(std::make_shared<const BackendConfig>(backends)),
-    metrics_(metrics),
-    webserver_(webserver),
-    statestore_subscriber_(nullptr),
-    thrift_serializer_(false),
-    total_assignments_(nullptr),
-    total_local_assignments_(nullptr),
-    initialized_(nullptr),
-    request_pool_service_(request_pool_service) {
-  DCHECK(backends.size() > 0);
-  local_backend_descriptor_.address = MakeNetworkAddress(FLAGS_hostname, 
FLAGS_be_port);
-}
-
 Status Scheduler::Init() {
   LOG(INFO) << "Starting scheduler";
 

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ab287955/be/src/scheduling/scheduler.h
----------------------------------------------------------------------
diff --git a/be/src/scheduling/scheduler.h b/be/src/scheduling/scheduler.h
index 7adfb5d..8d57c32 100644
--- a/be/src/scheduling/scheduler.h
+++ b/be/src/scheduling/scheduler.h
@@ -86,11 +86,6 @@ class Scheduler {
       const TNetworkAddress& backend_address, MetricGroup* metrics, Webserver* 
webserver,
       RequestPoolService* request_pool_service);
 
-  /// Initialize with a list of <host:port> pairs in 'static' mode - i.e. the 
set of
-  /// backends is fixed and will not be updated.
-  Scheduler(const std::vector<TNetworkAddress>& backends, MetricGroup* metrics,
-      Webserver* webserver, RequestPoolService* request_pool_service);
-
   /// Initialises the scheduler, acquiring all resources needed to make 
scheduling
   /// decisions once this method returns. Register with the subscription 
manager if
   /// required.

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ab287955/be/src/service/impalad-main.cc
----------------------------------------------------------------------
diff --git a/be/src/service/impalad-main.cc b/be/src/service/impalad-main.cc
index 3acce47..70cecba 100644
--- a/be/src/service/impalad-main.cc
+++ b/be/src/service/impalad-main.cc
@@ -49,12 +49,9 @@
 
 using namespace impala;
 
-DECLARE_string(classpath);
-DECLARE_bool(use_statestore);
 DECLARE_int32(beeswax_port);
 DECLARE_int32(hs2_port);
 DECLARE_int32(be_port);
-DECLARE_string(principal);
 DECLARE_bool(enable_rm);
 DECLARE_bool(is_coordinator);
 

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ab287955/be/src/service/session-expiry-test.cc
----------------------------------------------------------------------
diff --git a/be/src/service/session-expiry-test.cc 
b/be/src/service/session-expiry-test.cc
index 01a17eb..81271a4 100644
--- a/be/src/service/session-expiry-test.cc
+++ b/be/src/service/session-expiry-test.cc
@@ -43,7 +43,9 @@ DECLARE_int32(beeswax_port);
 
 TEST(SessionTest, TestExpiry) {
   FLAGS_idle_session_timeout = 1;
-  InProcessImpalaServer* impala = 
InProcessImpalaServer::StartWithEphemeralPorts();
+  InProcessStatestore* ips = InProcessStatestore::StartWithEphemeralPorts();
+  InProcessImpalaServer* impala =
+      InProcessImpalaServer::StartWithEphemeralPorts("localhost", ips->port());
   IntCounter* expired_metric =
       impala->metrics()->FindMetricForTesting<IntCounter>(
           ImpaladMetricKeys::NUM_SESSIONS_EXPIRED);

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ab287955/be/src/testutil/in-process-servers.cc
----------------------------------------------------------------------
diff --git a/be/src/testutil/in-process-servers.cc 
b/be/src/testutil/in-process-servers.cc
index 365e610..015e7e2 100644
--- a/be/src/testutil/in-process-servers.cc
+++ b/be/src/testutil/in-process-servers.cc
@@ -66,8 +66,7 @@ InProcessImpalaServer* 
InProcessImpalaServer::StartWithEphemeralPorts(
             webserver_port, statestore_host, statestore_port);
     // Start the daemon and check if it works, if not delete the current 
server object and
     // pick a new set of ports
-    Status started = impala->StartWithClientServers(beeswax_port, hs2_port,
-        !statestore_host.empty());
+    Status started = impala->StartWithClientServers(beeswax_port, hs2_port);
     if (started.ok()) {
       impala->SetCatalogInitialized();
       return impala;
@@ -94,8 +93,7 @@ void InProcessImpalaServer::SetCatalogInitialized() {
   exec_env_->frontend()->SetCatalogInitialized();
 }
 
-Status InProcessImpalaServer::StartWithClientServers(int beeswax_port, int 
hs2_port,
-    bool use_statestore) {
+Status InProcessImpalaServer::StartWithClientServers(int beeswax_port, int 
hs2_port) {
   RETURN_IF_ERROR(exec_env_->StartServices());
   beeswax_port_ = beeswax_port;
   hs2_port_ = hs2_port;
@@ -118,7 +116,7 @@ Status InProcessImpalaServer::StartWithClientServers(int 
beeswax_port, int hs2_p
   return Status::OK();
 }
 
-Status InProcessImpalaServer::StartAsBackendOnly(bool use_statestore) {
+Status InProcessImpalaServer::StartAsBackendOnly() {
   RETURN_IF_ERROR(exec_env_->StartServices());
   ThriftServer* be_server;
   RETURN_IF_ERROR(CreateImpalaServer(exec_env_.get(), 0, 0, backend_port_, 
NULL, NULL,

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ab287955/be/src/testutil/in-process-servers.h
----------------------------------------------------------------------
diff --git a/be/src/testutil/in-process-servers.h 
b/be/src/testutil/in-process-servers.h
index 870f02d..3f91b2a 100644
--- a/be/src/testutil/in-process-servers.h
+++ b/be/src/testutil/in-process-servers.h
@@ -54,16 +54,15 @@ class InProcessImpalaServer {
   /// indicate that a statestore connection should not be used. These values 
are directly
   /// forwarded to the ExecEnv.
   static InProcessImpalaServer* StartWithEphemeralPorts(
-      const std::string& statestore_host = "", int statestore_port = 0);
+      const std::string& statestore_host, int statestore_port);
 
   /// Starts all servers, including the beeswax and hs2 client
-  /// servers. If use_statestore is set, a connection to the statestore
-  /// is established. If there is no error, returns Status::OK.
-  Status StartWithClientServers(int beeswax_port, int hs2_port, bool 
use_statestore);
+  /// servers.
+  Status StartWithClientServers(int beeswax_port, int hs2_port);
 
   /// Starts only the backend server; useful when running a cluster of
   /// InProcessImpalaServers and only one is to serve client requests.
-  Status StartAsBackendOnly(bool use_statestore);
+  Status StartAsBackendOnly();
 
   /// Blocks until the backend server exits. Returns Status::OK unless
   /// there was an error joining.

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ab287955/be/src/testutil/mini-impala-cluster.cc
----------------------------------------------------------------------
diff --git a/be/src/testutil/mini-impala-cluster.cc 
b/be/src/testutil/mini-impala-cluster.cc
index 85cd843..509af39 100644
--- a/be/src/testutil/mini-impala-cluster.cc
+++ b/be/src/testutil/mini-impala-cluster.cc
@@ -39,7 +39,6 @@ DECLARE_int32(be_port);
 DECLARE_int32(beeswax_port);
 DECLARE_int32(hs2_port);
 DECLARE_string(principal);
-DECLARE_bool(use_statestore);
 
 #include "common/names.h"
 
@@ -67,7 +66,7 @@ int main(int argc, char** argv) {
   int hs2_port = 21050;
 
   scoped_ptr<InProcessStatestore> statestore(new InProcessStatestore(23000, 
25100));
-  if (FLAGS_use_statestore) ABORT_IF_ERROR(statestore->Start());
+  ABORT_IF_ERROR(statestore->Start());
   LOG(INFO) << "Started in-process statestore";
 
   vector<InProcessImpalaServer*> impala_servers;
@@ -78,10 +77,9 @@ int main(int argc, char** argv) {
                                   FLAGS_hostname, 23000));
     // First server in the list runs client servers
     if (i == 0) {
-      ABORT_IF_ERROR(impala_servers[i]->StartWithClientServers(beeswax_port, 
hs2_port,
-                                                              
FLAGS_use_statestore));
+      ABORT_IF_ERROR(impala_servers[i]->StartWithClientServers(beeswax_port, 
hs2_port));
     } else {
-      
ABORT_IF_ERROR(impala_servers[i]->StartAsBackendOnly(FLAGS_use_statestore));
+      ABORT_IF_ERROR(impala_servers[i]->StartAsBackendOnly());
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ab287955/docs/topics/impala_config_options.xml
----------------------------------------------------------------------
diff --git a/docs/topics/impala_config_options.xml 
b/docs/topics/impala_config_options.xml
index 725a791..72f63ae 100644
--- a/docs/topics/impala_config_options.xml
+++ b/docs/topics/impala_config_options.xml
@@ -98,7 +98,6 @@ IMPALA_SERVER_ARGS=" \
 -log_dir=${IMPALA_LOG_DIR} \
 -catalog_service_host=${IMPALA_CATALOG_SERVICE_HOST} \
 -state_store_port=${IMPALA_STATE_STORE_PORT} \
--use_statestore \
 -state_store_host=${IMPALA_STATE_STORE_HOST} \
 -be_port=${IMPALA_BACKEND_PORT}"
 export ENABLE_CORE_DUMPS=${ENABLE_COREDUMPS:-false}</codeblock>
@@ -179,14 +178,14 @@ Starting Impala Catalog Server:                           
 [  OK  ]</codeblock>
 <codeblock>export IMPALA_SERVER_ARGS=${IMPALA_SERVER_ARGS:- \
     -log_dir=${IMPALA_LOG_DIR} \
     -state_store_port=${IMPALA_STATE_STORE_PORT} \
-    -use_statestore -state_store_host=${IMPALA_STATE_STORE_HOST} \
+    -state_store_host=${IMPALA_STATE_STORE_HOST} \
     -be_port=${IMPALA_BACKEND_PORT}}</codeblock>
           <p>
             to:
           </p>
 <codeblock>export IMPALA_SERVER_ARGS=${IMPALA_SERVER_ARGS:- \
     -log_dir=${IMPALA_LOG_DIR} -state_store_port=${IMPALA_STATE_STORE_PORT} \
-    -use_statestore -state_store_host=${IMPALA_STATE_STORE_HOST} \
+    -state_store_host=${IMPALA_STATE_STORE_HOST} \
     -be_port=${IMPALA_BACKEND_PORT} -mem_limit=70%}</codeblock>
           <p>
             You can specify the memory limit using absolute notation such as
@@ -357,14 +356,14 @@ Starting Impala Catalog Server:                           
 [  OK  ]</codeblock>
 <codeblock>export IMPALA_SERVER_ARGS=${IMPALA_SERVER_ARGS:- \
     -log_dir=${IMPALA_LOG_DIR} \
     -state_store_port=${IMPALA_STATE_STORE_PORT} \
-    -use_statestore -state_store_host=${IMPALA_STATE_STORE_HOST} \
+    -state_store_host=${IMPALA_STATE_STORE_HOST} \
     -be_port=${IMPALA_BACKEND_PORT}}</codeblock>
             <p>
               to:
             </p>
 <codeblock>export IMPALA_SERVER_ARGS=${IMPALA_SERVER_ARGS:- \
     -log_dir=${IMPALA_LOG_DIR} -state_store_port=${IMPALA_STATE_STORE_PORT} \
-    -use_statestore -state_store_host=${IMPALA_STATE_STORE_HOST} \
+    -state_store_host=${IMPALA_STATE_STORE_HOST} \
     -be_port=${IMPALA_BACKEND_PORT} -mem_limit=70%}</codeblock>
             <p>
               You can specify the memory limit using absolute notation such as

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ab287955/docs/topics/impala_upgrading.xml
----------------------------------------------------------------------
diff --git a/docs/topics/impala_upgrading.xml b/docs/topics/impala_upgrading.xml
index 2d29925..37ef2b2 100644
--- a/docs/topics/impala_upgrading.xml
+++ b/docs/topics/impala_upgrading.xml
@@ -119,8 +119,8 @@ $ ps ax | grep [c]atalogd
               <codeph>impalad</codeph> if the service started successfully.
 <codeblock>$ sudo service impala-server start
 $ ps ax | grep [i]mpalad
- 7936 ?        Sl     0:12 /usr/lib/impala/sbin/impalad 
-log_dir=/var/log/impala -state_store_port=24000 -use_statestore
--state_store_host=127.0.0.1 -be_port=22000
+ 7936 ?        Sl     0:12 /usr/lib/impala/sbin/impalad 
-log_dir=/var/log/impala -state_store_port=24000
+ -state_store_host=127.0.0.1 -be_port=22000
 </codeblock>
             </li>
           </ol>

Reply via email to