Class ResourceProvisionerAbstract
java.lang.Object
org.cloudbus.cloudsim.provisioners.ResourceProvisionerAbstract
- All Implemented Interfaces:
ResourceProvisioner
- Direct Known Subclasses:
ResourceProvisionerSimple
An abstract class that implements the basic features of a provisioning policy used by a
Host
to provide a given resource to its virtual machines.- Since:
- 3.0.4
- Author:
- Rodrigo N. Calheiros, Anton Beloglazov, Manoel Campos da Silva Filho
- See Also:
-
Field Summary
Fields inherited from interface org.cloudbus.cloudsim.provisioners.ResourceProvisioner
NULL
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a new ResourceManageable Provisioner for which theresource
must be set further.ResourceProvisionerAbstract
(ResourceManageable pmResource, Function<Vm, ResourceManageable> vmResourceFunction) Creates a new ResourceManageable Provisioner. -
Method Summary
Modifier and TypeMethodDescriptionlong
Gets the amount of resource allocated to a given VM from the physical resourcelong
Gets the amount of free available physical resource from the host that the provisioner can allocate to VMs.long
Gets the total capacity of the physical resource from the Host that the provisioner manages.long
Gets the total amount of resource allocated to all VMs from the physical resourceprotected Function<Vm,
ResourceManageable> final void
setResources
(ResourceManageable pmResource, Function<Vm, ResourceManageable> vmResourceFunction) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cloudbus.cloudsim.provisioners.ResourceProvisioner
allocateResourceForVm, allocateResourceForVm, deallocateResourceForVm, isSuitableForVm, isSuitableForVm
-
Constructor Details
-
ResourceProvisionerAbstract
protected ResourceProvisionerAbstract()Creates a new ResourceManageable Provisioner for which theresource
must be set further. -
ResourceProvisionerAbstract
public ResourceProvisionerAbstract(ResourceManageable pmResource, Function<Vm, ResourceManageable> vmResourceFunction) Creates a new ResourceManageable Provisioner.- Parameters:
pmResource
- The physical resource to be managed by the provisionervmResourceFunction
- aFunction
that receives aVm
and returns the virtual resource corresponding to thePM resource
-
-
Method Details
-
getAllocatedResourceForVm
Description copied from interface:ResourceProvisioner
Gets the amount of resource allocated to a given VM from the physical resource- Specified by:
getAllocatedResourceForVm
in interfaceResourceProvisioner
- Parameters:
vm
- the VM- Returns:
- the allocated resource for the VM
-
getPmResource
Description copied from interface:ResourceProvisioner
- Specified by:
getPmResource
in interfaceResourceProvisioner
- Returns:
- the resource managed by this provisioner
-
setResources
public final void setResources(ResourceManageable pmResource, Function<Vm, ResourceManageable> vmResourceFunction) Description copied from interface:ResourceProvisioner
- Specified by:
setResources
in interfaceResourceProvisioner
- Parameters:
pmResource
- the resource managed by this provisionervmResourceFunction
- aFunction
that receives aVm
and returns the virtual resource corresponding to thePM resource
-
getCapacity
public long getCapacity()Description copied from interface:ResourceProvisioner
Gets the total capacity of the physical resource from the Host that the provisioner manages.- Specified by:
getCapacity
in interfaceResourceProvisioner
- Returns:
- the total physical resource capacity
-
getTotalAllocatedResource
public long getTotalAllocatedResource()Description copied from interface:ResourceProvisioner
Gets the total amount of resource allocated to all VMs from the physical resource- Specified by:
getTotalAllocatedResource
in interfaceResourceProvisioner
- Returns:
- the total allocated resource among all VMs
-
getAvailableResource
public long getAvailableResource()Description copied from interface:ResourceProvisioner
Gets the amount of free available physical resource from the host that the provisioner can allocate to VMs.- Specified by:
getAvailableResource
in interfaceResourceProvisioner
- Returns:
- the amount of free available physical resource
-
getVmResourceFunction
-