Execution context for the Master. More...
#include <Context.h>
Classes | |
class | RecoveryState |
Public Member Functions | |
Context (PropertiesPtr &p, Hyperspace::SessionPtr hs) | |
Context. More... | |
Context (PropertiesPtr &p) | |
~Context () | |
Destructor. More... | |
bool | set_startup_status (bool status) |
Set startup flag to false. More... | |
bool | startup_in_progress () |
Gets flag indicating if server is starting up. More... | |
void | start_shutdown () |
Start shutdown sequence. More... | |
bool | shutdown_in_progress () |
Gets flag indicating if server is shutting down. More... | |
bool | add_move_operation (std::shared_ptr< Operation > operation) |
Adds operation to active move range operation map. More... | |
void | remove_move_operation (std::shared_ptr< Operation > operation) |
Removes operation from active move range operation map. More... | |
std::shared_ptr< Operation > | get_move_operation (int64_t hash_code) |
Gets operation from active move range operation map. More... | |
void | add_available_server (const String &location) |
void | remove_available_server (const String &location) |
size_t | available_server_count () |
void | get_available_servers (StringSet &servers) |
bool | can_accept_ranges (const RangeServerStatistics &stats) |
void | replay_status (EventPtr &event) |
void | replay_complete (EventPtr &event) |
void | prepare_complete (EventPtr &event) |
void | commit_complete (EventPtr &event) |
void | notification_hook (const String &subject, const String &message) |
Invoke notification hook. More... | |
void | set_balance_plan_authority (MetaLog::EntityPtr bpa) |
Sets the BalancePlanAuthority. More... | |
BalancePlanAuthority * | get_balance_plan_authority () |
void | get_balance_plan_authority (MetaLog::EntityPtr &entity) |
RecoveryState & | recovery_state () |
TablePtr | new_table (const std::string &name) |
Private Attributes | |
RecoveryState | m_recovery_state |
MetaLog::EntityPtr | m_balance_plan_authority {} |
BalancePlanAuthority entity. More... | |
std::mutex | m_outstanding_move_ops_mutex |
Mutex for serializing access to m_outstanding_move_ops More... | |
std::unordered_map< int64_t, int64_t > | m_outstanding_move_ops |
Map of outstanding move range operations. More... | |
bool | m_startup {true} |
Flag indicating that server is starting up. More... | |
bool | m_shutdown {} |
Flag indicating that server is shutting down. More... | |
Execution context for the Master.
Holds references to commonly needed services and data structures.
Context::Context | ( | PropertiesPtr & | p, |
Hyperspace::SessionPtr | hs | ||
) |
p | Reference to properties object |
hs | Hyperspace session |
Definition at line 57 of file Context.cc.
|
inline |
Context::~Context | ( | ) |
Destructor.
Definition at line 109 of file Context.cc.
void Context::add_available_server | ( | const String & | location | ) |
Definition at line 392 of file Context.cc.
bool Context::add_move_operation | ( | std::shared_ptr< Operation > | operation | ) |
Adds operation to active move range operation map.
This method adds a mapping for operation
to the m_outstanding_move_ops map. This map holds references to outstanding OperationMoveRange operations, mapping the operation's hash_code to it's ID. The actual reference to the operation is held in reference_manager and the m_outstanding_move_ops map is used to map the operation's hash code to it's ID which is used as the key to reference_manager. This map is used to prevent multiple OperationMoveRange operations to get created for the same range.
operation | Move range operation to add to map |
Definition at line 364 of file Context.cc.
size_t Context::available_server_count | ( | ) |
Definition at line 402 of file Context.cc.
bool Context::can_accept_ranges | ( | const RangeServerStatistics & | stats | ) |
Definition at line 413 of file Context.cc.
void Context::commit_complete | ( | EventPtr & | event | ) |
Definition at line 323 of file Context.cc.
void Context::get_available_servers | ( | StringSet & | servers | ) |
Definition at line 407 of file Context.cc.
BalancePlanAuthority * Context::get_balance_plan_authority | ( | ) |
Definition at line 183 of file Context.cc.
void Context::get_balance_plan_authority | ( | MetaLog::EntityPtr & | entity | ) |
Definition at line 190 of file Context.cc.
OperationPtr Context::get_move_operation | ( | int64_t | hash_code | ) |
Gets operation from active move range operation map.
Gets operation corresponding with hash_code
by consulting m_outstanding_move_ops to determine the operation ID of the outstanding move range operation and fetching it from reference_manager.
hash_code | Hash code of move range operation to get. |
hash_code
, or nullptr if no mapping exists. Definition at line 381 of file Context.cc.
TablePtr Context::new_table | ( | const std::string & | name | ) |
Definition at line 197 of file Context.cc.
Invoke notification hook.
Definition at line 156 of file Context.cc.
void Context::prepare_complete | ( | EventPtr & | event | ) |
Definition at line 282 of file Context.cc.
|
inline |
void Context::remove_available_server | ( | const String & | location | ) |
Definition at line 397 of file Context.cc.
void Context::remove_move_operation | ( | std::shared_ptr< Operation > | operation | ) |
Removes operation from active move range operation map.
Removes entry from m_outstanding_move_ops map correspoding to operation
.
operation | Move range operation to remove from map |
Definition at line 373 of file Context.cc.
void Context::replay_complete | ( | EventPtr & | event | ) |
Definition at line 240 of file Context.cc.
void Context::replay_status | ( | EventPtr & | event | ) |
Definition at line 205 of file Context.cc.
void Context::set_balance_plan_authority | ( | MetaLog::EntityPtr | bpa | ) |
Sets the BalancePlanAuthority.
Definition at line 177 of file Context.cc.
bool Context::set_startup_status | ( | bool | status | ) |
Set startup flag to false.
Definition at line 116 of file Context.cc.
bool Context::shutdown_in_progress | ( | ) |
Gets flag indicating if server is shutting down.
Definition at line 149 of file Context.cc.
void Context::start_shutdown | ( | ) |
Start shutdown sequence.
Definition at line 130 of file Context.cc.
bool Context::startup_in_progress | ( | ) |
Gets flag indicating if server is starting up.
Definition at line 126 of file Context.cc.
ApplicationQueuePtr Hypertable::Context::app_queue |
LoadBalancer* Hypertable::Context::balancer {} |
ConnectionManagerPtr Hypertable::Context::conn_manager |
FilesystemPtr Hypertable::Context::dfs |
int32_t Hypertable::Context::disk_threshold {} |
Hyperspace::SessionPtr Hypertable::Context::hyperspace |
TableInfoMapPtr Hypertable::Context::live_map |
|
private |
BalancePlanAuthority entity.
|
private |
|
private |
Mutex for serializing access to m_outstanding_move_ops
|
private |
|
private |
|
private |
std::unique_ptr<HyperspaceMasterFile> Hypertable::Context::master_file |
MetricsHandlerPtr Hypertable::Context::metrics_handler |
MetaLog::DefinitionPtr Hypertable::Context::mml_definition |
MetaLog::WriterPtr Hypertable::Context::mml_writer |
MonitoringPtr Hypertable::Context::monitoring |
NameIdMapperPtr Hypertable::Context::namemap |
std::unique_ptr<OperationProcessor> Hypertable::Context::op |
PropertiesPtr Hypertable::Context::props |
RangeLocatorPtr Hypertable::Context::range_locator |
RecoveredServersPtr Hypertable::Context::recovered_servers |
std::shared_ptr<OperationTimedBarrier> Hypertable::Context::recovery_barrier_op |
std::unique_ptr<ReferenceManager> Hypertable::Context::reference_manager |
std::unique_ptr<ResponseManager> Hypertable::Context::response_manager |
std::unique_ptr<Thread> Hypertable::Context::response_manager_thread |
RangeServerConnectionManagerPtr Hypertable::Context::rsc_manager |
std::shared_ptr<ServerState> Hypertable::Context::server_state |
SystemStatePtr Hypertable::Context::system_state |