MCPcopy Create free account
hub / github.com/apache/impala / Start

Method Start

be/src/rpc/thrift-server.cc:408–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408Status ThriftServer::Start() {
409 DCHECK(!started_);
410 std::shared_ptr<TProtocolFactory> protocol_factory(new TBinaryProtocolFactory());
411 std::shared_ptr<ThreadFactory> thread_factory(
412 new ThriftThreadFactory("thrift-server", name_));
413
414 // Note - if you change the transport types here, you must check that the
415 // logic in createContext is still accurate.
416 std::shared_ptr<TServerSocket> server_socket;
417 std::shared_ptr<TTransportFactory> transport_factory;
418 RETURN_IF_ERROR(CreateSocket(&server_socket));
419 RETURN_IF_ERROR(auth_provider_->GetServerTransportFactory(
420 transport_type_, metrics_name_, metrics_, &transport_factory));
421
422 server_.reset(new TAcceptQueueServer(processor_, server_socket, transport_factory,
423 protocol_factory, thread_factory, name_, max_concurrent_connections_,
424 queue_timeout_ms_, idle_poll_period_ms_, is_external_facing_));
425 if (metrics_ != NULL) {
426 (static_cast<TAcceptQueueServer*>(server_.get()))
427 ->InitMetrics(metrics_, metrics_name_);
428 }
429 std::shared_ptr<ThriftServer::ThriftServerEventProcessor> event_processor(
430 new ThriftServer::ThriftServerEventProcessor(this));
431 server_->setServerEventHandler(event_processor);
432
433 RETURN_IF_ERROR(event_processor->StartAndWaitForServer());
434
435 // If port_ was 0, figure out which port the server is listening on after starting.
436 port_ = server_socket->getPort();
437 LOG(INFO) << "ThriftServer '" << name_ << "' started on port: " << port_
438 << (ssl_enabled() ? "s" : "");
439 DCHECK(started_);
440 return Status::OK();
441}
442
443void ThriftServer::Join() {
444 DCHECK(server_thread_ != NULL);

Callers 15

TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TestMaxMessageSizeFunction · 0.45
TEST_PFunction · 0.45
SetupConnectionMethod · 0.45
StartServicesMethod · 0.45
InitMethod · 0.45
ExecCompleteCbMethod · 0.45
TEST_FFunction · 0.45
FreeAllMethod · 0.45

Calls 7

OKFunction · 0.85
StartAndWaitForServerMethod · 0.80
resetMethod · 0.65
getMethod · 0.65
InitMetricsMethod · 0.45
getPortMethod · 0.45

Tested by 6

TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TestMaxMessageSizeFunction · 0.36
TEST_PFunction · 0.36
TEST_FFunction · 0.36