• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

DistFastRedundantShare.h

Go to the documentation of this file.
00001 /* 
00002  * File:   FastRedundantShare.h
00003  * Author: fermat
00004  *
00005  * Created on 27. März 2010, 12:18
00006  */
00007 
00008 #ifndef _FASTREDUNDANTSHARE_H
00009 #define _FASTREDUNDANTSHARE_H
00010 
00011 #include"DistRedundantShare.h"
00012 #include "DistShare.h"
00013 #include<limits>
00014 #include<string>
00015 #include<sstream>
00016 #include<iostream>
00017 #include"helper.h"
00018 
00019 #define VDRIVE_FRS_KMAP std::tr1::unordered_map<int64_t, DistShare*>
00020 #define VDRIVE_FRS_KMAPit VDRIVE_FRS_KMAP::iterator
00021 #define VDRIVE_FRS_MMAP std::tr1::unordered_map<int32_t, VDRIVE_FRS_KMAP *>
00022 #define VDRIVE_FRS_MMAPit VDRIVE_FRS_MMAP::iterator
00023 
00024 #define VDRIVE_FRS_DISKMAP std::tr1::unordered_map<int64_t, Disk*>
00025 #define VDRIVE_FRS_DISKMAPit VDRIVE_FRS_DISKMAP::iterator
00026 
00027 namespace VDRIVE {
00028 
00034     class DistFastRedundantShare : public Distributor {
00035     public:
00039         DistFastRedundantShare(int argc, char** argv);
00040         DistFastRedundantShare(xercesc::DOMElement* data);
00041         DistFastRedundantShare(const DistFastRedundantShare& orig);
00042         virtual ~DistFastRedundantShare();
00043 
00047         virtual std::list<Disk*>* placeExtent(int64_t virtualVolumeId, int64_t position) ;
00048 
00052         virtual void setConfiguration(std::list<Disk*>* disks, int64_t extentsize, int32_t copies);
00053 
00057         virtual void setDisks(std::list<Disk*>* disks);
00058 
00062         virtual xercesc::DOMElement* toXML(xercesc::DOMDocument* doc) const;
00063 
00069         static std::string getXMLRootType() {
00070             return std::string("FastRedundantShare");
00071         }
00072 
00076         virtual std::list<Disk*>* getDisks() const;
00077 
00081         virtual int64_t getExtentsize() const {
00082             return extentsize;
00083         }
00084 
00088         virtual int32_t getCopies() const {
00089             return copies;
00090         }
00091 
00098         virtual void setBaseMessage(uint8_t* baseMessage);
00099         
00100     private:
00105         VDRIVE_FRS_MMAP *distributors;
00106 
00110         int32_t copies;
00111 
00115         int64_t extentsize;
00116 
00120         VDRIVE_FRS_DISKMAP *disks;
00121 
00126         void initShareStructures(DistRedundantShare *rs);
00127         
00140         DistShare* createShare(RSDisk** disks, int32_t first, int32_t last, int32_t k);
00141 
00142     };
00143 }
00144 #endif  /* _FASTREDUNDANTSHARE_H */
00145 

Generated on Mon Oct 11 2010 13:09:26 for CppDistributors by  doxygen 1.7.2