#include <source/ariba/overlay/modules/chord/detail/chord_routing_table.hpp>
Public Types | |
typedef minimizer_table < nodeid_t, succ_compare_type, self > | succ_table |
typedef minimizer_table < nodeid_t, pred_compare_type, self > | pred_table |
typedef minimizer_table < nodeid_t, finger_compare_type, self > | finger_table |
typedef vector< item > | route_table |
Public Member Functions | |
template<class Table> | |
void | on_table (table_listener::type_ type, const Table &tab, typename Table::iterator pos) |
chord_routing_table (const nodeid_t &id, int redundancy=2) | |
constructs the reactive chord routing table | |
bool | is_insertable (const nodeid_t &value) |
check whether a node could fit the routing table | |
item * | get (const nodeid_t &value) |
searches an item | |
item * | operator[] (size_t index) |
size_t | size () const |
item * | insert (const nodeid_t &value) |
adds a node | |
item * | insert_orphan (const nodeid_t &value) |
adds an orphan | |
const item * | remove (const nodeid_t &value) |
removes an node | |
item * | remove_orphan (const nodeid_t &value) |
removes an orphan | |
const item * | get_next_hop (const nodeid_t &value) |
returns the next hop | |
const nodeid_t * | get_successor () |
const nodeid_t * | get_predesessor () |
bool | is_closest_to (const nodeid_t &value) |
vector< item > & | get_table () |
returns the whole routing table | |
const item * | get_removed_item () const |
returns the last removed item | |
const succ_table & | get_succ_table () const |
return successor table | |
const pred_table & | get_pred_table () const |
return predecessor table | |
finger_table & | get_finger_table (size_t index) |
return finger table | |
size_t | get_finger_table_size () const |
return number of finger tables | |
Private Types | |
typedef chord_routing_table | self |
typedef distance_compare < nodeid_t &, nodeid_t, ring_succ_distance > | succ_compare_type |
typedef distance_compare < nodeid_t &, nodeid_t, ring_pred_distance > | pred_compare_type |
typedef distance_compare < nodeid_t, nodeid_t, ring_distance > | finger_compare_type |
Private Member Functions | |
item * | find_item (const nodeid_t &id) |
item * | add_item (const nodeid_t &id) |
Adds a item to the routing table. | |
bool | remove_item (const nodeid_t &id) |
Removes an item from the routing table. | |
Private Attributes | |
nodeid_t | id |
succ_table | succ |
pred_table | pred |
finger_table * | finger [max_fingers *2] |
route_table | table |
item * | item_added |
item | item_removed |
bool | item_removed_flag |
bool | simulate |
Static Private Attributes | |
static const int | max_fingers = 32 |
Classes | |
class | item |
Definition at line 67 of file chord_routing_table.hpp.
typedef chord_routing_table chord_routing_table::self [private] |
Definition at line 69 of file chord_routing_table.hpp.
typedef distance_compare<nodeid_t&, nodeid_t, ring_succ_distance> chord_routing_table::succ_compare_type [private] |
Definition at line 71 of file chord_routing_table.hpp.
typedef distance_compare<nodeid_t&, nodeid_t, ring_pred_distance> chord_routing_table::pred_compare_type [private] |
Definition at line 73 of file chord_routing_table.hpp.
typedef distance_compare<nodeid_t, nodeid_t, ring_distance> chord_routing_table::finger_compare_type [private] |
Definition at line 75 of file chord_routing_table.hpp.
Definition at line 78 of file chord_routing_table.hpp.
Definition at line 79 of file chord_routing_table.hpp.
Definition at line 80 of file chord_routing_table.hpp.
typedef vector<item> chord_routing_table::route_table |
Definition at line 89 of file chord_routing_table.hpp.
chord_routing_table::chord_routing_table | ( | const nodeid_t & | id, | |
int | redundancy = 2 | |||
) | [inline, explicit] |
constructs the reactive chord routing table
Definition at line 169 of file chord_routing_table.hpp.
References finger, and max_fingers.
Definition at line 114 of file chord_routing_table.hpp.
References chord_routing_table::item::id, and table.
Referenced by get(), insert_orphan(), is_insertable(), and on_table().
Adds a item to the routing table.
Definition at line 121 of file chord_routing_table.hpp.
References chord_routing_table::item::id, item_added, chord_routing_table::item::ref_count, and table.
Referenced by on_table().
bool chord_routing_table::remove_item | ( | const nodeid_t & | id | ) | [inline, private] |
Removes an item from the routing table.
Definition at line 131 of file chord_routing_table.hpp.
References item_removed, item_removed_flag, and table.
Referenced by on_table(), and remove_orphan().
void chord_routing_table::on_table | ( | table_listener::type_ | type, | |
const Table & | tab, | |||
typename Table::iterator | pos | |||
) | [inline] |
Definition at line 150 of file chord_routing_table.hpp.
References add_item(), find_item(), table_listener::insert, chord_routing_table::item::ref_count, table_listener::remove, remove_item(), and table_listener::update.
bool chord_routing_table::is_insertable | ( | const nodeid_t & | value | ) | [inline] |
check whether a node could fit the routing table
Definition at line 187 of file chord_routing_table.hpp.
References find_item(), finger, minimizer_table< Value, Comparator, Listener >::insertable(), max_fingers, pred, and succ.
Referenced by ariba::overlay::Chord::onMessage().
searches an item
Definition at line 198 of file chord_routing_table.hpp.
References find_item().
Referenced by ariba::overlay::Chord::onLinkDown(), ariba::overlay::Chord::onMessage(), and ariba::overlay::Chord::resolveNode().
item* chord_routing_table::operator[] | ( | size_t | index | ) | [inline] |
size_t chord_routing_table::size | ( | ) | const [inline] |
Definition at line 206 of file chord_routing_table.hpp.
References table.
Referenced by ariba::overlay::Chord::eventFunction(), ariba::overlay::Chord::getKnownNodes(), and ariba::overlay::Chord::leaveOverlay().
adds a node
Definition at line 211 of file chord_routing_table.hpp.
References finger, minimizer_table< Value, Comparator, Listener >::insert(), item_added, item_removed_flag, max_fingers, pred, and succ.
Referenced by ariba::overlay::Chord::onLinkUp().
adds an orphan
Definition at line 222 of file chord_routing_table.hpp.
References find_item(), id, chord_routing_table::item::id, chord_routing_table::item::ref_count, and table.
Referenced by ariba::overlay::Chord::onLinkUp().
removes an node
Definition at line 233 of file chord_routing_table.hpp.
References finger, item_removed, item_removed_flag, max_fingers, pred, minimizer_table< Value, Comparator, Listener >::remove(), remove_orphan(), and succ.
Referenced by ariba::overlay::Chord::onLinkDown(), and ariba::overlay::Chord::onMessage().
removes an orphan
Definition at line 243 of file chord_routing_table.hpp.
References item_removed, item_removed_flag, and remove_item().
Referenced by remove().
returns the next hop
Definition at line 250 of file chord_routing_table.hpp.
References chord_routing_table::item::id, chord_routing_table::item::ref_count, and table.
Referenced by ariba::overlay::Chord::onMessage(), and ariba::overlay::Chord::routeMessage().
const nodeid_t* chord_routing_table::get_successor | ( | ) | [inline] |
Definition at line 270 of file chord_routing_table.hpp.
References succ.
Referenced by ariba::overlay::Chord::eventFunction(), is_closest_to(), and ariba::overlay::Chord::onMessage().
const nodeid_t* chord_routing_table::get_predesessor | ( | ) | [inline] |
Definition at line 275 of file chord_routing_table.hpp.
References pred.
Referenced by ariba::overlay::Chord::eventFunction(), is_closest_to(), and ariba::overlay::Chord::onMessage().
bool chord_routing_table::is_closest_to | ( | const nodeid_t & | value | ) | [inline] |
Definition at line 281 of file chord_routing_table.hpp.
References get_predesessor(), and get_successor().
Referenced by ariba::overlay::Chord::onMessage().
vector<item>& chord_routing_table::get_table | ( | ) | [inline] |
returns the whole routing table
Definition at line 292 of file chord_routing_table.hpp.
References table.
const item* chord_routing_table::get_removed_item | ( | ) | const [inline] |
returns the last removed item
Definition at line 297 of file chord_routing_table.hpp.
References item_removed, and item_removed_flag.
const succ_table& chord_routing_table::get_succ_table | ( | ) | const [inline] |
return successor table
Definition at line 302 of file chord_routing_table.hpp.
References succ.
Referenced by operator<<().
const pred_table& chord_routing_table::get_pred_table | ( | ) | const [inline] |
return predecessor table
Definition at line 307 of file chord_routing_table.hpp.
References pred.
Referenced by operator<<().
finger_table& chord_routing_table::get_finger_table | ( | size_t | index | ) | [inline] |
return finger table
Definition at line 312 of file chord_routing_table.hpp.
References finger.
Referenced by ariba::overlay::Chord::eventFunction().
size_t chord_routing_table::get_finger_table_size | ( | ) | const [inline] |
return number of finger tables
Definition at line 317 of file chord_routing_table.hpp.
References max_fingers.
Referenced by ariba::overlay::Chord::eventFunction().
const int chord_routing_table::max_fingers = 32 [static, private] |
Definition at line 94 of file chord_routing_table.hpp.
Referenced by chord_routing_table(), get_finger_table_size(), insert(), is_insertable(), and remove().
nodeid_t chord_routing_table::id [private] |
succ_table chord_routing_table::succ [private] |
Definition at line 100 of file chord_routing_table.hpp.
Referenced by get_succ_table(), get_successor(), insert(), is_insertable(), and remove().
pred_table chord_routing_table::pred [private] |
Definition at line 101 of file chord_routing_table.hpp.
Referenced by get_pred_table(), get_predesessor(), insert(), is_insertable(), and remove().
finger_table* chord_routing_table::finger[max_fingers *2] [private] |
Definition at line 102 of file chord_routing_table.hpp.
Referenced by chord_routing_table(), get_finger_table(), insert(), is_insertable(), and remove().
route_table chord_routing_table::table [private] |
Definition at line 105 of file chord_routing_table.hpp.
Referenced by add_item(), find_item(), get_next_hop(), get_table(), insert_orphan(), operator[](), remove_item(), and size().
item* chord_routing_table::item_added [private] |
item chord_routing_table::item_removed [private] |
Definition at line 109 of file chord_routing_table.hpp.
Referenced by get_removed_item(), remove(), remove_item(), and remove_orphan().
bool chord_routing_table::item_removed_flag [private] |
Definition at line 110 of file chord_routing_table.hpp.
Referenced by get_removed_item(), insert(), remove(), remove_item(), and remove_orphan().
bool chord_routing_table::simulate [private] |
Definition at line 111 of file chord_routing_table.hpp.