0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Public Attributes | Private Attributes | List of all members
Hypertable::Context Class Reference

Execution context for the Master. More...

#include <Context.h>

Inheritance diagram for Hypertable::Context:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::Context:
Collaboration graph
[legend]

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< Operationget_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...
 
BalancePlanAuthorityget_balance_plan_authority ()
 
void get_balance_plan_authority (MetaLog::EntityPtr &entity)
 
RecoveryStaterecovery_state ()
 
TablePtr new_table (const std::string &name)
 

Public Attributes

std::mutex mutex
 
std::condition_variable cond
 
Commcomm {}
 Comm layer. More...
 
SystemStatePtr system_state
 System state entity. More...
 
RangeServerConnectionManagerPtr rsc_manager
 
StringSet available_servers
 
PropertiesPtr props
 Configuration properties. More...
 
ConnectionManagerPtr conn_manager
 
MetricsHandlerPtr metrics_handler
 
Hyperspace::SessionPtr hyperspace
 
ApplicationQueuePtr app_queue
 
RangeLocatorPtr range_locator
 
String toplevel_dir
 
NameIdMapperPtr namemap
 
std::unique_ptr
< HyperspaceMasterFile
master_file
 Hyperspace master file handle More...
 
LoadBalancerbalancer {}
 
MonitoringPtr monitoring
 
RecoveredServersPtr recovered_servers
 
std::unique_ptr< ReferenceManagerreference_manager
 
std::unique_ptr< Threadresponse_manager_thread
 
std::unique_ptr< ResponseManagerresponse_manager
 
MetaLog::WriterPtr mml_writer
 
MetaLog::DefinitionPtr mml_definition
 
FilesystemPtr dfs
 
TablePtr metadata_table
 
TablePtr rs_metrics_table
 
time_t request_timeout {}
 
uint32_t timer_interval {}
 
uint32_t monitoring_interval {}
 
uint32_t gc_interval {}
 
time_t next_monitoring_time {}
 
time_t next_gc_time {}
 
std::unique_ptr
< OperationProcessor
op
 
std::shared_ptr
< OperationTimedBarrier
recovery_barrier_op
 
String cluster_name
 Name of cluster. More...
 
String location_hash
 
int32_t disk_threshold {}
 Disk use threshold percentage. More...
 
int32_t max_allowable_skew {}
 
bool test_mode {}
 
bool quorum_reached {}
 
std::shared_ptr< ServerStateserver_state
 Server state. More...
 
TableInfoMapPtr live_map
 Live table info map. More...
 

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...
 

Detailed Description

Execution context for the Master.

Holds references to commonly needed services and data structures.

Definition at line 85 of file Context.h.

Constructor & Destructor Documentation

Context::Context ( PropertiesPtr p,
Hyperspace::SessionPtr  hs 
)

Context.

Parameters
pReference to properties object
hsHyperspace session

Definition at line 57 of file Context.cc.

Hypertable::Context::Context ( PropertiesPtr p)
inline

Definition at line 120 of file Context.h.

Context::~Context ( )

Destructor.

Definition at line 109 of file Context.cc.

Member Function Documentation

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.

Parameters
operationMove range operation to add to map
Returns
true if operation was successfully added to map, false if operation was not added to the map because an entry already exists in the map for the same operation hash code

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.

Parameters
hash_codeHash code of move range operation to get.
Returns
Pointer to outstanding move range operation corresponding with hash_code, or nullptr if no mapping exists.
See also
add_move_operation().

Definition at line 381 of file Context.cc.

TablePtr Context::new_table ( const std::string &  name)

Definition at line 197 of file Context.cc.

void Context::notification_hook ( const String subject,
const String message 
)

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.

RecoveryState& Hypertable::Context::recovery_state ( )
inline

Definition at line 239 of file Context.h.

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.

Parameters
operationMove range operation to remove from map
See also
add_move_operation().

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.

Returns
false if shutdown was received prior to completion of startup, true otherwise.

Definition at line 116 of file Context.cc.

bool Context::shutdown_in_progress ( )

Gets flag indicating if server is shutting down.

Returns
true if server is shutting down, false otherwise

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.

Returns
true if server is starting up, false otherwise

Definition at line 126 of file Context.cc.

Member Data Documentation

ApplicationQueuePtr Hypertable::Context::app_queue

Definition at line 151 of file Context.h.

StringSet Hypertable::Context::available_servers

Definition at line 146 of file Context.h.

LoadBalancer* Hypertable::Context::balancer {}

Definition at line 157 of file Context.h.

String Hypertable::Context::cluster_name

Name of cluster.

Definition at line 176 of file Context.h.

Comm * Hypertable::Context::comm {}

Comm layer.

Definition at line 143 of file Context.h.

std::condition_variable Hypertable::Context::cond

Definition at line 142 of file Context.h.

ConnectionManagerPtr Hypertable::Context::conn_manager

Definition at line 148 of file Context.h.

FilesystemPtr Hypertable::Context::dfs

Definition at line 165 of file Context.h.

int32_t Hypertable::Context::disk_threshold {}

Disk use threshold percentage.

Definition at line 178 of file Context.h.

uint32_t Hypertable::Context::gc_interval {}

Definition at line 171 of file Context.h.

Hyperspace::SessionPtr Hypertable::Context::hyperspace

Definition at line 150 of file Context.h.

TableInfoMapPtr Hypertable::Context::live_map

Live table info map.

Definition at line 54 of file Context.h.

String Hypertable::Context::location_hash

Definition at line 177 of file Context.h.

MetaLog::EntityPtr Hypertable::Context::m_balance_plan_authority {}
private

BalancePlanAuthority entity.

Definition at line 249 of file Context.h.

std::unordered_map<int64_t, int64_t> Hypertable::Context::m_outstanding_move_ops
private

Map of outstanding move range operations.

Definition at line 255 of file Context.h.

std::mutex Hypertable::Context::m_outstanding_move_ops_mutex
private

Mutex for serializing access to m_outstanding_move_ops

Definition at line 252 of file Context.h.

RecoveryState Hypertable::Context::m_recovery_state
private

Definition at line 246 of file Context.h.

bool Hypertable::Context::m_shutdown {}
private

Flag indicating that server is shutting down.

Definition at line 261 of file Context.h.

bool Hypertable::Context::m_startup {true}
private

Flag indicating that server is starting up.

Definition at line 258 of file Context.h.

std::unique_ptr<HyperspaceMasterFile> Hypertable::Context::master_file

Hyperspace master file handle

Definition at line 156 of file Context.h.

int32_t Hypertable::Context::max_allowable_skew {}

Definition at line 179 of file Context.h.

TablePtr Hypertable::Context::metadata_table

Definition at line 166 of file Context.h.

MetricsHandlerPtr Hypertable::Context::metrics_handler

Definition at line 149 of file Context.h.

MetaLog::DefinitionPtr Hypertable::Context::mml_definition

Definition at line 164 of file Context.h.

MetaLog::WriterPtr Hypertable::Context::mml_writer

Definition at line 163 of file Context.h.

MonitoringPtr Hypertable::Context::monitoring

Definition at line 158 of file Context.h.

uint32_t Hypertable::Context::monitoring_interval {}

Definition at line 170 of file Context.h.

std::mutex Hypertable::Context::mutex

Definition at line 141 of file Context.h.

NameIdMapperPtr Hypertable::Context::namemap

Definition at line 154 of file Context.h.

time_t Hypertable::Context::next_gc_time {}

Definition at line 173 of file Context.h.

time_t Hypertable::Context::next_monitoring_time {}

Definition at line 172 of file Context.h.

std::unique_ptr<OperationProcessor> Hypertable::Context::op

Definition at line 174 of file Context.h.

PropertiesPtr Hypertable::Context::props

Configuration properties.

Definition at line 147 of file Context.h.

bool Hypertable::Context::quorum_reached {}

Definition at line 181 of file Context.h.

RangeLocatorPtr Hypertable::Context::range_locator

Definition at line 152 of file Context.h.

RecoveredServersPtr Hypertable::Context::recovered_servers

Definition at line 159 of file Context.h.

std::shared_ptr<OperationTimedBarrier> Hypertable::Context::recovery_barrier_op

Definition at line 175 of file Context.h.

std::unique_ptr<ReferenceManager> Hypertable::Context::reference_manager

Definition at line 160 of file Context.h.

time_t Hypertable::Context::request_timeout {}

Definition at line 168 of file Context.h.

std::unique_ptr<ResponseManager> Hypertable::Context::response_manager

Definition at line 162 of file Context.h.

std::unique_ptr<Thread> Hypertable::Context::response_manager_thread

Definition at line 161 of file Context.h.

TablePtr Hypertable::Context::rs_metrics_table

Definition at line 167 of file Context.h.

RangeServerConnectionManagerPtr Hypertable::Context::rsc_manager

Definition at line 145 of file Context.h.

std::shared_ptr<ServerState> Hypertable::Context::server_state

Server state.

Definition at line 52 of file Context.h.

SystemStatePtr Hypertable::Context::system_state

System state entity.

Definition at line 144 of file Context.h.

bool Hypertable::Context::test_mode {}

Definition at line 180 of file Context.h.

uint32_t Hypertable::Context::timer_interval {}

Definition at line 169 of file Context.h.

String Hypertable::Context::toplevel_dir

Definition at line 153 of file Context.h.


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