Blocks requests until specific commit log has finished replaying. More...
#include <LogReplayBarrier.h>
Public Member Functions | |
void | set_root_complete () |
Signals ROOT commit log replay has been completed. More... | |
void | set_metadata_complete () |
Signals METADATA commit log replay has been completed. More... | |
void | set_system_complete () |
Signals SYSTEM commit log replay has been completed. More... | |
void | set_user_complete () |
Signals USER commit log replay has been completed. More... | |
bool | wait_for_root (ClockT::time_point deadline) |
Waits for ROOT commit log replay to complete. More... | |
bool | wait_for_metadata (ClockT::time_point deadline) |
Waits for METADATA commit log replay to complete. More... | |
bool | wait_for_system (ClockT::time_point deadline) |
Waits for SYSTEM commit log replay to complete. More... | |
bool | wait_for_user (ClockT::time_point deadline) |
Waits for USER commit log replay to complete. More... | |
bool | wait (ClockT::time_point deadline, const TableIdentifier &table, const RangeSpec &range) |
Waits for commit log replay to complete for range class defined by a given range. More... | |
bool | wait (ClockT::time_point deadline, const TableIdentifier &table) |
Waits for commit log replay to complete for log class defined by a given table. More... | |
bool | user_complete () |
Checks if replay of USER commit log is complete. More... | |
Private Attributes | |
std::mutex | m_mutex |
Mutex to serialize concurrent access. More... | |
std::condition_variable | m_root_complete_cond |
Condition variable used to signal ROOT commit log replay complete. More... | |
std::condition_variable | m_metadata_complete_cond |
Condition variable used to signal METADATA commit log replay complete. More... | |
std::condition_variable | m_system_complete_cond |
Condition variable used to signal SYSTEM commit log replay complete. More... | |
std::condition_variable | m_user_complete_cond |
Condition variable used to signal USER commit log replay complete. More... | |
bool | m_root_complete {} |
Flag indicating if ROOT commit log replay is complete. More... | |
bool | m_metadata_complete {} |
Flag indicating if METADATA commit log replay is complete. More... | |
bool | m_system_complete {} |
Flag indicating if SYSTEM commit log replay is complete. More... | |
bool | m_user_complete {} |
Flag indicating if USER commit log replay is complete. More... | |
Blocks requests until specific commit log has finished replaying.
Many operations require a certain class of ranges to be online before they can proceed. All ranges belong to one of the four following classes:
When the RangeServer starts up, all of the ranges in a given class are brought online at the same time. Each range class has an associated commit log and once the commit log has been replayed, the ranges are "flipped live". This class provides a mechanism for operations to block until commit log replay for dependent ranges is complete (and are therefore live). The range classes are flipped live (i.e. finished log replay) in the order in which they're listed above.
Definition at line 59 of file LogReplayBarrier.h.
void LogReplayBarrier::set_metadata_complete | ( | ) |
Signals METADATA commit log replay has been completed.
Sets m_metadata_complete to true and signals m_metadata_complete_cond
Definition at line 36 of file LogReplayBarrier.cc.
void LogReplayBarrier::set_root_complete | ( | ) |
Signals ROOT commit log replay has been completed.
Sets m_root_complete to true and signals m_root_complete_cond
Definition at line 30 of file LogReplayBarrier.cc.
void LogReplayBarrier::set_system_complete | ( | ) |
Signals SYSTEM commit log replay has been completed.
Sets m_system_complete to true and signals m_system_complete_cond
Definition at line 42 of file LogReplayBarrier.cc.
void LogReplayBarrier::set_user_complete | ( | ) |
Signals USER commit log replay has been completed.
Sets m_user_complete to true and signals m_user_complete_cond
Definition at line 48 of file LogReplayBarrier.cc.
bool LogReplayBarrier::user_complete | ( | ) |
Checks if replay of USER commit log is complete.
Definition at line 119 of file LogReplayBarrier.cc.
bool LogReplayBarrier::wait | ( | ClockT::time_point | deadline, |
const TableIdentifier & | table, | ||
const RangeSpec & | range | ||
) |
Waits for commit log replay to complete for range class defined by a given range.
This member function will perform a timed wait on the condition variable for the range class to which the given range belongs, defined by table
and range
. deadline
is passed in as the timeout value.
deadline | Absolute time representing wait deadline |
table | Table identifier |
range | Range specification |
deadline
, false if deadline
reached before USER commit log replay completed. Definition at line 91 of file LogReplayBarrier.cc.
bool LogReplayBarrier::wait | ( | ClockT::time_point | deadline, |
const TableIdentifier & | table | ||
) |
Waits for commit log replay to complete for log class defined by a given table.
This member function will perform a timed wait on the condition variable for the log class to which the given table belongs. deadline
is passed in as the timeout value.
deadline | Absolute time representing wait deadline |
table | Table identifier |
deadline
, false if deadline
reached before USER commit log replay completed. Definition at line 108 of file LogReplayBarrier.cc.
bool LogReplayBarrier::wait_for_metadata | ( | ClockT::time_point | deadline | ) |
Waits for METADATA commit log replay to complete.
Performs a timed wait on m_metadata_complete_cond with deadline
passed in as the timeout value.
deadline | Absolute time representing wait deadline |
deadline
, false if deadline
reached before METADATA commit log replay completed. Definition at line 63 of file LogReplayBarrier.cc.
bool LogReplayBarrier::wait_for_root | ( | ClockT::time_point | deadline | ) |
Waits for ROOT commit log replay to complete.
Performs a timed wait on m_root_complete_cond with deadline
passed in as the timeout value.
deadline | Absolute time representing wait deadline |
deadline
, false if deadline
reached before ROOT commit log replay completed. Definition at line 54 of file LogReplayBarrier.cc.
bool LogReplayBarrier::wait_for_system | ( | ClockT::time_point | deadline | ) |
Waits for SYSTEM commit log replay to complete.
Performs a timed wait on m_system_complete_cond with deadline
passed in as the timeout value.
deadline | Absolute time representing wait deadline |
deadline
, false if deadline
reached before SYSTEM commit log replay completed. Definition at line 72 of file LogReplayBarrier.cc.
bool LogReplayBarrier::wait_for_user | ( | ClockT::time_point | deadline | ) |
Waits for USER commit log replay to complete.
Performs a timed wait on m_user_complete_cond with deadline
passed in as the timeout value.
deadline | Absolute time representing wait deadline |
deadline
, false if deadline
reached before USER commit log replay completed. Definition at line 81 of file LogReplayBarrier.cc.
|
private |
Flag indicating if METADATA commit log replay is complete.
Definition at line 163 of file LogReplayBarrier.h.
|
private |
Condition variable used to signal METADATA commit log replay complete.
Definition at line 155 of file LogReplayBarrier.h.
|
private |
Mutex to serialize concurrent access.
Definition at line 151 of file LogReplayBarrier.h.
|
private |
Flag indicating if ROOT commit log replay is complete.
Definition at line 161 of file LogReplayBarrier.h.
|
private |
Condition variable used to signal ROOT commit log replay complete.
Definition at line 153 of file LogReplayBarrier.h.
|
private |
Flag indicating if SYSTEM commit log replay is complete.
Definition at line 165 of file LogReplayBarrier.h.
|
private |
Condition variable used to signal SYSTEM commit log replay complete.
Definition at line 157 of file LogReplayBarrier.h.
|
private |
Flag indicating if USER commit log replay is complete.
Definition at line 167 of file LogReplayBarrier.h.
|
private |
Condition variable used to signal USER commit log replay complete.
Definition at line 159 of file LogReplayBarrier.h.