Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <thrift-thread.h>
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::Thread > | impala_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... | |
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.
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.
|
inlinevirtual |
Definition at line 82 of file thrift-thread.h.
|
virtual |
Returns the Thrift thread ID of the execution thread.
Definition at line 36 of file thrift-thread.cc.
References tid_.
|
virtual |
Joins the separate thread.
Definition at line 40 of file thrift-thread.cc.
References impala_thread_.
|
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().
|
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_.
|
private |
Group name for the Impala ThreadManager.
Definition at line 99 of file thrift-thread.h.
Referenced by start().
|
private |
Impala thread that runs the runnable and registers itself with the global ThreadManager.
Definition at line 93 of file thrift-thread.h.
|
private |
Individual thread name for the Impala ThreadManager.
Definition at line 102 of file thrift-thread.h.
Referenced by start().
|
private |
Thrift thread ID, set by RunRunnable.
Definition at line 96 of file thrift-thread.h.