Changeset 3718


Ignore:
Timestamp:
May 27, 2009, 8:13:08 AM (15 years ago)
Author:
Christoph Mayer
Message:

-dynamische wahl des overlays durch den initiator, nodes kriegen bei join mitgeteilt welche overlay struktur zu verwenden ist

Files:
14 edited

Legend:

Unmodified
Added
Removed
  • sample/pingpong/PingPong.cpp

    r3071 r3718  
    6969        node->start();
    7070
     71        // when initiating, you can define the overlay type, default is Chord [CHORD_OVERLAY]
     72        SpoVNetProperties params;
     73        //params.setBaseOverlayType( SpoVNetProperties::ONE_HOP_OVERLAY ); // alternative: OneHop
     74
    7175        // initiate or join the spovnet
    7276        if (!isInitiator) node->join(spovnetName);
    73         else node->initiate(spovnetName);
     77        else node->initiate(spovnetName, params);
    7478
    7579        // ping pong started up...
  • source/ariba/Node.cpp

    r3578 r3718  
    6464                        ariba_mod.getBootstrapNode(vnetname);
    6565        if( ep == NULL ) {
    66                 std::cout << "no bootstrap node defined" << std::endl; 
     66                std::cout << "no bootstrap node defined" << std::endl;
    6767                return;
    6868        }
     
    7373
    7474void Node::initiate(const Name& vnetname, const SpoVNetProperties& parm) {
    75         utility::OverlayParameterSet ovrpset =
     75        utility::OverlayParameterSet ovrpset;
     76        ovrpset.setOverlayStructure(
    7677                        (utility::OverlayParameterSet::_OverlayStructure)
    77                         parm.getBaseOverlayType();
     78                        parm.getBaseOverlayType()
     79                        );
    7880
    7981        spovnetId = vnetname.toSpoVNetId();
     
    8385
    8486        base_overlay->start( *ariba_mod.base_comm, nodeId );
    85         base_overlay->createSpoVNet( spovnetId );
     87        base_overlay->createSpoVNet( spovnetId, ovrpset );
    8688
    8789        ariba_mod.addBootstrapNode(vnetname,
  • source/ariba/SpoVNetProperties.h

    r3690 r3718  
    6969                ONE_HOP_OVERLAY = 0,
    7070                CHORD_OVERLAY = 1,
    71                 KADEMLIA_OVERLAY = 2,
    7271        };
    7372
     
    131130        }
    132131
    133 
    134132        /**
    135133         * Returns the overlay type.
     
    140138                this->type = type;
    141139        }
    142 
    143140
    144141        /**
  • source/ariba/overlay/BaseOverlay.cpp

    r3713 r3718  
    726726                joiningNodes.push_back( overlayMsg->getSourceNode() );
    727727
     728                //
    728729                // send back our spovnetid, default overlay parameters, join allow
    729730                // result, and ourself as the end-point to bootstrap the overlay against
     731                //
     732
     733                assert( overlayInterface != NULL );
     734                OverlayParameterSet parameters = overlayInterface->getParameters();
     735
    730736                OverlayMsg retmsg( OverlayMsg::OverlayMessageTypeJoinReply, nodeId );
    731                 JoinReply replyMsg( spovnetId, OverlayParameterSet::DEFAULT,
     737                JoinReply replyMsg( spovnetId, parameters,
    732738                                        allow, getEndpointDescriptor() );
    733739
  • source/ariba/overlay/modules/OverlayFactory.cpp

    r3690 r3718  
    5353
    5454        switch( param.getOverlayStructure() ){
    55                 case OverlayParameterSet::OverlayStructureOneHop:
    56                         return new OneHop( baseoverlay, nodeid, routeReceiver );
    5755
    5856                case OverlayParameterSet::OverlayStructureChord:
    59                         return new Chord( baseoverlay, nodeid, routeReceiver );
     57                        return new Chord( baseoverlay, nodeid, routeReceiver, param );
    6058
    61                 case OverlayParameterSet::OverlayStructureKademlia:
    62                         return NULL;
     59                case OverlayParameterSet::OverlayStructureOneHop:
     60                        return new OneHop( baseoverlay, nodeid, routeReceiver, param );
    6361
    6462                default:
  • source/ariba/overlay/modules/OverlayInterface.cpp

    r3705 r3718  
    4646ServiceID OverlayInterface::OVERLAY_SERVICE_ID(0);
    4747
    48 OverlayInterface::OverlayInterface(BaseOverlay& _baseoverlay,
    49                 const NodeID& _nodeid, OverlayStructureEvents* _eventsReceiver) :
    50         baseoverlay(_baseoverlay), nodeid(_nodeid), eventsReceiver(_eventsReceiver) {
     48OverlayInterface::OverlayInterface(BaseOverlay& _baseoverlay, const NodeID& _nodeid,
     49                        OverlayStructureEvents* _eventsReceiver, OverlayParameterSet _parameters) :
     50        baseoverlay(_baseoverlay), nodeid(_nodeid),
     51        eventsReceiver(_eventsReceiver), parameters(_parameters) {
    5152
    5253        _baseoverlay.bind(this, OVERLAY_SERVICE_ID);
     
    8283}
    8384
     85const OverlayParameterSet& OverlayInterface::getParameters() const {
     86        return parameters;
     87}
     88
    8489}} // namespace ariba, overlay
  • source/ariba/overlay/modules/OverlayInterface.h

    r3690 r3718  
    4545#include "ariba/utility/types/NodeID.h"
    4646#include "ariba/utility/types/ServiceID.h"
     47#include "ariba/utility/types/OverlayParameterSet.h"
    4748
    4849using ariba::CommunicationListener;
     
    5152using ariba::utility::NodeID;
    5253using ariba::utility::ServiceID;
     54using ariba::utility::OverlayParameterSet;
    5355
    5456namespace ariba {
     
    7577                        BaseOverlay& _baseoverlay,
    7678                        const NodeID& _nodeid,
    77                         OverlayStructureEvents* _eventsReceiver );
     79                        OverlayStructureEvents* _eventsReceiver,
     80                        OverlayParameterSet _parameters
     81                        );
    7882
    7983        /**
     
    154158                        const LinkID& lnk = LinkID::UNSPECIFIED);
    155159
     160
     161        const OverlayParameterSet& getParameters() const;
     162
    156163protected:
    157164
    158165        /// Reference to an active base overlay
    159166        BaseOverlay& baseoverlay;
     167
     168        /// The parameters of the overlay structure
     169        OverlayParameterSet parameters;
    160170
    161171        /// The node identifier to use with this overlay
  • source/ariba/overlay/modules/chord/Chord.cpp

    r3713 r3718  
    5353
    5454Chord::Chord(BaseOverlay& _baseoverlay, const NodeID& _nodeid,
    55                 OverlayStructureEvents* _eventsReceiver) :
    56         OverlayInterface(_baseoverlay, _nodeid, _eventsReceiver) {
     55                OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param) :
     56        OverlayInterface(_baseoverlay, _nodeid, _eventsReceiver, param) {
    5757
    5858        // create routing table
  • source/ariba/overlay/modules/chord/Chord.h

    r3690 r3718  
    8989public:
    9090        Chord(BaseOverlay& _baseoverlay, const NodeID& _nodeid,
    91                         OverlayStructureEvents* _eventsReceiver);
     91                        OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param);
    9292        virtual ~Chord();
    9393
  • source/ariba/overlay/modules/onehop/OneHop.cpp

    r3705 r3718  
    4949use_logging_cpp( OneHop );
    5050
    51 OneHop::OneHop(BaseOverlay& _baseoverlay, const NodeID& _nodeid, OverlayStructureEvents* _eventsReceiver)
    52         :       OverlayInterface( _baseoverlay, _nodeid, _eventsReceiver ),
     51OneHop::OneHop(BaseOverlay& _baseoverlay, const NodeID& _nodeid,
     52                OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param)
     53        :       OverlayInterface( _baseoverlay, _nodeid, _eventsReceiver, param ),
    5354                state           ( OneHopStateInvalid ),
    5455                bootstrapLink   ( LinkID::UNSPECIFIED ),
  • source/ariba/overlay/modules/onehop/OneHop.h

    r3705 r3718  
    5555public:
    5656        OneHop(BaseOverlay& _overlay, const NodeID& _nodeid,
    57                         OverlayStructureEvents* _eventsReceiver);
     57                        OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param);
    5858
    5959        virtual ~OneHop();
  • source/ariba/utility/system/StartupWrapper.cpp

    r3712 r3718  
    103103        {
    104104                log4cxx::LoggerPtr logger(log4cxx::Logger::getRootLogger());
    105                 logger->setLevel(log4cxx::Level::getDebug());
     105                logger->setLevel(log4cxx::Level::getInfo());
    106106        }
    107107
  • source/ariba/utility/types/OverlayParameterSet.cpp

    r3690 r3718  
    5555}
    5656
    57 void OverlayParameterSet::getOverlayStructure(OverlayStructure _structure){
     57void OverlayParameterSet::setOverlayStructure(OverlayStructure _structure){
    5858        structure = (uint8_t)_structure;
    5959}
  • source/ariba/utility/types/OverlayParameterSet.h

    r3690 r3718  
    5555                OverlayStructureOneHop   = 0,
    5656                OverlayStructureChord    = 1,
    57                 OverlayStructureKademlia = 2,
    5857        } OverlayStructure;
    5958
     
    6261
    6362        OverlayStructure getOverlayStructure() const;
    64         void getOverlayStructure( OverlayStructure _structure );
     63        void setOverlayStructure( OverlayStructure _structure );
    6564
    6665private:
Note: See TracChangeset for help on using the changeset viewer.