Changeset 5657 for source


Ignore:
Timestamp:
Aug 4, 2009, 2:09:24 PM (15 years ago)
Author:
mies
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/overlay/modules/chord/Chord.cpp

    r5647 r5657  
    409409void Chord::eventFunction() {
    410410        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
    412417                pending.clear();
     418
     419                // get number of real neighbors
    413420                size_t numNeighbors = 0;
    414421                for (size_t i = 0; i < table->size(); i++) {
     
    418425                logging_info("Running stabilization: #links="
    419426                                << table->size() << " #neighbors=" << numNeighbors );
    420                 stabilize_counter = 0;
    421                 stabilize_finger = ((stabilize_finger+1) % table->get_finger_table_size() );
     427
     428                // sending discovery
    422429                logging_debug("Sending discovery message to my neighbors and fingers");
     430                stabilize_finger = ((stabilize_finger++) % table->get_finger_table_size() );
    423431                const NodeID& disc1 = nodeid;
    424432                const NodeID& disc2 = table->get_finger_table(stabilize_finger).get_compare().get_center();
    425433                send_discovery_to(disc1);
    426434                if (disc1 != disc2) send_discovery_to(disc2);
     435
     436                // remove orphan links
    427437                orphan_removal_counter++;
    428438                if (orphan_removal_counter >= 2) {
     
    439449                }
    440450        }
    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>" :
    443453                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>" :
    446456                table->get_successor()->toString()));
    447         logging_debug("----------------------------------------------------------------");
     457        logging_info("----------------------------------------------------------------");
    448458}
    449459
Note: See TracChangeset for help on using the changeset viewer.