Navigation


Changeset 230

Show
Ignore:
Timestamp:
11/13/08 17:21:17 (8 weeks ago)
Author:
tinova
Message:

Merged TransferManager? and VirtualNetworkManager? branches.

Location:
one/trunk
Files:
43 added
53 modified
3 copied

Legend:

Unmodified
Added
Removed
  • one/trunk/SConstruct

    r164 r230  
    3636    cwd+'/src/im', 
    3737    cwd+'/src/rm', 
     38    cwd+'/src/vnm', 
    3839]) 
    3940 
     
    104105    'src/im/SConstruct', 
    105106    'src/dm/SConstruct', 
    106     'src/scheduler/SConstruct',     
     107    'src/scheduler/SConstruct',   
     108    'src/vnm/SConstruct',     
    107109] 
    108110 
  • one/trunk/include/Attribute.h

    r110 r230  
    3434public: 
    3535 
    36     Attribute(string& aname):attribute_name(aname) 
     36    Attribute(const string& aname):attribute_name(aname) 
    3737    { 
    3838        transform ( 
     
    7878     *  Builds a new attribute from a string. 
    7979     */ 
    80     virtual void unmarshall(string& sattr) = 0; 
     80    virtual void unmarshall(const string& sattr) = 0; 
    8181     
    8282    /** 
     
    105105public: 
    106106 
    107     SingleAttribute(string& name):Attribute(name){}; 
    108  
    109     SingleAttribute(string& name, string& value): 
     107    SingleAttribute(const string& name):Attribute(name){}; 
     108 
     109    SingleAttribute(const string& name, const string& value): 
    110110        Attribute(name),attribute_value(value){}; 
    111111     
    112     SingleAttribute(const char * name, string& value): 
     112    SingleAttribute(const char * name, const string& value): 
    113113        Attribute(name),attribute_value(value){}; 
    114114 
     
    140140     *  Builds a new attribute from a string. 
    141141     */     
    142     void unmarshall(string& sattr) 
     142    void unmarshall(const string& sattr) 
    143143    { 
    144144        attribute_value = sattr; 
    145145    }; 
    146      
     146 
     147    /** 
     148     *  Replaces the attribute value from a string. 
     149     */ 
     150    void replace(const string& sattr) 
     151    { 
     152        attribute_value = sattr; 
     153    }; 
     154 
    147155    /** 
    148156     *  Returns the attribute type 
     
    170178public: 
    171179 
    172     VectorAttribute(string& name):Attribute(name){}; 
    173  
    174     VectorAttribute(string& name, map<string,string>& value): 
     180    VectorAttribute(const string& name):Attribute(name){}; 
     181 
     182    VectorAttribute(const string& name,const map<string,string>& value): 
    175183            Attribute(name),attribute_value(value){}; 
    176184 
     
    202210     *  "VAL_NAME_1=VAL_VALUE_1,...,VAL_NAME_N=VAL_VALUE_N". 
    203211     */         
    204     void unmarshall(string& sattr); 
     212    void unmarshall(const string& sattr); 
     213 
     214    /** 
     215     *  Replace the value of the given attribute with the provided map 
     216     */ 
     217    void replace(const map<string,string>& attr); 
     218 
    205219 
    206220    /** 
  • one/trunk/include/DispatchManager.h

    r88 r230  
    215215 
    216216    /** 
    217      *  Pointer to the Host Pool, to access hosts 
     217     *  Pointer to the Virtual Machine Pool, to access hosts 
    218218     */ 
    219219    VirtualMachinePool *    vmpool; 
  • one/trunk/include/History.h

    r10 r230  
    6767    enum ColNames 
    6868    { 
    69         OID             = 0, 
     69        VID             = 0, 
    7070        SEQ             = 1, 
    7171        HOSTNAME        = 2, 
     
    116116 
    117117    string  hostname; 
    118     string  vm_rdir; 
     118    string  vm_dir; 
    119119     
    120120    int     hid; 
     
    139139    //Non-persistent history fields 
    140140    string  vm_lhome; 
     141    string  transfer_file; 
     142    string  deployment_file; 
     143     
    141144    string  vm_rhome; 
    142      
    143     string  deployment_lfile; 
    144     string  deployment_rfile; 
    145      
    146145    string  checkpoint_file; 
    147  
     146    string  rdeployment_file; 
     147     
    148148    friend int history_select_cb ( 
    149149        void *                  _history, 
  • one/trunk/include/Host.h

    r9 r230  
    426426    enum ColNames 
    427427    { 
    428         HID              = 0,  
     428        OID              = 0,  
    429429        HOST_NAME        = 1,  
    430430        STATE            = 2,   
  • one/trunk/include/HostShare.h

    r2 r230  
    172172    enum ColNames 
    173173    { 
    174         HSID         = 0, 
     174        HID          = 0, 
    175175        ENDPOINT     = 1, 
    176176        DISK_USAGE   = 2, 
  • one/trunk/include/Nebula.h

    r3 r230  
    2525 
    2626#include "VirtualMachinePool.h" 
     27#include "VirtualNetworkPool.h" 
    2728#include "HostPool.h" 
    2829 
     
    8889        return hpool; 
    8990    };  
     91     
     92    VirtualNetworkPool * get_vnpool() 
     93    { 
     94        return vnpool; 
     95    }; 
    9096 
    9197    // -------------------------------------------------------------- 
     
    122128    // --------------------------------------------------------------  
    123129     
    124     string& get_nebula_location() 
     130    const string& get_nebula_location() 
    125131    { 
    126132        return nebula_location; 
    127133    }; 
    128134    
     135     
     136    const string& get_nebula_hostname() 
     137    { 
     138        return hostname; 
     139    }; 
     140     
    129141    static string version() 
    130142    { 
    131         return "ONE0.1";    
     143        return "ONE1.1";    
    132144    }; 
    133145     
     
    149161    // ----------------------------------------------------------------------- 
    150162     
    151     Nebula():nebula_configuration(0),db(0),vmpool(0),hpool(0),lcm(0), 
     163    Nebula():nebula_configuration(0),db(0),vmpool(0),hpool(0),vnpool(0),lcm(0), 
    152164        vmm(0),im(0),tm(0),dm(0),rm(0){}; 
    153165     
     
    214226        
    215227    string              nebula_location; 
     228    string                              hostname; 
    216229     
    217230    // --------------------------------------------------------------- 
     
    225238    // --------------------------------------------------------------- 
    226239     
    227     SqliteDB *          db; 
     240    SqliteDB           * db; 
    228241    VirtualMachinePool * vmpool; 
    229     HostPool *           hpool; 
     242    HostPool           * hpool; 
     243    VirtualNetworkPool * vnpool; 
    230244     
    231245    // --------------------------------------------------------------- 
  • one/trunk/include/PoolSQL.h

    r2 r230  
    157157 
    158158    /** 
    159      *  The pool is implemented with a Map, of SQL object pointers, using the  
     159     *  The pool is implemented with a Map of SQL object pointers, using the  
    160160     *  OID as key. 
    161161     */ 
     
    176176    /** 
    177177     *  FIFO-like replacement policy function. Before removing an object (pop) 
    178      *  from  the cache it's lock is checked. The object is removed only if  
     178     *  from  the cache its lock is checked. The object is removed only if  
    179179     *  the associated mutex IS NOT blocked. Otherwise the oid is sent to the  
    180180     *  back of the queue.   
  • one/trunk/include/RequestManager.h

    r104 r230  
    2222#include "VirtualMachinePool.h" 
    2323#include "HostPool.h" 
    24  
     24#include "VirtualNetworkPool.h" 
    2525 
    2626#include <xmlrpc-c/base.hpp> 
     
    4141        VirtualMachinePool *    _vmpool, 
    4242        HostPool *              _hpool, 
     43        VirtualNetworkPool *    _vnpool, 
    4344        int                     _port, 
    4445        string                  _xml_log_file) 
    45             :vmpool(_vmpool),hpool(_hpool),port(_port),socket_fd(-1), 
     46            :vmpool(_vmpool),hpool(_hpool),vnpool(_vnpool),port(_port),socket_fd(-1), 
    4647            xml_log_file(_xml_log_file) 
    4748    { 
     
    99100 
    100101    /** 
     102     *  Pointer to the VM Pool, to access Virtual Machines 
     103     */ 
     104    VirtualMachinePool *    vmpool; 
     105 
     106    /** 
    101107     *  Pointer to the Host Pool, to access hosts 
    102108     */ 
    103     VirtualMachinePool *    vmpool; 
    104  
    105     /** 
    106      *  Pointer to the Host Pool, to access hosts 
    107      */ 
    108109    HostPool *              hpool; 
     110     
     111    /** 
     112     *  Pointer to the VN Pool, to access Virtual Netowrks 
     113     */ 
     114    VirtualNetworkPool *    vnpool; 
    109115 
    110116    /** 
     
    353359        HostPool * hpool; 
    354360 
    355     };     
     361    };    
     362     
     363    /* ---------------------------------------------------------------------- */ 
     364    /*                      Virtual Network Interface                         */     
     365    /* ---------------------------------------------------------------------- */ 
     366     
     367     
     368    class VirtualNetworkAllocate: public xmlrpc_c::method 
     369    { 
     370    public: 
     371        VirtualNetworkAllocate(VirtualNetworkPool * _vnpool):vnpool(_vnpool) 
     372        { 
     373            _signature="A:ss"; 
     374            _help="Creates a virtual network"; 
     375        }; 
     376 
     377        ~VirtualNetworkAllocate(){}; 
     378 
     379        void execute( 
     380            xmlrpc_c::paramList const& paramList, 
     381            xmlrpc_c::value *   const  retvalP); 
     382 
     383    private: 
     384        VirtualNetworkPool * vnpool; 
     385    };  
     386     
     387    /* ---------------------------------------------------------------------- */ 
     388     
     389    class VirtualNetworkInfo: public xmlrpc_c::method 
     390    { 
     391    public: 
     392        VirtualNetworkInfo(VirtualNetworkPool * _vnpool):vnpool(_vnpool) 
     393        { 
     394            _signature="A:si"; 
     395            _help="Returns virtual network information"; 
     396        }; 
     397 
     398        ~VirtualNetworkInfo(){}; 
     399 
     400        void execute( 
     401            xmlrpc_c::paramList const& paramList, 
     402            xmlrpc_c::value *   const  retvalP); 
     403 
     404    private: 
     405        VirtualNetworkPool * vnpool; 
     406 
     407    }; 
     408     
     409    /* ---------------------------------------------------------------------- */ 
     410 
     411    class VirtualNetworkDelete: public xmlrpc_c::method 
     412    { 
     413    public: 
     414        VirtualNetworkDelete(VirtualNetworkPool * _vnpool):vnpool(_vnpool) 
     415        { 
     416            _signature="A:si"; 
     417            _help="Deletes a virtual network"; 
     418        }; 
     419 
     420        ~VirtualNetworkDelete(){}; 
     421 
     422        void execute( 
     423            xmlrpc_c::paramList const& paramList, 
     424            xmlrpc_c::value *   const  retvalP); 
     425 
     426    private: 
     427        VirtualNetworkPool * vnpool; 
     428 
     429    }; 
    356430}; 
    357431 
  • one/trunk/include/Template.h

    r3 r230  
    9797     */ 
    9898    virtual int get( 
    99         string& name,  
     99        const string& name,  
    100100        vector<const Attribute*>& values) const; 
     101 
     102    /** 
     103     *  Gets all the attributes with the given name,  non-const version 
     104     *    @param name the attribute name. 
     105     *    @returns the number of elements in the vector 
     106     */ 
     107    virtual int get( 
     108        const string& name,  
     109        vector<Attribute*>& values); 
    101110         
    102111    /** 
  • one/trunk/include/TemplateSQL.h

    r65 r230  
    9393     *    @param value of the new attribute.  
    9494     */ 
    95     int replace_attribute(SqliteDB * db, string& name, string& value);     
     95    int replace_attribute(SqliteDB * db, const string& name, const string& value);  
     96     
    9697}; 
    9798 
  • one/trunk/include/TransferManager.h

    r2 r230  
    2323#include "VirtualMachinePool.h" 
    2424#include "LifeCycleManager.h" 
     25#include "TransferManagerDriver.h" 
    2526 
    2627using namespace std; 
     
    3334 
    3435    TransferManager( 
    35         VirtualMachinePool *        pool, 
     36        VirtualMachinePool *            _vmpool, 
     37        HostPool *                      _hpool, 
    3638        vector<const Attribute*>&   _mads): 
    3739            MadManager(_mads), 
    38             hpool(pool) 
     40            vmpool(_vmpool), 
     41            hpool(_hpool) 
    3942    { 
    4043        am.addListener(this); 
     
    4649    { 
    4750        PROLOG, 
     51        PROLOG_MIGR, 
     52        PROLOG_RESUME, 
    4853        EPILOG, 
     54        EPILOG_STOP, 
    4955        CHECKPOINT, 
    5056        FINALIZE 
     
    7682     *   sudo application.  
    7783     */ 
    78     void load_mads(int uid){}; 
     84    void load_mads(int uid); 
    7985         
    8086    /** 
     
    94100 
    95101    /** 
    96      *  Pointer to the VM Pool, to access virtual machines 
     102     *  Pointer to the Virtual Machine Pool, to access VMs 
    97103     */ 
    98     VirtualMachinePool *    hpool; 
     104    VirtualMachinePool *    vmpool; 
     105 
     106    /** 
     107     *  Pointer to the Host Pool, to access hosts 
     108     */ 
     109    HostPool *              hpool; 
    99110      
    100111    /** 
    101112     *  Action engine for the Manager 
    102113     */ 
    103     ActionManager   am; 
     114    ActionManager               am; 
    104115 
     116    /** 
     117     *  Returns a pointer to a Transfer Manager driver. 
     118     *    @param uid of the owner of the driver 
     119     *    @param name of an attribute of the driver (e.g. its type) 
     120     *    @param value of the attribute 
     121     *    @return the TM driver owned by uid with attribute name equal to value 
     122     *    or 0 in not found 
     123     */ 
     124    const TransferManagerDriver * get( 
     125        int             uid, 
     126        const string&   name, 
     127        const string&   value) 
     128    { 
     129        return static_cast<const TransferManagerDriver *> 
     130               (MadManager::get(uid,name,value)); 
     131    }; 
     132 
     133    /** 
     134     *  Returns a pointer to a Transfer Manager driver. The driver is  
     135     *  searched by its name.