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

Obtains location string (proxy name) for the range server. More...

#include <LocationInitializer.h>

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

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

Detailed Description

Obtains location string (proxy name) for the range server.

Definition at line 51 of file LocationInitializer.h.

Constructor & Destructor Documentation

LocationInitializer::LocationInitializer ( std::shared_ptr< Context > &  context)

Constructor.

Parameters
contextRange server context

Definition at line 53 of file LocationInitializer.cc.

Member Function Documentation

CommBuf * LocationInitializer::create_initialization_request ( )
overridevirtual

Creates a connection initialization message.

Returns
Initialization message (freed by caller)

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.

uint64_t Hypertable::LocationInitializer::initialization_command ( )
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.

Returns
Initialization command code

Implements Hypertable::ConnectionInitializer.

Definition at line 65 of file LocationInitializer.h.

bool LocationInitializer::is_removed ( const String path,
Hyperspace::SessionPtr hyperspace 
)
virtual

Checks if "removed" attribute is set on Hyperspace location file.

Definition at line 87 of file LocationInitializer.cc.

bool LocationInitializer::process_initialization_response ( Event event)
overridevirtual

Process response to initialization message.

Parameters
eventPointer to event object holding response message
Returns
true on success, false on failure

Implements Hypertable::ConnectionInitializer.

Definition at line 140 of file LocationInitializer.cc.

void Hypertable::LocationInitializer::set_lock_held ( )
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.

Member Data Documentation

std::condition_variable Hypertable::LocationInitializer::m_cond
private

Condition variable signalling completion of initialization handshake.

Definition at line 85 of file LocationInitializer.h.

std::shared_ptr<Context> Hypertable::LocationInitializer::m_context
private

Range server context

Definition at line 79 of file LocationInitializer.h.

bool Hypertable::LocationInitializer::m_handshake_complete {}
private

Flag indicating completion of initialization handshake.

Definition at line 97 of file LocationInitializer.h.

String Hypertable::LocationInitializer::m_location
private

Assigned location (proxy name)

Definition at line 88 of file LocationInitializer.h.

String Hypertable::LocationInitializer::m_location_file
private

Local pathname to location file.

Definition at line 91 of file LocationInitializer.h.

bool Hypertable::LocationInitializer::m_location_persisted {}
private

Flag indicating if assigned location has been written to location file.

Definition at line 94 of file LocationInitializer.h.

bool Hypertable::LocationInitializer::m_lock_held {}
private

Flag indicating that Hyperspace lock on location file is held.

Definition at line 100 of file LocationInitializer.h.

std::mutex Hypertable::LocationInitializer::m_mutex
private

Mutex for serializing concurrent access.

Definition at line 82 of file LocationInitializer.h.


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