Changeset 5871 for source/ariba/overlay/modules/chord
- Timestamp:
- Aug 11, 2009, 4:13:09 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/modules/chord/Chord.cpp
r5870 r5871 62 62 63 63 // create routing table 64 <<<<<<< .working65 this->table = new chord_routing_table(_nodeid, 2);66 =======67 64 this->table = new chord_routing_table(_nodeid, 4); 68 >>>>>>> .merge-rechts.r586969 65 orphan_removal_counter = 0; 70 66 discovery_count = 0; … … 101 97 102 98 // establish link via base overlay 103 <<<<<<< .working104 return baseoverlay.establishLink(endp, node, OverlayInterface::OVERLAY_SERVICE_ID, remoteRelay );105 =======106 99 return baseoverlay.establishLink( endpoint, remote, 107 100 OverlayInterface::OVERLAY_SERVICE_ID ); 108 >>>>>>> .merge-rechts.r5869109 101 } 110 102 … … 127 119 msg.encapsulate(&dmsg); 128 120 129 <<<<<<< .working130 // get next hop131 const route_item* item = table->get_next_hop(destination);132 if (item!=NULL && !item->info.isUnspecified()) send(&cmsg, item->info);133 =======134 121 // send to node 135 122 baseoverlay.send_node( &msg, remote ); 136 >>>>>>> .merge-rechts.r5869137 123 } 138 124 … … 200 186 const LinkID& Chord::getNextLinkId( const NodeID& id ) const { 201 187 // get next hop 202 <<<<<<< .working203 const route_item* item = table->get_next_hop(destnode);204 =======205 188 const route_item* item = table->get_next_hop(id); 206 >>>>>>> .merge-rechts.r5869 207 208 <<<<<<< .working 209 // message for this node? yes-> delegate to base overlay 210 if (item->id == nodeid || destnode == nodeid) 211 baseoverlay.incomingRouteMessage( msg, LinkID::UNSPECIFIED, nodeid ); 212 ======= 189 213 190 // returns a unspecified id when this is itself 214 191 if (item == NULL || item->id == nodeid) 215 192 return LinkID::UNSPECIFIED; 216 >>>>>>> .merge-rechts.r5869 217 218 <<<<<<< .working 219 else { // no-> send to next hop 220 ChordMessage cmsg(ChordMessage::route, nodeid, destnode); 221 cmsg.encapsulate(msg); 222 send(&cmsg, item->info); 223 } 224 ======= 193 225 194 /// return routing info 226 195 return item->info; 227 >>>>>>> .merge-rechts.r5869 228 } 229 230 <<<<<<< .working 231 /// @see OverlayInterface.h 232 void Chord::routeMessage(const NodeID& node, const LinkID& link, Message* msg) { 233 logging_debug("Redirect over Chord to node id=" << node.toString() 234 << " link id=" << link.toString() ); 235 ChordMessage cmsg(ChordMessage::route, nodeid, node); 236 cmsg.encapsulate(msg); 237 send(&cmsg, link); 238 } 239 240 /// @see OverlayInterface.h 241 const LinkID& Chord::getNextLinkId( const NodeID& id ) const { 242 // get next hop 243 const route_item* item = table->get_next_hop(id); 244 245 // returns a unspecified id when this is itself 246 if (item == NULL || item->id == nodeid) 247 return LinkID::UNSPECIFIED; 248 249 /// return routing info 250 return item->info; 251 } 252 253 ======= 254 >>>>>>> .merge-rechts.r5869 196 } 197 255 198 OverlayInterface::NodeList Chord::getKnownNodes(bool deep) const { 256 199 OverlayInterface::NodeList nodelist; … … 351 294 switch (m->getType()) { 352 295 353 <<<<<<< .working354 // invalid message355 case M::invalid:356 break;357 358 // route message with payload359 case M::route: {360 // find next hop361 const route_item* item = table->get_next_hop(m->getDestination());362 363 // next hop == myself?364 if (m->getDestination() == nodeid) { // yes-> route to base overlay365 logging_debug("Send message to baseoverlay");366 baseoverlay.incomingRouteMessage( m, item->info, remote );367 }368 // no-> route to next hop369 else {370 logging_debug("Route chord message to "371 << item->id.toString() << " (destination=" << m->getDestination() << ")");372 send(m, item->info);373 }374 break;375 }376 377 // discovery request378 case M::discovery: {379 =======380 296 // discovery request 381 297 case typeDiscovery: { 382 >>>>>>> .merge-rechts.r5869383 298 // decapsulate message 384 299 Discovery* dmsg = m->decapsulate<Discovery> (); … … 410 325 logging_debug("Discovery split: routing discovery message to successor " 411 326 << succ_item->id.toString() ); 412 <<<<<<< .working413 send(&cmsg_s, succ_item->info);414 =======415 327 send(&omsg, succ_item->info); 416 >>>>>>> .merge-rechts.r5869417 328 } 418 329 … … 426 337 logging_debug("Discovery split: routing discovery message to predecessor " 427 338 << pred_item->id.toString() ); 428 <<<<<<< .working429 send(&cmsg_p, pred_item->info);430 =======431 339 send( &omsg, pred_item->info); 432 >>>>>>> .merge-rechts.r5869433 340 } 434 341 } 435 342 // no-> route message 436 343 else { 437 <<<<<<< .working438 // find next hop439 const route_item* item = table->get_next_hop(m->getDestination());440 if (item == NULL || item->id == nodeid) break;441 logging_debug("routing discovery message to " <<442 item->id.toString() );443 send(m, item->info);444 =======445 344 baseoverlay.send( m, m->getDestinationNode() ); 446 >>>>>>> .merge-rechts.r5869447 345 } 448 346 break; … … 526 424 // remove orphan links 527 425 orphan_removal_counter++; 528 <<<<<<< .working529 if (orphan_removal_counter <0 || orphan_removal_counter >= 4) {530 =======531 426 if (orphan_removal_counter <0 || orphan_removal_counter >= 2) { 532 >>>>>>> .merge-rechts.r5869533 427 logging_info("Running orphan removal"); 534 428 orphan_removal_counter = 0;
Note:
See TracChangeset
for help on using the changeset viewer.