雲端運算模擬工具中文注釋VmAllocationPolicy.java

來源:互聯網
上載者:User
/* * Title:        CloudSim Toolkit * Description:  CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html * * Copyright (c) 2009-2010, The University of Melbourne, Australia */package org.cloudbus.cloudsim;import java.util.List;import java.util.Map;/** * host分配策略,給定一個vm需要選擇一個host來運行 * VmAllocationPolicy is an abstract class that represents the provisioning * policy of hosts to virtual machines in a Datacentre. It supports two-stage * commit of reservation of hosts: first, we reserve the host and, once * commited by the user, it is effectivelly allocated to he/she * * @authorRodrigo N. Calheiros * @authorAnton Beloglazov * @sinceCloudSim Toolkit 1.0 */public abstract class VmAllocationPolicy {/** The host list. */private List<? extends Host> hostList;/** * Allocates a new VmAllocationPolicy object. * * @param list Machines available in this Datacentre * * @pre $none * @post $none */public VmAllocationPolicy(List<? extends Host> list) {setHostList(list);}/** * Allocates a host for a given VM. The host to be allocated is the one * that was already reserved. * * @param vm virtual machine which the host is reserved to * * @return $true if the host could be allocated; $false otherwise * * @pre $none * @post $none */public abstract boolean allocateHostForVm(Vm vm);/** * Allocates a specified host for a given VM. * * @param vm virtual machine which the host is reserved to * * @return $true if the host could be allocated; $false otherwise * * @pre $none * @post $none */public abstract boolean allocateHostForVm(Vm vm, Host host);/** * Optimize allocation of the VMs according to current utilization. * * @param vmList the vm list * @param utilizationBound the utilization bound * @param time the time * * @return the array list< hash map< string, object>> */public abstract List<Map<String, Object>> optimizeAllocation(List<? extends Vm> vmList);/** * Releases the host used by a VM. * * @param vm the vm * * @pre $none * @post $none */public abstract void deallocateHostForVm(Vm vm);/** * Get the host that is executing the given VM belonging to the * given user. * * @param vm the vm * * @return the Host with the given vmID and userID; $null if not found * * @pre $none * @post $none */public abstract Host getHost(Vm vm);/** * Get the host that is executing the given VM belonging to the * given user. * * @param vmId the vm id * @param userId the user id * * @return the Host with the given vmID and userID; $null if not found * * @pre $none * @post $none */public abstract Host getHost(int vmId, int userId);/** * Sets the host list. * * @param hostList the new host list */protected void setHostList(List<? extends Host> hostList) {this.hostList = hostList;}/** * Gets the host list. * * @return the host list */@SuppressWarnings("unchecked")public <T extends Host> List<T> getHostList() {return (List<T>) hostList;}}

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.