m2etis  0.4
m2etis::pubsub::order::GMSOrder< NetworkType, Timeout > Class Template Reference

implements the Order Strategy from Garcia-Molina and Spauster The Strategy ensures synchronisation along multiple trees. Doesn't work with RoutingStrategies sending directly Notify messages instead of Published to root, e.g. DirectBroadcastRouting More...

#include <GMSOrder.h>

Inheritance diagram for m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >:
Inheritance graph

Public Types

typedef message::GMSOrderInfo< NetworkType > OrderInfoType
 
typedef std::pair< uint64_t, uint64_t > MsgIdent
 
typedef uint64_t SN
 
typedef std::pair< uint64_t, uint64_t > BufId
 
typedef std::tuple< MsgInfo, uint64_t > QueueTuple
 

Public Member Functions

 GMSOrder (PubSubSystemEnvironment *pssi, bool isRoot)
 
virtual ~GMSOrder ()
 
bool hasPending ()
 returns whether pending messages exist More...
 
void setMasterTree (uint64_t t)
 this node will only accept controlmessages from this tree More...
 
bool configureOrderInfo (uint64_t id, const message::ActionType mtype, typename message::OrderInfo::Ptr ptr, const typename NetworkType::Key &rec)
 configures the info struct More...
 
void processSubscribePayload (typename message::OrderInfo::Ptr ptr, const typename NetworkType::Key &sender)
 processes a subscribe payload (Root) the message will be processed on tree 0 More...
 
void processUnsubscribePayload (typename message::OrderInfo::Ptr ptr, const typename NetworkType::Key &sender)
 
void processPublishPayload (typename message::OrderInfo::Ptr ptr, const typename NetworkType::Key &)
 processes a publish payload More...
 
void processNotifyPayload (typename message::OrderInfo::Ptr, const typename NetworkType::Key &)
 called for every NotifyMsg that arrived More...
 
bool processControlPayload (typename message::OrderInfo::Ptr ptr, const typename NetworkType::Key &sender)
 processes a control payload (Root) More...
 
void deliver (uint64_t a)
 the Message with id a shall be delivered This is used to force other instances to deliver a message More...
 
void updateQueue ()
 checks the queue for new messages to deliver More...
 
void receive (uint64_t id, typename message::OrderInfo::Ptr ptr, const typename NetworkType::Key &sender)
 called by the Tree whenever a message is ready to be delivered This function stores the messages (to be precise, the corresponding ids) until the controlmessages with orderinformation arrived More...
 
void otherOrders (const std::vector< GMSOrder * > &others)
 stores the instances of the OrderStrategy from the other Channels Also sets the myTree_ variable and initializes subs_ More...
 
void sendCtrl (uint64_t treeId, uint64_t msgId)
 the tree shall publish CtrlMsgs on all trees that have subscribers This function is only used on Tree 0 More...
 
void sendCtrl2 (uint64_t treeId, uint64_t msgId)
 send a ctrlMsg on this tree More...
 
void notifyRemovedMessage (typename message::OrderInfo::Ptr, const typename NetworkType::Key &)
 notified when message dropped by filter or validity strategy More...
 
- Public Member Functions inherited from m2etis::pubsub::order::BaseOrder< NetworkType >
 BaseOrder (PubSubSystemEnvironment *pssi, bool isRoot)
 
virtual ~BaseOrder ()
 
void configureCallback (const boost::function< void(uint64_t, msgProcess)> &func)
 used to set the function to be called when a message should be send to the next processing stage call this function with the id given in receive() to deliver the appropriate message More...
 
void setHn (const typename NetworkType::Key &self)
 sets the hostname of the current node More...
 
void configureSendCallback (const boost::function< void(message::OrderInfo::Ptr, const typename NetworkType::Key &, ControlTarget)> &func)
 with this function, new messages can be sent directly to nodes More...
 
void setRoot (bool b)
 sets whether this node is the root node. Several strategies need this to determind the sequencer More...
 

Public Attributes

uint64_t counter
 
PubSubSystemEnvironmentpssi_
 pointer to the PubSubSystemEnvironment More...
 
std::vector< GMSOrder * > others_
 list of all Order classes from the other trees More...
 
std::vector< std::set< typename NetworkType::Key > > subs_
 for every tree, save all subscribers only neccessary on root node More...
 
std::map< typename NetworkType::Key, uint64_t > nextSend_
 Receiver -> next Seq. Nr. to use. More...
 
std::map< typename NetworkType::Key, uint64_t > nextRec_
 Sender -> next Seq. Nr. to expect. More...
 
std::map< typename NetworkType::Key, uint64_t > mainTree_
 Receiver -> Tree that should be used for the Control msg only used in root node. More...
 
std::set< uint64_t > selfSub_
 this node is subscribed on these trees More...
 
uint64_t nextFinished
 next ID to be expected More...
 
uint64_t masterTree
 tree on which Control Msgs are expected. Default: None More...
 
uint64_t myTree_
 index number of this tree More...
 
uint64_t nextSend
 next number to be used as the global Sequence number More...
 
std::map< typename NetworkType::Key, std::set< uint64_t > > subOn_
 which node is subscribed on which tree More...
 
std::priority_queue< QueueTuple, std::vector< QueueTuple >, std::greater< QueueTuple > > ctrlQueue_
 Queue containing all recieved but not yet further processed ctrl messages. More...
 
std::map< MsgIdent, BufIdpubQueue_
 stores all NOTIFY msgs that arrived More...
 

Additional Inherited Members

- Protected Attributes inherited from m2etis::pubsub::order::BaseOrder< NetworkType >
PubSubSystemEnvironmentpssi_
 
bool isRoot_
 true if this node is the root node More...
 
NetworkType::Key hn
 hostname of the node More...
 
boost::function< void(uint64_t, msgProcess)> function_
 stores the function to be called for delivering More...
 
boost::function< void(message::OrderInfo::Ptr, const typename NetworkType::Key &, ControlTarget)> sendMsg_
 stores the function to send new messages This function will send a newly created control message containing the given OrderStruct to the specified sender. The Tree ensures that this message will be sent to the specified receiver and will not be processed by any other strategie. More...
 

Detailed Description

template<class NetworkType, unsigned int Timeout>
class m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >

implements the Order Strategy from Garcia-Molina and Spauster The Strategy ensures synchronisation along multiple trees. Doesn't work with RoutingStrategies sending directly Notify messages instead of Published to root, e.g. DirectBroadcastRouting

Definition at line 42 of file GMSOrder.h.

Member Typedef Documentation

template<class NetworkType , unsigned int Timeout>
typedef std::pair<uint64_t, uint64_t> m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::BufId

Definition at line 152 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
typedef std::pair<uint64_t, uint64_t> m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::MsgIdent

Definition at line 150 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
typedef message::GMSOrderInfo<NetworkType> m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::OrderInfoType

Definition at line 75 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
typedef std::tuple<MsgInfo, uint64_t> m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::QueueTuple

Definition at line 154 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
typedef uint64_t m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::SN

Definition at line 151 of file GMSOrder.h.

Constructor & Destructor Documentation

template<class NetworkType , unsigned int Timeout>
m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::GMSOrder ( PubSubSystemEnvironment pssi,
bool  isRoot 
)
inline

Definition at line 77 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
virtual m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::~GMSOrder ( )
inlinevirtual

Definition at line 86 of file GMSOrder.h.

Member Function Documentation

template<class NetworkType , unsigned int Timeout>
bool m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::configureOrderInfo ( uint64_t  id,
const message::ActionType  mtype,
typename message::OrderInfo::Ptr  ptr,
const typename NetworkType::Key &  rec 
)
inlinevirtual

configures the info struct

Implements m2etis::pubsub::order::BaseOrder< NetworkType >.

Definition at line 183 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
void m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::deliver ( uint64_t  a)
inline

the Message with id a shall be delivered This is used to force other instances to deliver a message

Definition at line 326 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
bool m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::hasPending ( )
inlinevirtual

returns whether pending messages exist

Implements m2etis::pubsub::order::BaseOrder< NetworkType >.

Definition at line 169 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
void m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::notifyRemovedMessage ( typename message::OrderInfo::Ptr  ,
const typename NetworkType::Key &   
)
inlinevirtual

notified when message dropped by filter or validity strategy

Implements m2etis::pubsub::order::BaseOrder< NetworkType >.

Definition at line 441 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
void m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::otherOrders ( const std::vector< GMSOrder< NetworkType, Timeout > * > &  others)
inline

stores the instances of the OrderStrategy from the other Channels Also sets the myTree_ variable and initializes subs_

Parameters
[in]otherslist of all order instances from this channel

Definition at line 390 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
bool m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::processControlPayload ( typename message::OrderInfo::Ptr  ptr,
const typename NetworkType::Key &  sender 
)
inlinevirtual

processes a control payload (Root)

Implements m2etis::pubsub::order::BaseOrder< NetworkType >.

Definition at line 290 of file GMSOrder.h.

Here is the call graph for this function:

template<class NetworkType , unsigned int Timeout>
void m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::processNotifyPayload ( typename message::OrderInfo::Ptr  ,
const typename NetworkType::Key &   
)
inlinevirtual

called for every NotifyMsg that arrived

Implements m2etis::pubsub::order::BaseOrder< NetworkType >.

Definition at line 284 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
void m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::processPublishPayload ( typename message::OrderInfo::Ptr  ptr,
const typename NetworkType::Key &   
)
inlinevirtual

processes a publish payload

Implements m2etis::pubsub::order::BaseOrder< NetworkType >.

Definition at line 273 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
void m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::processSubscribePayload ( typename message::OrderInfo::Ptr  ptr,
const typename NetworkType::Key &  sender 
)
inlinevirtual

processes a subscribe payload (Root) the message will be processed on tree 0

Implements m2etis::pubsub::order::BaseOrder< NetworkType >.

Definition at line 247 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
void m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::processUnsubscribePayload ( typename message::OrderInfo::Ptr  ptr,
const typename NetworkType::Key &  sender 
)
inline

Definition at line 267 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
void m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::receive ( uint64_t  id,
typename message::OrderInfo::Ptr  ptr,
const typename NetworkType::Key &  sender 
)
inlinevirtual

called by the Tree whenever a message is ready to be delivered This function stores the messages (to be precise, the corresponding ids) until the controlmessages with orderinformation arrived

Implements m2etis::pubsub::order::BaseOrder< NetworkType >.

Definition at line 368 of file GMSOrder.h.

Here is the call graph for this function:

template<class NetworkType , unsigned int Timeout>
void m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::sendCtrl ( uint64_t  treeId,
uint64_t  msgId 
)
inline

the tree shall publish CtrlMsgs on all trees that have subscribers This function is only used on Tree 0

Parameters
[in]treeIdId of the Tree where the actual message is published
[in]msgIdSequence number used for this message

Definition at line 411 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
void m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::sendCtrl2 ( uint64_t  treeId,
uint64_t  msgId 
)
inline

send a ctrlMsg on this tree

Parameters
[in]treeIdthe real Tree where the message will be sent
[in]msgIdThe Id used for the message

Definition at line 428 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
void m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::setMasterTree ( uint64_t  t)
inline

this node will only accept controlmessages from this tree

Definition at line 176 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
void m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::updateQueue ( )
inline

checks the queue for new messages to deliver

Definition at line 333 of file GMSOrder.h.

Here is the caller graph for this function:

Member Data Documentation

template<class NetworkType , unsigned int Timeout>
uint64_t m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::counter

Definition at line 88 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
std::priority_queue<QueueTuple, std::vector<QueueTuple>, std::greater<QueueTuple> > m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::ctrlQueue_

Queue containing all recieved but not yet further processed ctrl messages.

Definition at line 159 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
std::map<typename NetworkType::Key, uint64_t> m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::mainTree_

Receiver -> Tree that should be used for the Control msg only used in root node.

Definition at line 118 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
uint64_t m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::masterTree

tree on which Control Msgs are expected. Default: None

Definition at line 133 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
uint64_t m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::myTree_

index number of this tree

Definition at line 138 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
uint64_t m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::nextFinished

next ID to be expected

Definition at line 128 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
std::map<typename NetworkType::Key, uint64_t> m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::nextRec_

Sender -> next Seq. Nr. to expect.

Definition at line 113 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
uint64_t m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::nextSend

next number to be used as the global Sequence number

Definition at line 143 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
std::map<typename NetworkType::Key, uint64_t> m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::nextSend_

Receiver -> next Seq. Nr. to use.

Definition at line 109 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
std::vector<GMSOrder *> m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::others_

list of all Order classes from the other trees

Definition at line 98 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
PubSubSystemEnvironment* m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::pssi_

pointer to the PubSubSystemEnvironment

Definition at line 93 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
std::map<MsgIdent, BufId> m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::pubQueue_

stores all NOTIFY msgs that arrived

Definition at line 164 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
std::set<uint64_t> m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::selfSub_

this node is subscribed on these trees

Definition at line 123 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
std::map<typename NetworkType::Key, std::set<uint64_t> > m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::subOn_

which node is subscribed on which tree

Definition at line 148 of file GMSOrder.h.

template<class NetworkType , unsigned int Timeout>
std::vector<std::set<typename NetworkType::Key> > m2etis::pubsub::order::GMSOrder< NetworkType, Timeout >::subs_

for every tree, save all subscribers only neccessary on root node

Definition at line 104 of file GMSOrder.h.


The documentation for this class was generated from the following file: