Public Member Functions | Static Public Member Functions | Protected Member Functions

VDRIVE::DistNearestNeighbour Class Reference

#include <DistNearestNeighbour.h>

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

List of all members.

Public Member Functions

 DistNearestNeighbour (xercesc::DOMElement *data)
 DistNearestNeighbour (int argc, char **argv)
 DistNearestNeighbour (bool staticNNCopies, int32_t nnCopies, int32_t nnCopiesFactor)
 DistNearestNeighbour (const DistNearestNeighbour &orig)
virtual ~DistNearestNeighbour ()
virtual std::list< Disk * > * placeExtent (int64_t virtualVolumeId, int64_t position)
virtual void setDisksMulti (std::list< Disk * > *disks, VDRIVE_DNN_MULT *multiplicity)
virtual void setConfiguration (std::list< Disk * > *disks, int64_t extentsize, int32_t copies)
virtual void setDisks (std::list< Disk * > *disks)
virtual xercesc::DOMElement * toXML (xercesc::DOMDocument *doc) const
virtual std::list< Disk * > * getDisks () const
virtual int64_t getExtentsize () const
virtual int32_t getCopies () const

Static Public Member Functions

static std::string getXMLRootType ()

Protected Member Functions

virtual int32_t getNNCopies (std::list< Disk * > *disks) const

Detailed Description

Implementation of the Nearest Neighbour strategy (same as Consistent Hashing)

Author:
Sascha Effert <fermat@uni-paderborn.de>

Constructor & Destructor Documentation

DistNearestNeighbour::DistNearestNeighbour ( xercesc::DOMElement *  data )

Create a new instance from the data in the given XML Element.

Parameters:
dataAn XML-Element containing the description of a DistNearestNeighbour.
DistNearestNeighbour::DistNearestNeighbour ( int  argc,
char **  argv 
)

generate a new, uninitialized Nearest Neighbor Implementation.

DistNearestNeighbour::DistNearestNeighbour ( bool  staticNNCopies,
int32_t  nnCopies,
int32_t  nnCopiesFactor 
)

generate a new, uninitialized Nearest Neigbour Implementation which will place nnCopies of each Disk on the ring.

Parameters:
nnCopiesThe number of times each disk shall be placed on the ring.
DistNearestNeighbour::DistNearestNeighbour ( const DistNearestNeighbour orig )

copy constructor

Parameters:
origoriginal DistNearestNeighbour
DistNearestNeighbour::~DistNearestNeighbour (  ) [virtual]

Destructor


Member Function Documentation

virtual int32_t VDRIVE::DistNearestNeighbour::getCopies (  ) const [inline, virtual]
std::list< Disk * > * DistNearestNeighbour::getDisks (  ) const [virtual]
virtual int64_t VDRIVE::DistNearestNeighbour::getExtentsize (  ) const [inline, virtual]
int32_t DistNearestNeighbour::getNNCopies ( std::list< Disk * > *  disks ) const [protected, virtual]

Get the number of copies of each Disk to be placed. To get a failure of epsilon you need to place

\[\frac{1}{\epsilon^2}\cdot \mbox{log}_2(n)\]

copies of each disk, where n is the number of disks. This method may be overwritten by drived classes to use other values. If the object was created with a static nnCount, this one will be given back.

Parameters:
disksthe disks that shall be placed
Returns:
number of copies of each Disk to be placed.
static std::string VDRIVE::DistNearestNeighbour::getXMLRootType (  ) [inline, static]

Get the Root-Type of XML-Elements representing this class.

Returns:
the Root-Type of XML-Elements representing this class.
std::list< Disk * > * DistNearestNeighbour::placeExtent ( int64_t  virtualVolumeId,
int64_t  position 
) [virtual]
void DistNearestNeighbour::setConfiguration ( std::list< Disk * > *  disks,
int64_t  extentsize,
int32_t  copies 
) [virtual]
void DistNearestNeighbour::setDisks ( std::list< Disk * > *  disks ) [virtual]
void DistNearestNeighbour::setDisksMulti ( std::list< Disk * > *  disks,
VDRIVE_DNN_MULT *  multiplicity 
) [virtual]

This function is used by Share to initialize a NearestNeighbour where each Disk may be inserted several times if it surrounds the ring.

virtual xercesc::DOMElement* VDRIVE::DistNearestNeighbour::toXML ( xercesc::DOMDocument *  doc ) const [virtual]

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