Changeset 5657 for source/ariba/overlay/modules/chord
- Timestamp:
- Aug 4, 2009, 2:09:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/modules/chord/Chord.cpp
r5647 r5657 409 409 void Chord::eventFunction() { 410 410 stabilize_counter++; 411 if (stabilize_counter == 3) { 411 if (stabilize_counter < 0 || stabilize_counter > 3) { 412 413 // reset counter 414 stabilize_counter = 0; 415 416 // clear pending connections 412 417 pending.clear(); 418 419 // get number of real neighbors 413 420 size_t numNeighbors = 0; 414 421 for (size_t i = 0; i < table->size(); i++) { … … 418 425 logging_info("Running stabilization: #links=" 419 426 << table->size() << " #neighbors=" << numNeighbors ); 420 stabilize_counter = 0; 421 stabilize_finger = ((stabilize_finger+1) % table->get_finger_table_size() );427 428 // sending discovery 422 429 logging_debug("Sending discovery message to my neighbors and fingers"); 430 stabilize_finger = ((stabilize_finger++) % table->get_finger_table_size() ); 423 431 const NodeID& disc1 = nodeid; 424 432 const NodeID& disc2 = table->get_finger_table(stabilize_finger).get_compare().get_center(); 425 433 send_discovery_to(disc1); 426 434 if (disc1 != disc2) send_discovery_to(disc2); 435 436 // remove orphan links 427 437 orphan_removal_counter++; 428 438 if (orphan_removal_counter >= 2) { … … 439 449 } 440 450 } 441 logging_ debug("--- chord routing information ----------------------------------");442 logging_ debug("predecessor: " << (table->get_predesessor()==NULL? "<none>" :451 logging_info("--- chord routing information ----------------------------------"); 452 logging_info("predecessor: " << (table->get_predesessor()==NULL? "<none>" : 443 453 table->get_predesessor()->toString()) ); 444 logging_ debug("node_id : " << nodeid.toString() );445 logging_ debug("successor : " << (table->get_successor()==NULL? "<none>" :454 logging_info("node_id : " << nodeid.toString() ); 455 logging_info("successor : " << (table->get_successor()==NULL? "<none>" : 446 456 table->get_successor()->toString())); 447 logging_ debug("----------------------------------------------------------------");457 logging_info("----------------------------------------------------------------"); 448 458 } 449 459
Note:
See TracChangeset
for help on using the changeset viewer.