58 lines
1.6 KiB
C++
58 lines
1.6 KiB
C++
/*
|
|
* File: CreateMasterFirstPeerPlacingStrategy.h
|
|
* Author: schnegri
|
|
*
|
|
* Created on March 3, 2011 11:30 AM
|
|
*/
|
|
#pragma once
|
|
|
|
#ifndef CREATEMASTERFIRSTPEERPLACINGSTRATEGY_H
|
|
#define CREATEMASTERFIRSTPEERPLACINGSTRATEGY_H
|
|
|
|
#include "PeerPlacingStrategy.h"
|
|
|
|
|
|
namespace ubeeme {
|
|
namespace moversight {
|
|
|
|
/**
|
|
* @brief Implements a peer placing strategy. The strategy creates the defined number of clusters first by creating their masters.
|
|
*
|
|
* The CreateMasterFirstPeerPlacingStrategy manages the placement of the peers within the group. The placing metric is defined by creating the master peer first.
|
|
* @class CreateMasterFirstPeerPlacingStrategy
|
|
* @author Grit Schneider
|
|
* @ingroup Moversight
|
|
*/
|
|
class CreateMasterFirstPeerPlacingStrategy : public PeerPlacingStrategy {
|
|
public:
|
|
|
|
CreateMasterFirstPeerPlacingStrategy(MemberRegister & aRegister);
|
|
|
|
virtual ~CreateMasterFirstPeerPlacingStrategy();
|
|
|
|
virtual void placePeer(Peer & peer);
|
|
|
|
virtual bool isMovePeerPossible(PeerID pId, ClusterID srcClusterId, ClusterID destClusterId);
|
|
|
|
PeerID determinePossibleNewMaster(ClusterID cID);
|
|
|
|
ClusterID getClusterID();
|
|
|
|
PeerPlacingStrategy * clone() const;
|
|
|
|
private:
|
|
|
|
void init();
|
|
|
|
virtual ClusterSize determinePeerLocation(ClusterSizeList & csList);
|
|
|
|
/**
|
|
* @brief The cluster ID of the peer placed lastly
|
|
*/
|
|
ClusterID lastCId;
|
|
|
|
};
|
|
}
|
|
}
|
|
#endif /* AVERAGEPEERPLACINGSTRATEGY_H */
|