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

#include <thrift-thread.h>

Inheritance diagram for impala::ThriftThreadFactory:
Collaboration diagram for impala::ThriftThreadFactory:

Public Member Functions

 ThriftThreadFactory (const std::string &group, const std::string &prefix)
 
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. More...
 
virtual
apache::thrift::concurrency::Thread::id_t 
getCurrentThreadId () const
 

Private Attributes

std::string group_
 Group name for the Impala ThreadManager. More...
 
std::string prefix_
 Thread name prefix for the Impala ThreadManager. More...
 
int64_t count_
 

Detailed Description

The ThriftThreadFactory is responsible for creating new ThriftThreads to run server tasks on.

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

Constructor & Destructor Documentation

impala::ThriftThreadFactory::ThriftThreadFactory ( const std::string &  group,
const std::string &  prefix 
)
inline

Group is the thread group for new threads to be assigned to, and prefix is the per-thread prefix (threads are named "prefix-<count_>-<tid>").

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

Member Function Documentation

atc::Thread::id_t ThriftThreadFactory::getCurrentThreadId ( ) const
virtual

(From ThreadFactory) - returns the current thread ID, i.e. the ID of the executing thread (which may not have been created by this factory).

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

shared_ptr< atc::Thread > ThriftThreadFactory::newThread ( boost::shared_ptr< apache::thrift::concurrency::Runnable >  runnable) const
virtual

(From ThreadFactory) - creates a new ThriftThread to run the supplied Runnable.

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

References count_, group_, impala::name, and prefix_.

Member Data Documentation

int64_t impala::ThriftThreadFactory::count_
mutableprivate

Marked mutable because we want to increment it inside newThread, which for some reason is const.

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

Referenced by newThread().

std::string impala::ThriftThreadFactory::group_
private

Group name for the Impala ThreadManager.

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

Referenced by newThread().

std::string impala::ThriftThreadFactory::prefix_
private

Thread name prefix for the Impala ThreadManager.

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

Referenced by newThread().


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