17 #include <boost/bind.hpp>
22 using namespace impala;
25 namespace atc = apache::thrift::concurrency;
45 shared_ptr<atc::Runnable> runnable)
const {
48 shared_ptr<ThriftThread> result =
50 runnable->thread(result);
56 promise->
Set(get_current());
65 return atc::Thread::get_current();
69 shared_ptr<atc::Runnable> runnable)
70 : group_(group), name_(name) {
72 this->Thread::runnable(runnable);
TODO: Consider allowing fragment IDs as category parameters.
ThriftThread(const std::string &group, const std::string &name, boost::shared_ptr< apache::thrift::concurrency::Runnable > runnable)
virtual apache::thrift::concurrency::Thread::id_t getCurrentThreadId() const
virtual id_t getId()
Returns the Thrift thread ID of the execution thread.
std::string prefix_
Thread name prefix for the Impala ThreadManager.
virtual boost::shared_ptr< apache::thrift::concurrency::Thread > newThread(boost::shared_ptr< apache::thrift::concurrency::Runnable > runnable) const
(From ThreadFactory) - creates a new ThriftThread to run the supplied Runnable.
boost::scoped_ptr< impala::Thread > impala_thread_
void RunRunnable(boost::shared_ptr< apache::thrift::concurrency::Runnable > runnable, Promise< apache::thrift::concurrency::Thread::id_t > *promise)
std::string name_
Individual thread name for the Impala ThreadManager.
apache::thrift::concurrency::Thread::id_t tid_
Thrift thread ID, set by RunRunnable.
std::string group_
Group name for the Impala ThreadManager.
virtual void join()
Joins the separate thread.
std::string group_
Group name for the Impala ThreadManager.