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

#include <ClientKeepaliveHandler.h>

Inheritance diagram for Hyperspace::ClientKeepaliveHandler:
Inheritance graph
[legend]
Collaboration diagram for Hyperspace::ClientKeepaliveHandler:
Collaboration graph
[legend]

Public Member Functions

 ClientKeepaliveHandler (Comm *, PropertiesPtr &, Session *)
 
void start ()
 
virtual void handle (Hypertable::EventPtr &event)
 Callback method. More...
 
void register_handle (ClientHandleStatePtr &handle_state)
 
void unregister_handle (uint64_t handle)
 
bool get_handle_state (uint64_t handle, ClientHandleStatePtr &handle_state)
 
uint64_t get_session_id ()
 
void expire_session ()
 
void destroy_session ()
 
void wait_for_destroy_session ()
 
- Public Member Functions inherited from Hypertable::DispatchHandler
virtual ~DispatchHandler ()
 Destructor. More...
 

Private Types

typedef std::unordered_map
< uint64_t,
ClientHandleStatePtr
HandleMap
 
typedef std::unordered_map
< uint64_t,
std::chrono::steady_clock::time_point > 
BadNotificationHandleMap
 

Private Member Functions

void destroy ()
 

Private Attributes

std::recursive_mutex m_mutex
 
std::chrono::steady_clock::time_point m_last_keep_alive_send_time
 
std::chrono::steady_clock::time_point m_jeopardy_time
 
bool m_dead {}
 
bool m_destroying {}
 
std::condition_variable_any m_cond_destroyed
 
Commm_comm {}
 
uint32_t m_lease_interval {}
 
uint32_t m_keep_alive_interval {}
 
sockaddr_in m_master_addr
 
CommAddress m_local_addr
 
bool m_verbose {}
 
Sessionm_session {}
 
uint64_t m_session_id {}
 
ClientConnectionHandlerPtr m_conn_handler
 
std::set< uint64_t > m_delivered_events
 
HandleMap m_handle_map
 
BadNotificationHandleMap m_bad_handle_map
 
bool m_reconnect {}
 
uint16_t m_hyperspace_port {}
 
uint16_t m_datagram_send_port {}
 
std::vector< Stringm_hyperspace_replicas
 

Static Private Attributes

static const uint64_t ms_bad_notification_grace_period = 120000
 

Detailed Description

Definition at line 50 of file ClientKeepaliveHandler.h.

Member Typedef Documentation

typedef std::unordered_map<uint64_t, std::chrono::steady_clock::time_point> Hyperspace::ClientKeepaliveHandler::BadNotificationHandleMap
private

Definition at line 110 of file ClientKeepaliveHandler.h.

typedef std::unordered_map<uint64_t, ClientHandleStatePtr> Hyperspace::ClientKeepaliveHandler::HandleMap
private

Definition at line 108 of file ClientKeepaliveHandler.h.

Constructor & Destructor Documentation

ClientKeepaliveHandler::ClientKeepaliveHandler ( Comm comm,
PropertiesPtr cfg,
Session session 
)

Definition at line 42 of file ClientKeepaliveHandler.cc.

Member Function Documentation

void ClientKeepaliveHandler::destroy ( )
private

Definition at line 477 of file ClientKeepaliveHandler.cc.

void ClientKeepaliveHandler::destroy_session ( )

Definition at line 444 of file ClientKeepaliveHandler.cc.

void ClientKeepaliveHandler::expire_session ( )

Definition at line 405 of file ClientKeepaliveHandler.cc.

bool Hyperspace::ClientKeepaliveHandler::get_handle_state ( uint64_t  handle,
ClientHandleStatePtr handle_state 
)
inline

Definition at line 73 of file ClientKeepaliveHandler.h.

uint64_t Hyperspace::ClientKeepaliveHandler::get_session_id ( )
inline

Definition at line 82 of file ClientKeepaliveHandler.h.

void ClientKeepaliveHandler::handle ( Hypertable::EventPtr event_ptr)
virtual

Callback method.

When the Comm layer needs to deliver an event to the application, this method is called to do so. The set of event types include, CONNECTION_ESTABLISHED, DISCONNECT, MESSAGE, ERROR, and TIMER.

Parameters
event_ptrsmart pointer to Event object

Implements Hypertable::DispatchHandler.

Definition at line 97 of file ClientKeepaliveHandler.cc.

void Hyperspace::ClientKeepaliveHandler::register_handle ( ClientHandleStatePtr handle_state)
inline

Definition at line 59 of file ClientKeepaliveHandler.h.

void ClientKeepaliveHandler::start ( )

Definition at line 72 of file ClientKeepaliveHandler.cc.

void Hyperspace::ClientKeepaliveHandler::unregister_handle ( uint64_t  handle)
inline

Definition at line 68 of file ClientKeepaliveHandler.h.

void ClientKeepaliveHandler::wait_for_destroy_session ( )

Definition at line 467 of file ClientKeepaliveHandler.cc.

Member Data Documentation

BadNotificationHandleMap Hyperspace::ClientKeepaliveHandler::m_bad_handle_map
private

Definition at line 111 of file ClientKeepaliveHandler.h.

Comm* Hyperspace::ClientKeepaliveHandler::m_comm {}
private

Definition at line 98 of file ClientKeepaliveHandler.h.

std::condition_variable_any Hyperspace::ClientKeepaliveHandler::m_cond_destroyed
private

Definition at line 97 of file ClientKeepaliveHandler.h.

ClientConnectionHandlerPtr Hyperspace::ClientKeepaliveHandler::m_conn_handler
private

Definition at line 106 of file ClientKeepaliveHandler.h.

uint16_t Hyperspace::ClientKeepaliveHandler::m_datagram_send_port {}
private

Definition at line 115 of file ClientKeepaliveHandler.h.

bool Hyperspace::ClientKeepaliveHandler::m_dead {}
private

Definition at line 95 of file ClientKeepaliveHandler.h.

std::set<uint64_t> Hyperspace::ClientKeepaliveHandler::m_delivered_events
private

Definition at line 107 of file ClientKeepaliveHandler.h.

bool Hyperspace::ClientKeepaliveHandler::m_destroying {}
private

Definition at line 96 of file ClientKeepaliveHandler.h.

HandleMap Hyperspace::ClientKeepaliveHandler::m_handle_map
private

Definition at line 109 of file ClientKeepaliveHandler.h.

uint16_t Hyperspace::ClientKeepaliveHandler::m_hyperspace_port {}
private

Definition at line 114 of file ClientKeepaliveHandler.h.

std::vector<String> Hyperspace::ClientKeepaliveHandler::m_hyperspace_replicas
private

Definition at line 116 of file ClientKeepaliveHandler.h.

std::chrono::steady_clock::time_point Hyperspace::ClientKeepaliveHandler::m_jeopardy_time
private

Definition at line 94 of file ClientKeepaliveHandler.h.

uint32_t Hyperspace::ClientKeepaliveHandler::m_keep_alive_interval {}
private

Definition at line 100 of file ClientKeepaliveHandler.h.

std::chrono::steady_clock::time_point Hyperspace::ClientKeepaliveHandler::m_last_keep_alive_send_time
private

Definition at line 93 of file ClientKeepaliveHandler.h.

uint32_t Hyperspace::ClientKeepaliveHandler::m_lease_interval {}
private

Definition at line 99 of file ClientKeepaliveHandler.h.

CommAddress Hyperspace::ClientKeepaliveHandler::m_local_addr
private

Definition at line 102 of file ClientKeepaliveHandler.h.

sockaddr_in Hyperspace::ClientKeepaliveHandler::m_master_addr
private

Definition at line 101 of file ClientKeepaliveHandler.h.

std::recursive_mutex Hyperspace::ClientKeepaliveHandler::m_mutex
private

Definition at line 92 of file ClientKeepaliveHandler.h.

bool Hyperspace::ClientKeepaliveHandler::m_reconnect {}
private

Definition at line 113 of file ClientKeepaliveHandler.h.

Session* Hyperspace::ClientKeepaliveHandler::m_session {}
private

Definition at line 104 of file ClientKeepaliveHandler.h.

uint64_t Hyperspace::ClientKeepaliveHandler::m_session_id {}
private

Definition at line 105 of file ClientKeepaliveHandler.h.

bool Hyperspace::ClientKeepaliveHandler::m_verbose {}
private

Definition at line 103 of file ClientKeepaliveHandler.h.

const uint64_t Hyperspace::ClientKeepaliveHandler::ms_bad_notification_grace_period = 120000
staticprivate

Definition at line 112 of file ClientKeepaliveHandler.h.


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