Changeset 5673 for source/ariba/overlay/modules
- Timestamp:
- Aug 4, 2009, 5:13:50 PM (15 years ago)
- Location:
- source/ariba/overlay/modules/chord
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/modules/chord/Chord.cpp
r5671 r5673 123 123 dmsg.setSourceEndpoint(&baseoverlay.getEndpointDescriptor()); 124 124 dmsg.setFollowType(Discovery::successor); 125 dmsg.setTTL((uint8_t) 2);125 dmsg.setTTL((uint8_t)3); 126 126 cmsg.encapsulate(&dmsg); 127 127 send(&cmsg, lnk); … … 133 133 dmsg.setSourceEndpoint(&baseoverlay.getEndpointDescriptor()); 134 134 dmsg.setFollowType(Discovery::predecessor); 135 dmsg.setTTL((uint8_t) 2);135 dmsg.setTTL((uint8_t)3); 136 136 cmsg.encapsulate(&dmsg); 137 137 send(&cmsg, lnk); … … 260 260 logging_info("new orphan: " << remote.toString() 261 261 << " with link " << lnk.toString()); 262 discover_neighbors( lnk ); 262 263 table->insert_orphan(remote)->info = lnk; 263 264 } … … 321 322 // decapsulate message 322 323 Discovery* dmsg = m->decapsulate<Discovery> (); 323 logging_ info("received discovery message with"324 logging_debug("received discovery message with" 324 325 << " src=" << m->getSource().toString() 325 326 << " dst=" << m->getDestination().toString() … … 347 348 cmsg_s.encapsulate(&dmsg_s); 348 349 route_item* succ_item = table->get(*table->get_successor()); 349 logging_ info("Discovery split: routing discovery message to successor "350 logging_debug("Discovery split: routing discovery message to successor " 350 351 << succ_item->id.toString() ); 351 352 send(&cmsg_s, succ_item->info); … … 360 361 route_item* pred_item = table->get( 361 362 *table->get_predesessor()); 362 logging_ info("Discovery split: routing discovery message to predecessor "363 logging_debug("Discovery split: routing discovery message to predecessor " 363 364 << pred_item->id.toString() ); 364 365 send(&cmsg_p, pred_item->info); … … 427 428 void Chord::eventFunction() { 428 429 stabilize_counter++; 429 if (stabilize_counter < 0 || stabilize_counter == 1) {430 if (stabilize_counter < 0 || stabilize_counter == 3) { 430 431 431 432 // reset counter … … 450 451 const NodeID disc2 = table->get_finger_table(stabilize_finger).get_compare().get_center(); 451 452 send_discovery_to(disc1); 452 453 if (table->get_successor() != NULL) {454 route_item* succ_item = table->get(*table->get_successor());455 if (!succ_item->info.isUnspecified()) discover_neighbors(succ_item->info);456 }457 458 // send predecessor message459 if (table->get_predesessor() != NULL) {460 route_item* pred_item = table->get(*table->get_predesessor());461 if (!pred_item->info.isUnspecified()) discover_neighbors(pred_item->info);462 }463 464 453 if (disc1 != disc2) 465 454 send_discovery_to(disc2); 455 456 for (int i=0; i<table->size(); i++) { 457 LinkID id = (*table)[i]->info; 458 if (!id.isUnspecified()) discover_neighbors(id); 459 } 460 466 461 467 462 // remove orphan links -
source/ariba/overlay/modules/chord/detail/chord_routing_table.hpp
r5665 r5673 167 167 public: 168 168 /// constructs the reactive chord routing table 169 explicit chord_routing_table( const nodeid_t& id, int redundancy = 8) :169 explicit chord_routing_table( const nodeid_t& id, int redundancy = 2 ) : 170 170 id(id), succ( redundancy, succ_compare_type(this->id), *this ), 171 171 pred( redundancy, pred_compare_type(this->id), *this ) {
Note:
See TracChangeset
for help on using the changeset viewer.