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

#include <RangeServerConnectionManager.h>

Classes

struct  InetAddrHash
 
class  RangeServerConnectionEntry
 

Public Member Functions

 RangeServerConnectionManager ()
 
void add_server (RangeServerConnectionPtr &rsc)
 Adds a range server connection. More...
 
bool remove_server (const std::string &location, RangeServerConnectionPtr &rsc)
 Removes range server connection. More...
 
bool connect_server (RangeServerConnectionPtr &rsc, const String &hostname, InetAddr local_addr, InetAddr public_addr)
 
bool disconnect_server (RangeServerConnectionPtr &rsc)
 
bool is_connected (const String &location)
 
bool find_server_by_location (const String &location, RangeServerConnectionPtr &rsc)
 
bool find_server_by_hostname (const String &hostname, RangeServerConnectionPtr &rsc)
 
bool find_server_by_public_addr (InetAddr addr, RangeServerConnectionPtr &rsc)
 
bool find_server_by_local_addr (InetAddr addr, RangeServerConnectionPtr &rsc)
 
bool next_available_server (RangeServerConnectionPtr &rsc, bool urgent=false)
 
void set_servers_balanced (const std::vector< RangeServerConnectionPtr > &servers)
 
bool exist_unbalanced_servers ()
 
size_t server_count ()
 
void get_servers (std::vector< RangeServerConnectionPtr > &servers)
 
void get_valid_connections (StringSet &locations, std::vector< RangeServerConnectionPtr > &connections)
 
size_t connection_count ()
 
void set_range_server_state (std::vector< RangeServerState > &states)
 

Private Types

typedef std::map< String,
uint64_t > 
HandleMap
 
typedef
boost::multi_index_container
< RangeServerConnectionEntry,
indexed_by< sequenced
<>, hashed_unique
< const_mem_fun
< RangeServerConnectionEntry,
const String
&,&RangeServerConnectionEntry::location >
>, hashed_non_unique
< const_mem_fun
< RangeServerConnectionEntry,
const String
&,&RangeServerConnectionEntry::hostname >
>, hashed_unique
< const_mem_fun
< RangeServerConnectionEntry,
InetAddr,&RangeServerConnectionEntry::public_addr >
, InetAddrHash >
, hashed_non_unique
< const_mem_fun
< RangeServerConnectionEntry,
InetAddr,&RangeServerConnectionEntry::local_addr >
, InetAddrHash > > > 
ConnectionList
 
typedef
ConnectionList::nth_index
< 0 >::type 
Sequence
 
typedef
ConnectionList::nth_index
< 1 >::type 
LocationIndex
 
typedef
ConnectionList::nth_index
< 2 >::type 
HostnameIndex
 
typedef
ConnectionList::nth_index
< 3 >::type 
PublicAddrIndex
 
typedef
ConnectionList::nth_index
< 4 >::type 
LocalAddrIndex
 

Private Member Functions

bool find_server_by_location_unlocked (const String &location, RangeServerConnectionPtr &rsc)
 

Private Attributes

std::mutex m_mutex
 Mutex for serializing member access More...
 
ConnectionList m_connections
 
ConnectionList::iterator m_connections_iter
 
size_t m_conn_count {}
 
int32_t m_disk_threshold {}
 

Detailed Description

Definition at line 52 of file RangeServerConnectionManager.h.

Member Typedef Documentation

Definition at line 123 of file RangeServerConnectionManager.h.

typedef std::map<String, uint64_t> Hypertable::RangeServerConnectionManager::HandleMap
private

Definition at line 91 of file RangeServerConnectionManager.h.

typedef ConnectionList::nth_index<2>::type Hypertable::RangeServerConnectionManager::HostnameIndex
private

Definition at line 127 of file RangeServerConnectionManager.h.

typedef ConnectionList::nth_index<4>::type Hypertable::RangeServerConnectionManager::LocalAddrIndex
private

Definition at line 129 of file RangeServerConnectionManager.h.

typedef ConnectionList::nth_index<1>::type Hypertable::RangeServerConnectionManager::LocationIndex
private

Definition at line 126 of file RangeServerConnectionManager.h.

typedef ConnectionList::nth_index<3>::type Hypertable::RangeServerConnectionManager::PublicAddrIndex
private

Definition at line 128 of file RangeServerConnectionManager.h.

typedef ConnectionList::nth_index<0>::type Hypertable::RangeServerConnectionManager::Sequence
private

Definition at line 125 of file RangeServerConnectionManager.h.

Constructor & Destructor Documentation

RangeServerConnectionManager::RangeServerConnectionManager ( )

Definition at line 34 of file RangeServerConnectionManager.cc.

Member Function Documentation

void RangeServerConnectionManager::add_server ( RangeServerConnectionPtr rsc)

Adds a range server connection.

Parameters
rscRangeServer connection to add

Definition at line 39 of file RangeServerConnectionManager.cc.

bool RangeServerConnectionManager::connect_server ( RangeServerConnectionPtr rsc,
const String hostname,
InetAddr  local_addr,
InetAddr  public_addr 
)

Definition at line 72 of file RangeServerConnectionManager.cc.

size_t Hypertable::RangeServerConnectionManager::connection_count ( )
inline

Definition at line 84 of file RangeServerConnectionManager.h.

bool RangeServerConnectionManager::disconnect_server ( RangeServerConnectionPtr rsc)

Definition at line 133 of file RangeServerConnectionManager.cc.

bool RangeServerConnectionManager::exist_unbalanced_servers ( )

Definition at line 302 of file RangeServerConnectionManager.cc.

bool RangeServerConnectionManager::find_server_by_hostname ( const String hostname,
RangeServerConnectionPtr rsc 
)

Definition at line 177 of file RangeServerConnectionManager.cc.

bool RangeServerConnectionManager::find_server_by_local_addr ( InetAddr  addr,
RangeServerConnectionPtr rsc 
)

Definition at line 207 of file RangeServerConnectionManager.cc.

bool RangeServerConnectionManager::find_server_by_location ( const String location,
RangeServerConnectionPtr rsc 
)

Definition at line 152 of file RangeServerConnectionManager.cc.

bool RangeServerConnectionManager::find_server_by_location_unlocked ( const String location,
RangeServerConnectionPtr rsc 
)
private

Definition at line 158 of file RangeServerConnectionManager.cc.

bool RangeServerConnectionManager::find_server_by_public_addr ( InetAddr  addr,
RangeServerConnectionPtr rsc 
)

Definition at line 193 of file RangeServerConnectionManager.cc.

void RangeServerConnectionManager::get_servers ( std::vector< RangeServerConnectionPtr > &  servers)

Definition at line 275 of file RangeServerConnectionManager.cc.

void RangeServerConnectionManager::get_valid_connections ( StringSet locations,
std::vector< RangeServerConnectionPtr > &  connections 
)

Definition at line 283 of file RangeServerConnectionManager.cc.

bool RangeServerConnectionManager::is_connected ( const String location)

Definition at line 143 of file RangeServerConnectionManager.cc.

bool RangeServerConnectionManager::next_available_server ( RangeServerConnectionPtr rsc,
bool  urgent = false 
)

Definition at line 224 of file RangeServerConnectionManager.cc.

bool RangeServerConnectionManager::remove_server ( const std::string &  location,
RangeServerConnectionPtr rsc 
)

Removes range server connection.

Checks if range server connection to location exists in the live set and if so, removes it and adds location to the dead set.

Parameters
locationProxy location of range server connection to remove
rscReference to RangeServerConnection output pointer
Returns
true if connection is removed and rsc populated, false otherwise.

Definition at line 56 of file RangeServerConnectionManager.cc.

size_t RangeServerConnectionManager::server_count ( )

Definition at line 264 of file RangeServerConnectionManager.cc.

void RangeServerConnectionManager::set_range_server_state ( std::vector< RangeServerState > &  states)

Definition at line 311 of file RangeServerConnectionManager.cc.

void RangeServerConnectionManager::set_servers_balanced ( const std::vector< RangeServerConnectionPtr > &  servers)

Definition at line 296 of file RangeServerConnectionManager.cc.

Member Data Documentation

size_t Hypertable::RangeServerConnectionManager::m_conn_count {}
private

Definition at line 138 of file RangeServerConnectionManager.h.

ConnectionList Hypertable::RangeServerConnectionManager::m_connections
private

Definition at line 134 of file RangeServerConnectionManager.h.

ConnectionList::iterator Hypertable::RangeServerConnectionManager::m_connections_iter
private

Definition at line 136 of file RangeServerConnectionManager.h.

int32_t Hypertable::RangeServerConnectionManager::m_disk_threshold {}
private

Definition at line 139 of file RangeServerConnectionManager.h.

std::mutex Hypertable::RangeServerConnectionManager::m_mutex
private

Mutex for serializing member access

Definition at line 132 of file RangeServerConnectionManager.h.


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