29 using namespace apache::thrift;
30 using namespace impala;
32 InProcessImpalaServer::InProcessImpalaServer(
const string& hostname,
int backend_port,
33 int subscriber_port,
int webserver_port,
const string& statestore_host,
35 : hostname_(hostname), backend_port_(backend_port),
37 exec_env_(new
ExecEnv(hostname, backend_port, subscriber_port, webserver_port,
38 statestore_host, statestore_port)) {
43 exec_env_->frontend()->SetCatalogInitialized();
47 bool use_statestore) {
85 : webserver_(new
Webserver(webserver_port)),
87 statestore_port_(statestore_port),
95 shared_ptr<TProcessor> processor(
96 new StatestoreServiceProcessor(
statestore_->thrift_iface()));
TODO: Consider allowing fragment IDs as category parameters.
void AddDefaultUrlCallbacks(Webserver *webserver, MemTracker *process_mem_tracker=NULL)
#define RETURN_IF_ERROR(stmt)
some generally useful macros
MetricGroups may be organised hierarchically as a tree.
boost::scoped_ptr< ExecEnv > exec_env_
ExecEnv holds much of the per-service state.
InProcessStatestore(int statestore_port, int webserver_port)
Constructs but does not start the statestore.
boost::scoped_ptr< Thread > statestore_main_loop_
boost::scoped_ptr< Statestore > statestore_
The statestore instance.
const std::string hostname_
Hostname for this server, usually FLAGS_hostname.
boost::scoped_ptr< MetricGroup > metrics_
MetricGroup object.
void SetCatalogInitialized()
boost::scoped_ptr< Webserver > webserver_
Websever object to serve debug pages through.
ImpalaServer * impala_server_
Status WaitForServer(const string &host, int port, int num_retries, int retry_interval_ms)
boost::scoped_ptr< ThriftServer > hs2_server_
Frontend HiveServer2 server.
Status CreateImpalaServer(ExecEnv *exec_env, int beeswax_port, int hs2_port, int be_port, ThriftServer **beeswax_server, ThriftServer **hs2_server, ThriftServer **be_server, ImpalaServer **impala_server)
Status MainLoop()
The main processing loop. Blocks until the exit flag is set.
uint32_t statestore_port_
Port to start the statestore on.
const uint32_t backend_port_
Port to start the backend server on.
Status Start()
Starts the statestore server, and the processing thread.
boost::scoped_ptr< ThriftServer > statestore_server_
Statestore Thrift server.
Status StartWithClientServers(int beeswax_port, int hs2_port, bool use_statestore)
boost::scoped_ptr< ThriftServer > be_server_
Backend Thrift server.
boost::scoped_ptr< ThriftServer > beeswax_server_
Frontend Beeswax server.
Status StartAsBackendOnly(bool use_statestore)