Fennel: CheckpointThread Class Reference (original) (raw)

CheckpointThread is dedicated to listening for checkpoint requests and carrying them out. More...

#include <[CheckpointThread.h](CheckpointThread%5F8h-source.html)>

Inheritance diagram for CheckpointThread:

List of all members.

Public Member Functions
CheckpointThread (Database &database)
Creates a checkpoint thread for the given database (no more than one is ever needed).
SXMutex & getActionMutex ()
Gets the action mutex.
virtual void requestCheckpoint (CheckpointType checkpointType)
Implements CheckpointProvider by signalling the checkpoint thread, which in response will quiesce the system and carry out a checkpoint.
virtual void start ()
Spawns the OS thread.
void join ()
Waits for the OS thread to terminate.
bool isStarted () const
**Returns:**true if start has been called (and subsequent join has not completed)
bool isStopped () const
**Returns:**opposite of isStarted()
boost::thread & getBoostThread ()
Accesses the underlying boost::thread, e.g.
std::string getName ()
void setName (std::string const &s)
bool isClosed () const
**Returns:**whether the object has been closed
void close ()
Closes this object, releasing any unallocated resources.
Protected Member Functions
void initAndRun ()
virtual void beforeRun ()
virtual void afterRun ()
Protected Attributes
boost::thread * pBoostThread
bool bRunning
std::string name
StrictMutex mutex
LocalCondition condition
bool needsClose
Private Member Functions
void closeImpl ()
Implements ClosableObject by requesting that the checkpoint thread shut itself down.
virtual void run ()
Private Attributes
Database & database
SXMutex actionMutex
CheckpointType checkpointType
bool quit

Detailed Description

CheckpointThread is dedicated to listening for checkpoint requests and carrying them out.

Definition at line 38 of file CheckpointThread.h.


Constructor & Destructor Documentation

CheckpointThread::CheckpointThread ( Database & database ) [explicit]

Member Function Documentation

| void CheckpointThread::closeImpl | ( | | ) | [private, virtual] | | -------------------------------- | - | | - | -------------------- |

| void CheckpointThread::run | ( | | ) | [private, virtual] | | -------------------------- | - | | - | -------------------- |

| SXMutex & CheckpointThread::getActionMutex | ( | | ) | | --------------------------------------------------------------- | - | | - |

Gets the action mutex.

The checkpoint thread takes an exclusive lock on this mutex for the duration of each checkpoint, so any thread which needs to carry out an action which must not overlap a checkpoint should take a shared lock on this for the duration of the action.

Returns:

the mutex

Definition at line 63 of file CheckpointThread.cpp.

References actionMutex.

void CheckpointThread::requestCheckpoint ( CheckpointType checkpointType ) [virtual]

| void Thread::initAndRun | ( | | ) | [protected, inherited] | | ----------------------- | - | | - | ------------------------ |

| void Thread::beforeRun | ( | | ) | [protected, virtual, inherited] | | ---------------------- | - | | - | --------------------------------- |

| void Thread::afterRun | ( | | ) | [protected, virtual, inherited] | | --------------------- | - | | - | --------------------------------- |

| void Thread::start | ( | | ) | [virtual, inherited] | | ------------------ | - | | - | ---------------------- |

| void Thread::join | ( | | ) | [inherited] | | ----------------- | - | | - | ------------- |

| bool Thread::isStarted | ( | | ) | const [inline, inherited] | | ---------------------- | - | | - | --------------------------- |

| bool Thread::isStopped | ( | | ) | const [inline, inherited] | | ---------------------- | - | | - | --------------------------- |

| boost::thread& Thread::getBoostThread | ( | | ) | [inline, inherited] | | ------------------------------------- | - | | - | --------------------- |

Accesses the underlying boost::thread, e.g.

for use in a boost::thread_group. This thread must already be started.

Returns:

the underlying boost::thread

Definition at line 90 of file Thread.h.

| std::string Thread::getName | ( | | ) | [inline, inherited] | | --------------------------- | - | | - | --------------------- |

Definition at line 96 of file Thread.h.

00097 { 00098 return name; 00099 }

void Thread::setName ( std::string const & s ) [inline, inherited]

| bool ClosableObject::isClosed | ( | | ) | const [inline, inherited] | | ----------------------------- | - | | - | --------------------------- |

Returns:

whether the object has been closed

Definition at line 58 of file ClosableObject.h.

| void ClosableObject::close | ( | | ) | [inherited] | | -------------------------- | - | | - | ------------- |

Closes this object, releasing any unallocated resources.

Reimplemented in CollectExecStream, CorrelationJoinExecStream, LcsClusterAppendExecStream, and LcsClusterReplaceExecStream.

Definition at line 39 of file ClosableObject.cpp.

References ClosableObject::closeImpl(), and ClosableObject::needsClose.

Referenced by CacheImpl< PageT, VictimPolicyT >::allocatePages(), LcsRowScanBaseExecStream::closeImpl(), ExecStreamGraphImpl::closeImpl(), FlatFileBuffer::open(), ClosableObjectDestructor::operator()(), and Segment::~Segment().


Member Data Documentation

Definition at line 38 of file SynchMonitoredObject.h.

Referenced by ParallelExecStreamScheduler::abort(), LogicalTxnLog::checkpoint(), Database::checkpointImpl(), closeImpl(), LogicalTxnLog::commitTxn(), ParallelExecStreamScheduler::executeManager(), ParallelExecStreamScheduler::executeTask(), LogicalTxnLog::getOldestActiveTxnId(), LogicalTxnLog::newLogicalTxn(), ParallelExecStreamScheduler::readStream(), SXMutex::release(), GroupLock::release(), Database::requestCheckpoint(), requestCheckpoint(), LogicalTxnLog::rollbackTxn(), TimerThread::run(), run(), ThreadPoolBase::runPooledThread(), SXMutex::setSchedulingPolicy(), TimerThread::signalImmediate(), ParallelExecStreamScheduler::signalSentinel(), ThreadPoolBase::start(), TimerThread::stop(), ThreadPoolBase::stop(), ParallelExecStreamScheduler::stop(), ThreadPool< RandomAccessRequest >::submitTask(), ParallelExecStreamScheduler::tryExecuteManager(), ParallelExecStreamScheduler::tryExecuteTask(), SXMutex::tryUpgrade(), SXMutex::waitFor(), GroupLock::waitFor(), and Database::writeStats().

Definition at line 39 of file SynchMonitoredObject.h.

Referenced by ParallelExecStreamScheduler::abort(), Database::checkpointImpl(), closeImpl(), LogicalTxnLog::commitTxnWithGroup(), ParallelExecStreamScheduler::executeTask(), ParallelExecStreamScheduler::readStream(), SXMutex::release(), GroupLock::release(), Database::requestCheckpoint(), requestCheckpoint(), TimerThread::run(), run(), ThreadPoolBase::runPooledThread(), TimerThread::signalImmediate(), TimerThread::stop(), ThreadPoolBase::stop(), ParallelExecStreamScheduler::stop(), ThreadPool< RandomAccessRequest >::submitTask(), ParallelExecStreamScheduler::tryExecuteManager(), ParallelExecStreamScheduler::tryExecuteTask(), SXMutex::waitFor(), and GroupLock::waitFor().


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


Generated on Mon Jun 22 04:00:28 2009 for Fennel by doxygen 1.5.1