Obtains location string (proxy name) for the range server. More...
#include <LocationInitializer.h>
Public Member Functions | |
LocationInitializer (std::shared_ptr< Context > &context) | |
Constructor. More... | |
virtual bool | is_removed (const String &path, Hyperspace::SessionPtr &hyperspace) |
Checks if "removed" attribute is set on Hyperspace location file. More... | |
CommBuf * | create_initialization_request () override |
Creates a connection initialization message. More... | |
bool | process_initialization_response (Event *event) override |
Process response to initialization message. More... | |
uint64_t | initialization_command () override |
Command code (see CommHeader::command) for initialization response message. More... | |
String | get () |
Gets assigned location (proxy name) More... | |
void | wait_for_handshake () |
Waits for completion of initialization handshake. More... | |
void | set_lock_held () |
Signals that Hyperspace lock on location file is held. More... | |
Private Attributes | |
std::shared_ptr< Context > | m_context |
Range server context More... | |
std::mutex | m_mutex |
Mutex for serializing concurrent access. More... | |
std::condition_variable | m_cond |
Condition variable signalling completion of initialization handshake. More... | |
String | m_location |
Assigned location (proxy name) More... | |
String | m_location_file |
Local pathname to location file. More... | |
bool | m_location_persisted {} |
Flag indicating if assigned location has been written to location file. More... | |
bool | m_handshake_complete {} |
Flag indicating completion of initialization handshake. More... | |
bool | m_lock_held {} |
Flag indicating that Hyperspace lock on location file is held. More... | |
Obtains location string (proxy name) for the range server.
Definition at line 51 of file LocationInitializer.h.
LocationInitializer::LocationInitializer | ( | std::shared_ptr< Context > & | context | ) |
Constructor.
context | Range server context |
Definition at line 53 of file LocationInitializer.cc.
|
overridevirtual |
Creates a connection initialization message.
Implements Hypertable::ConnectionInitializer.
Definition at line 107 of file LocationInitializer.cc.
String LocationInitializer::get | ( | ) |
Gets assigned location (proxy name)
Definition at line 184 of file LocationInitializer.cc.
|
inlineoverridevirtual |
Command code (see CommHeader::command) for initialization response message.
This method is used by the ConnectionManager to determine if a received message is part of the initialization handshake.
Implements Hypertable::ConnectionInitializer.
Definition at line 65 of file LocationInitializer.h.
|
virtual |
Checks if "removed" attribute is set on Hyperspace location file.
Definition at line 87 of file LocationInitializer.cc.
|
overridevirtual |
Process response to initialization message.
event | Pointer to event object holding response message |
Implements Hypertable::ConnectionInitializer.
Definition at line 140 of file LocationInitializer.cc.
|
inline |
Signals that Hyperspace lock on location file is held.
Definition at line 74 of file LocationInitializer.h.
void LocationInitializer::wait_for_handshake | ( | ) |
Waits for completion of initialization handshake.
Definition at line 189 of file LocationInitializer.cc.
|
private |
Condition variable signalling completion of initialization handshake.
Definition at line 85 of file LocationInitializer.h.
|
private |
Range server context
Definition at line 79 of file LocationInitializer.h.
|
private |
Flag indicating completion of initialization handshake.
Definition at line 97 of file LocationInitializer.h.
|
private |
Assigned location (proxy name)
Definition at line 88 of file LocationInitializer.h.
|
private |
Local pathname to location file.
Definition at line 91 of file LocationInitializer.h.
|
private |
Flag indicating if assigned location has been written to location file.
Definition at line 94 of file LocationInitializer.h.
|
private |
Flag indicating that Hyperspace lock on location file is held.
Definition at line 100 of file LocationInitializer.h.
|
private |
Mutex for serializing concurrent access.
Definition at line 82 of file LocationInitializer.h.