Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::ThriftThread Class Reference

#include <thrift-thread.h>

Inheritance diagram for impala::ThriftThread:
Collaboration diagram for impala::ThriftThread:

Public Member Functions

 ThriftThread (const std::string &group, const std::string &name, boost::shared_ptr< apache::thrift::concurrency::Runnable > runnable)
 
virtual void start ()
 
virtual void join ()
 Joins the separate thread. More...
 
virtual id_t getId ()
 Returns the Thrift thread ID of the execution thread. More...
 
virtual ~ThriftThread ()
 

Private Member Functions

void RunRunnable (boost::shared_ptr< apache::thrift::concurrency::Runnable > runnable, Promise< apache::thrift::concurrency::Thread::id_t > *promise)
 

Private Attributes

boost::scoped_ptr< impala::Threadimpala_thread_
 
apache::thrift::concurrency::Thread::id_t tid_
 Thrift thread ID, set by RunRunnable. More...
 
std::string group_
 Group name for the Impala ThreadManager. More...
 
std::string name_
 Individual thread name for the Impala ThreadManager. More...
 

Detailed Description

A ThriftThread is a Thrift-compatible wrapper for Impala's Thread class, so that all server threads are registered with the global ThreadManager.

Definition at line 67 of file thrift-thread.h.

Constructor & Destructor Documentation

ThriftThread::ThriftThread ( const std::string &  group,
const std::string &  name,
boost::shared_ptr< apache::thrift::concurrency::Runnable >  runnable 
)

Definition at line 68 of file thrift-thread.cc.

virtual impala::ThriftThread::~ThriftThread ( )
inlinevirtual

Definition at line 82 of file thrift-thread.h.

Member Function Documentation

atc::Thread::id_t ThriftThread::getId ( )
virtual

Returns the Thrift thread ID of the execution thread.

Definition at line 36 of file thrift-thread.cc.

References tid_.

void ThriftThread::join ( )
virtual

Joins the separate thread.

Definition at line 40 of file thrift-thread.cc.

References impala_thread_.

void ThriftThread::RunRunnable ( boost::shared_ptr< apache::thrift::concurrency::Runnable >  runnable,
Promise< apache::thrift::concurrency::Thread::id_t > *  promise 
)
private

Method executed on impala_thread_. Runs the Runnable once promise has been set to the current thread ID. The runnable parameter is a shared_ptr so that is always valid even after the ThriftThread may have been terminated.

Definition at line 54 of file thrift-thread.cc.

References impala::Promise< T >::Set().

Referenced by start().

void ThriftThread::start ( )
virtual

(From Thread) - starts execution of the runnable in a separate thread, returning once execution has begun.

Definition at line 27 of file thrift-thread.cc.

References impala::Promise< T >::Get(), group_, impala_thread_, name_, RunRunnable(), and tid_.

Member Data Documentation

std::string impala::ThriftThread::group_
private

Group name for the Impala ThreadManager.

Definition at line 99 of file thrift-thread.h.

Referenced by start().

boost::scoped_ptr<impala::Thread> impala::ThriftThread::impala_thread_
private

Impala thread that runs the runnable and registers itself with the global ThreadManager.

Definition at line 93 of file thrift-thread.h.

Referenced by join(), and start().

std::string impala::ThriftThread::name_
private

Individual thread name for the Impala ThreadManager.

Definition at line 102 of file thrift-thread.h.

Referenced by start().

apache::thrift::concurrency::Thread::id_t impala::ThriftThread::tid_
private

Thrift thread ID, set by RunRunnable.

Definition at line 96 of file thrift-thread.h.

Referenced by getId(), and start().


The documentation for this class was generated from the following files: