Public Member Functions | Static Public Member Functions

VDRIVE::DistRUSHp Class Reference

#include <DistRUSHp.h>

Inheritance diagram for VDRIVE::DistRUSHp:
Inheritance graph
[legend]
Collaboration diagram for VDRIVE::DistRUSHp:
Collaboration graph
[legend]

List of all members.

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
DiskRUSHp (int64_t x, int64_t r, int32_t j) const

Static Public Member Functions

static std::string getXMLRootType ()

Constructor & Destructor Documentation

DistRUSHp::DistRUSHp ( int  argc,
char **  argv 
)
DistRUSHp::DistRUSHp ( const DistRUSHp orig )
DistRUSHp::DistRUSHp ( xercesc::DOMElement *  data )
DistRUSHp::~DistRUSHp (  ) [virtual]

Member Function Documentation

int32_t DistRUSHp::getCopies (  ) const [virtual]

Get the number of copies of each extents to be placed as passed to setConfiguration.

Returns:
the number of copies of each extents to be placed

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.

Returns:
The disks used by this object

Implements VDRIVE::Distributor.

int64_t DistRUSHp::getExtentsize (  ) const [virtual]

Get the Size of the Extents passed to this object as passed to setConfiguration.

Returns:
the Size of the Extents passed to this object.

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.

Parameters:
virtualVolumeIdA ID referencing the virtual volume the Extent belongs to (therefore several virtual Volumes can use the same disks)
positionThe position of the Extent on the virtual Volume
Returns:
The Disks the Extent has to be placed on. All returned Objects have to be deleted by caller of this method.

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.

Parameters:
disksA list with the description of the Disks to distribute data over.
extentsizeThe 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)
copiesThe number of Disks used to place eache Extent. If a RAID is used upon the Extents this would be the stripe size.
Returns:
A list with the Disks, that shall be used

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.

Parameters:
disksThe 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

Parameters:
docthe document needed to create new XML Elements
Returns:
a new Element containing the description of this object.

Implements VDRIVE::Distributor.


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