Ignore:
Timestamp:
Jun 19, 2013, 11:05:49 AM (11 years ago)
Author:
hock@…
Message:

Reintegrate branch: 20130111-hock-message_classes

improvements:

  • new message classes (reboost, zero-copy)
  • "fast path" for direct links (skip overlay layer)
  • link-properties accessible from the application
  • SystemQueue can call boost::bind functions
  • protlib compatibility removed (32bit overhead saved in every message)
  • addressing2
  • AddressDiscovery discoveres only addresses on which we're actually listening
  • ariba serialization usage reduced (sill used in OverlayMsg)
  • Node::connect, easier and cleaner interface to start-up ariba from the application
  • ariba configs via JSON, XML, etc (boost::property_tree)
  • keep-alive overhead greatly reduced
  • (relayed) overlay links can actually be closed now
  • lost messages are detected in most cases
  • notification to the application when link is transformed into direct-link
  • overlay routing: send message to second best hop if it would be dropped otherwise
  • SequenceNumbers (only mechanisms, so for: upward compatibility)
  • various small fixes


regressions:

  • bluetooth is not yet working again
  • bootstrap modules deactivated
  • liblog4xx is not working (use cout-logging)

This patch brings great performance and stability improvements at cost of backward compatibility.
Also bluetooth and the bootstrap modules have not been ported to the new interfaces, yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/overlay/modules/chord/detail/chord_routing_table.hpp

    r8606 r12060  
    9696        // the own node id
    9797        nodeid_t id;
     98   
     99    // the own node id as routing item
     100    item own_id_item;
    98101
    99102        // successor and predecessor tables
     
    168171        /// constructs the reactive chord routing table
    169172        explicit chord_routing_table( const nodeid_t& id, int redundancy = 4 ) :
    170                 id(id), succ( redundancy, succ_compare_type(this->id), *this ),
    171                 pred( redundancy, pred_compare_type(this->id), *this ) {
     173                id(id),
     174                succ( redundancy, succ_compare_type(this->id), *this ),
     175                pred( redundancy, pred_compare_type(this->id), *this )
     176    {
     177        // init reflexive item
     178        own_id_item.id = id;
     179        own_id_item.ref_count = 1;
    172180
    173181                // create finger tables
     
    273281                        }
    274282                }
     283
    275284                if (best_item != NULL && distance(value, id)<distance(value, best_item->id))
    276285                        return NULL;
    277286                return best_item;
    278287        }
     288       
     289        std::vector<const item*> get_next_2_hops( const nodeid_t& value)
     290    {
     291        ring_distance distance;
     292        item* best_item = &own_id_item;
     293        item* second_best_item = NULL;
     294       
     295        // find best and second best item
     296        for (size_t i=0; i<table.size(); i++)
     297        {
     298            item* curr = &table[i];
     299
     300            // not not include orphans into routing!
     301            if (curr->ref_count==0) continue;
     302
     303            // check if we found a better item
     304            // is best item
     305            if ( distance(value, curr->id) < distance(value, best_item->id) )
     306            {
     307                second_best_item = best_item;
     308                best_item = curr;
     309            }
     310            // is second best item
     311            else
     312            {
     313                if ( second_best_item == NULL )
     314                {
     315                    second_best_item = curr;
     316                    continue;
     317                }
     318               
     319                if ( distance(value, curr->id) < distance(value, second_best_item->id) )
     320                {
     321                    second_best_item = curr;
     322                }
     323            }
     324        }
     325
     326        // prepare return vector
     327        std::vector<const item*> ret;
     328        if ( best_item != NULL )
     329        {
     330            ret.push_back(best_item);
     331        }
     332        if ( second_best_item != NULL )
     333        {
     334            ret.push_back(second_best_item);
     335        }
     336       
     337        return ret;
     338    }
    279339
    280340        const nodeid_t* get_successor() {
    281                 if (succ.size()==NULL) return NULL;
     341                if (succ.size()==0) return NULL;
    282342                return &succ.front();
    283343        }
    284344
    285345        const nodeid_t* get_predesessor() {
    286                 if (pred.size()==NULL) return NULL;
     346                if (pred.size()==0) return NULL;
    287347                return &pred.front();
    288348        }
Note: See TracChangeset for help on using the changeset viewer.