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/communication/EndpointDescriptor.h

    r7744 r12060  
    4242#include <string>
    4343#include <set>
    44 #include "ariba/utility/serialization.h"
     44//#include "ariba/utility/serialization.h"
    4545#include "ariba/utility/types/PeerID.h"
    46 #include "ariba/utility/addressing/endpoint_set.hpp"
     46
     47#include "ariba/utility/addressing2/endpoint_set.hpp"
     48
     49// reboost messages
     50#include "ariba/utility/transport/messages/message.hpp"
     51
    4752
    4853namespace ariba {
     
    5156using_serialization;
    5257using namespace std;
    53 using namespace ariba::addressing;
    5458using ariba::utility::PeerID;
    5559
    56 class EndpointDescriptor: public VSerializeable { VSERIALIZEABLE
    57         friend class BaseCommunication;
     60
     61/**
     62 * This class is used a transitions helper between the old addressing and
     63 * serialization to the new addressing2 and the new message classes
     64 *
     65 * Maybe it will be replaced, or at least modified in the future.
     66 */
     67//class EndpointDescriptor: public VSerializeable { VSERIALIZEABLE
     68//    friend class BaseCommunication;
     69class EndpointDescriptor
     70{
     71    friend class BaseCommunication;
    5872
    5973public:
     
    6882
    6983        /// construct end-points from an endpoint set
    70         EndpointDescriptor(const endpoint_set& endpoints );
     84        EndpointDescriptor(const PeerID& peer_id, addressing2::EndpointSetPtr endpoints );
    7185
     86        // FIXME NOT WORKING !!
    7287        /// construct end-points from a string
    7388        EndpointDescriptor(const string& str);
     
    7590        /// convert end-points to string
    7691        string toString() const {
    77                 return endpoints.to_string();
     92                return endpoints->to_string();
    7893        }
    7994
     
    90105        }
    91106
    92         /// create endpoint
    93         static EndpointDescriptor* fromString(string str) {
    94                 return new EndpointDescriptor(str);
    95         }
     107//      /// create endpoint
     108//      static EndpointDescriptor* fromString(string str) {
     109//              return new EndpointDescriptor(str);
     110//      }
    96111
    97112        bool operator==(const EndpointDescriptor& rh) const {
     
    113128
    114129        /// returns the end-points of this descriptor
    115         endpoint_set& getEndpoints() {
     130        addressing2::const_EndpointSetPtr getEndpoints() const {
    116131                return endpoints;
    117132        }
    118 
    119         /// returns the end-points of this descriptor
    120         const endpoint_set& getEndpoints() const {
    121                 return endpoints;
     133       
     134        void replace_endpoint_set(addressing2::EndpointSetPtr new_endpoints)
     135        {
     136            endpoints = new_endpoints;
    122137        }
    123 
     138       
    124139        /// returns a reference to the peer id
    125140        PeerID& getPeerId() {
     
    132147                return peerId;
    133148        }
     149       
     150        /// returns a message with peerId and endpoints in it
     151        reboost::message_t serialize() const;
     152       
     153        /// deserialite peerId and endpoints
     154        reboost::shared_buffer_t deserialize(reboost::shared_buffer_t buff);
     155       
    134156private:
    135         endpoint_set endpoints;
     157        addressing2::EndpointSetPtr endpoints;
    136158        PeerID peerId;
    137159};
     
    139161}} // namespace ariba, communication
    140162
    141 sznBeginDefault( ariba::communication::EndpointDescriptor, X ){
    142 
    143         // serialize peer id
    144         X && &peerId;
    145 
    146         // serialize end-points
    147         uint16_t len = endpoints.to_bytes_size();
    148         X && len;
    149         uint8_t* buffer = X.bytes( len );
    150         if (buffer!=NULL) {
    151                 if (X.isDeserializer()) endpoints.assign(buffer,len);
    152                 else endpoints.to_bytes(buffer);
    153         }
    154 }sznEnd();
     163//sznBeginDefault( ariba::communication::EndpointDescriptor, X ){
     164//
     165//    // TODO
     166//    assert(false);
     167//   
     168//      // serialize peer id
     169//      X && &peerId;
     170//
     171//      // serialize end-points
     172//      uint16_t len = endpoints.to_bytes_size();
     173//      X && len;
     174//      uint8_t* buffer = X.bytes( len );
     175//      if (buffer!=NULL) {
     176//              if (X.isDeserializer()) endpoints.assign(buffer,len);
     177//              else endpoints.to_bytes(buffer);
     178//      }
     179//}sznEnd();
    155180
    156181#endif /*ENDPOINTDESCRIPTOR_H_*/
Note: See TracChangeset for help on using the changeset viewer.