Queue for periodic maintenance work.
More...
#include <MaintenanceQueue.h>
Queue for periodic maintenance work.
Definition at line 55 of file MaintenanceQueue.h.
Hypertable::MaintenanceQueue::MaintenanceQueue |
( |
int |
worker_count | ) |
|
|
inline |
Constructor to set up the maintenance queue.
It creates a number of worker threads specified by the worker_count argument.
- Parameters
-
worker_count | number of worker threads to create |
Definition at line 233 of file MaintenanceQueue.h.
bool Hypertable::MaintenanceQueue::contains |
( |
Range * |
range | ) |
|
|
inline |
Returns true if queue contains a maintenance task for range
.
- Parameters
-
range | Pointer to Range object |
- Returns
- true if queue contains a maintenance task for
range
, false otherwise.
Definition at line 310 of file MaintenanceQueue.h.
template<typename _Function >
void Hypertable::MaintenanceQueue::drop_range_tasks |
( |
_Function |
__f | ) |
|
|
inline |
Drops range maintenance tasks from the queue.
- Template Parameters
-
_Function | Predicate function accepting Range * |
- Parameters
-
__f | Unary predicate function to determine which range tasks to drop |
Definition at line 286 of file MaintenanceQueue.h.
bool Hypertable::MaintenanceQueue::empty |
( |
| ) |
|
|
inline |
Returns true if maintenance queue is empty.
- Returns
- true if queue is empty, false otherwise
Definition at line 361 of file MaintenanceQueue.h.
bool Hypertable::MaintenanceQueue::full |
( |
| ) |
|
|
inline |
Returns true if any tasks are in queue or all worker threads are busy executing tasks.
- Returns
- true if queue is full, false otherwise
Definition at line 352 of file MaintenanceQueue.h.
int64_t Hypertable::MaintenanceQueue::generation |
( |
| ) |
|
|
inline |
Returns queue generation number.
When the queue is created, the generation number is initialized to zero. Each time a task is successfully excecuted and removed from the queue, the generation number is incremented by one.
- Returns
- Generation number
Definition at line 343 of file MaintenanceQueue.h.
void Hypertable::MaintenanceQueue::join |
( |
| ) |
|
|
inline |
Waits for a shutdown to complete.
This method returns when all maintenance queue threads exit.
Definition at line 254 of file MaintenanceQueue.h.
void Hypertable::MaintenanceQueue::shutdown |
( |
| ) |
|
|
inline |
Shuts down the maintenance queue.
All "in flight" requests are carried out and then all threads exit. join can be called to wait for completion of the shutdown.
Definition at line 246 of file MaintenanceQueue.h.
size_t Hypertable::MaintenanceQueue::size |
( |
| ) |
|
|
inline |
Returns the size of the queue.
The size is computed as the queue size plus the number of tasks in flight.
- Returns
- Size of queue
Definition at line 332 of file MaintenanceQueue.h.
void Hypertable::MaintenanceQueue::start |
( |
| ) |
|
|
inline |
void Hypertable::MaintenanceQueue::stop |
( |
| ) |
|
|
inline |
void Hypertable::MaintenanceQueue::wait_for_empty |
( |
| ) |
|
|
inline |
Waits for queue to become empty with deadline.
- Parameters
-
deadline | Return if queue not empty by this absolute time |
- Returns
- true if queue empty, false if deadline reached
Definition at line 378 of file MaintenanceQueue.h.
int Hypertable::MaintenanceQueue::worker_count |
( |
| ) |
|
|
inline |
Returns the number of worker threads configured for the queue.
- Returns
- Number of configured worker threads
Definition at line 387 of file MaintenanceQueue.h.
bool Hypertable::MaintenanceQueue::joined |
|
private |
int Hypertable::MaintenanceQueue::m_worker_count |
|
private |
condition_variable Hypertable::MaintenanceQueue::ms_cond |
|
staticprivate |
int Hypertable::MaintenanceQueue::ms_pause = 0 |
|
staticprivate |
The documentation for this class was generated from the following files: