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

#include <object-pool.h>

Collaboration diagram for impala::ObjectPool:

Classes

struct  GenericElement
 
struct  SpecificElement
 

Public Member Functions

 ObjectPool ()
 
 ~ObjectPool ()
 
template<class T >
T * Add (T *t)
 

Private Types

typedef std::vector
< GenericElement * > 
ElementVector
 

Private Attributes

ElementVector objects_
 
SpinLock lock_
 

Detailed Description

An ObjectPool maintains a list of C++ objects which are deallocated by destroying the pool. Thread-safe.

Definition at line 30 of file object-pool.h.

Member Typedef Documentation

typedef std::vector<GenericElement*> impala::ObjectPool::ElementVector
private

Definition at line 66 of file object-pool.h.

Constructor & Destructor Documentation

impala::ObjectPool::ObjectPool ( )
inline

Definition at line 32 of file object-pool.h.

impala::ObjectPool::~ObjectPool ( )
inline

Definition at line 34 of file object-pool.h.

References objects_.

Member Function Documentation

template<class T >
T* impala::ObjectPool::Add ( T *  t)
inline

Create the object to be pushed to the shared vector outside the critical section. TODO: Consider using a lock-free structure.

Definition at line 42 of file object-pool.h.

References lock_, and objects_.

Referenced by impala::Sorter::AddBatch(), impala::RuntimeProfile::AddDerivedCounter(), impala::ScannerContext::AddStream(), impala::RuntimeProfile::AddThreadCounters(), impala::HdfsScanNode::AllocateScanRange(), impala::Coordinator::BackendExecState::BackendExecState(), impala::ExprContext::Clone(), impala::AggFnEvaluator::Create(), impala::DescriptorTbl::Create(), impala::HdfsScanNode::CreateAndPrepareScanner(), impala::CreateAnyVal(), impala::LlvmCodeGenTest::CreateCodegen(), impala::SimpleTupleStreamTest::CreateDescriptors(), impala::SimpleNullStreamTest::CreateDescriptors(), impala::MultiTupleStreamTest::CreateDescriptors(), impala::MultiNullableTupleStreamTest::CreateDescriptors(), impala::Expr::CreateExpr(), impala::PartitionedAggregationNode::CreateHashPartitions(), impala::SimpleTupleStreamTest::CreateIntBatch(), impala::ExecNode::CreateNode(), impala::HdfsParquetScanner::CreateReader(), impala::RowBatchListTest::CreateRowBatch(), impala::SimpleTupleStreamTest::CreateStringBatch(), impala::Expr::CreateTreeFromThrift(), impala::DataStreamRecvr::DataStreamRecvr(), impala::DescriptorTblBuilder::DeclareTuple(), impala::BufferedBlockMgr::FindBuffer(), impala::DiskIoMgr::GetBufferDesc(), impala::BufferedBlockMgr::GetNewBlock(), impala::HdfsTableSink::GetOutputPartition(), impala::BufferedBlockMgr::GetUnusedBlock(), impala::HdfsTableDescriptor::HdfsTableDescriptor(), impala::HdfsParquetTableWriter::Init(), impala::Sorter::Init(), impala::PartitionedAggregationNode::Partition::InitStreams(), impala::Sorter::MergeIntermediateRuns(), impala::HdfsScanNode::Open(), impala::BufferedBlockMgr::PinBlock(), impala::HBaseTableSink::Prepare(), impala::AggregationNode::Prepare(), impala::SortedRunMerger::Prepare(), impala::AnalyticEvalNode::Prepare(), impala::PartitionedHashJoinNode::Prepare(), impala::DataStreamSender::Prepare(), impala::PartitionedAggregationNode::Prepare(), impala::HdfsTableSink::Prepare(), impala::PartitionedHashJoinNode::ProcessBuildInput(), impala::BaseSequenceScanner::ProcessSplit(), impala::BufferedBlockMgr::RegisterClient(), impala::RuntimeProfile::RuntimeProfile(), impala::HdfsScanNode::ScannerThread(), impala::RowBatchListTest::SetUp(), impala::OldHashTableTest::SetUp(), impala::HashTableTest::SetUp(), impala::TEST(), impala::TEST_F(), impala::TestSingleLiteralConstruction(), impala::RuntimeProfile::UpdateAverage(), and impala::BufferedBlockMgr::WriteUnpinnedBlock().

Member Data Documentation

SpinLock impala::ObjectPool::lock_
private

Definition at line 68 of file object-pool.h.

Referenced by Add().

ElementVector impala::ObjectPool::objects_
private

Definition at line 67 of file object-pool.h.

Referenced by Add(), and ~ObjectPool().


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