#include <DistRUSHp.h>
Public Member Functions | |
DistRUSHp (int argc, char **argv) | |
DistRUSHp (const DistRUSHp &orig) | |
DistRUSHp (xercesc::DOMElement *data) | |
virtual | ~DistRUSHp () |
double | hash (int64_t key1, int64_t key2, int64_t key3) const |
virtual std::list< Disk * > * | placeExtent (int64_t virtualVolumeId, int64_t position) |
virtual void | setClusters (std::list< std::list< Disk * > * > *clusters, std::list< uint32_t > *weights) |
virtual void | setConfiguration (std::list< Disk * > *disks, int64_t extentsize, int32_t copies) |
virtual void | setDisks (std::list< Disk * > *disks) |
virtual std::list< Disk * > * | getDisks () const |
virtual int64_t | getExtentsize () const |
virtual int32_t | getCopies () const |
virtual xercesc::DOMElement * | toXML (xercesc::DOMDocument *doc) const |
Disk * | RUSHp (int64_t x, int64_t r, int32_t j) const |
Static Public Member Functions | |
static std::string | getXMLRootType () |
DistRUSHp::DistRUSHp | ( | int | argc, |
char ** | argv | ||
) |
DistRUSHp::DistRUSHp | ( | const DistRUSHp & | orig ) |
DistRUSHp::DistRUSHp | ( | xercesc::DOMElement * | data ) |
DistRUSHp::~DistRUSHp | ( | ) | [virtual] |
int32_t DistRUSHp::getCopies | ( | ) | const [virtual] |
Get the number of copies of each extents to be placed as passed to setConfiguration.
Implements VDRIVE::Distributor.
std::list< Disk * > * DistRUSHp::getDisks | ( | ) | const [virtual] |
Get the Disks used by this object as passed to setDisks or setConfiguration.
The returned list of Disk object as the Disk objects itself belong the caller of this method. A Distributor creates copy of his Disk objects which are send back in this list. Therefore the caller has to delete the list and the Disk objects in the list if it is no more used.
Implements VDRIVE::Distributor.
int64_t DistRUSHp::getExtentsize | ( | ) | const [virtual] |
Get the Size of the Extents passed to this object as passed to setConfiguration.
Implements VDRIVE::Distributor.
static std::string VDRIVE::DistRUSHp::getXMLRootType | ( | ) | [inline, static] |
double DistRUSHp::hash | ( | int64_t | key1, |
int64_t | key2, | ||
int64_t | key3 | ||
) | const |
hash function for RUSHp takes 3 parameters
std::list< Disk * > * DistRUSHp::placeExtent | ( | int64_t | virtualVolumeId, |
int64_t | position | ||
) | [virtual] |
Compute the Disks to be used to place the Extent at position at the given virtualVolumeID. This method has to be implemented by the subclasses of Distributor.
The returned list of Disk object as the Disk objects itself belong the caller of this method. A Distributor creates copy of his Disk objects which are send back in this list. Therefore the caller has to delete the list and the Disk objects in the list if it is no more used.
virtualVolumeId | A ID referencing the virtual volume the Extent belongs to (therefore several virtual Volumes can use the same disks) |
position | The position of the Extent on the virtual Volume |
Implements VDRIVE::Distributor.
Disk * DistRUSHp::RUSHp | ( | int64_t | x, |
int64_t | r, | ||
int32_t | j | ||
) | const |
virtual void VDRIVE::DistRUSHp::setClusters | ( | std::list< std::list< Disk * > * > * | clusters, |
std::list< uint32_t > * | weights | ||
) | [virtual] |
Reimplemented from VDRIVE::Distributor.
void DistRUSHp::setConfiguration | ( | std::list< Disk * > * | disks, |
int64_t | extentsize, | ||
int32_t | copies | ||
) | [virtual] |
Set the configuration of the Distributor. This method has to be called exacly once on each Object. It initializes the object, so it can be used to place extents. This method has to be implemented by the subclasses of Distributor.
The list of Disks as the Disk objects itself belong the caller of this method. A Distributor creates copy of the Disk objects. Therefore the caller has to delete the list and the Disk objects in the list if it is no more used.
disks | A list with the description of the Disks to distribute data over. |
extentsize | The size of each extent placed on the disk in bytes. (This can also be in any other scale, but has to be same for capacity of the Disks) |
copies | The number of Disks used to place eache Extent. If a RAID is used upon the Extents this would be the stripe size. |
Implements VDRIVE::Distributor.
void DistRUSHp::setDisks | ( | std::list< Disk * > * | disks ) | [virtual] |
Change the Disks used by this Distributor.
The list of Disks as the Disk objects itself belong the caller of this method. A Distributor creates copy of the Disk objects. Therefore the caller has to delete the list and the Disk objects in the list if it is no more used.
disks | The Disks, that now should be used. |
Implements VDRIVE::Distributor.
xercesc::DOMElement * DistRUSHp::toXML | ( | xercesc::DOMDocument * | doc ) | const [virtual] |
build an XML-Version of this object
doc | the document needed to create new XML Elements |
Implements VDRIVE::Distributor.