public abstract class ResourceProvisionerAbstract extends Object implements ResourceProvisioner
Host
to provide a given resource to its virtual machines.ResourceProvisioner
NULL
Modifier | Constructor and Description |
---|---|
protected |
ResourceProvisionerAbstract()
Creates a new ResourceManageable Provisioner for which the
resource
must be set further. |
|
ResourceProvisionerAbstract(ResourceManageable resource)
Creates a new ResourceManageable Provisioner.
|
Modifier and Type | Method and Description |
---|---|
void |
deallocateResourceForAllVms()
Releases all the allocated amount of the resource used by all VMs.
|
protected abstract long |
deallocateResourceForVmAndSetAllocationMapEntryToZero(Vm vm)
Deallocate the resource for the given VM, without removing
the VM fro the allocation map.
|
long |
getAllocatedResourceForVm(Vm vm)
Gets the amount of resource allocated to a given VM from the physical resource
|
long |
getAvailableResource()
Gets the amount of free available physical resource from the host that the provisioner can allocate to VMs.
|
long |
getCapacity()
Gets the total capacity of the physical resource from the Host that the provisioner manages.
|
ResourceManageable |
getResource()
|
protected Map<Vm,Long> |
getResourceAllocationMap()
Gets the VM resource allocation map, where each key is a VM and each value
is the amount of resource allocated to that VM.
|
protected Class<? extends ResourceManageable> |
getResourceClass()
Gets the class of the resource that this provisioner manages.
|
long |
getTotalAllocatedResource()
Gets the total amount of resource allocated to all VMs from the physical resource
|
boolean |
isResourceAllocatedToVm(Vm vm)
Checks if the resource the provisioner manages is allocated to a given Vm.
|
void |
setResource(ResourceManageable resource)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allocateResourceForVm, allocateResourceForVm, deallocateResourceForVm, isSuitableForVm
protected ResourceProvisionerAbstract()
resource
must be set further.public ResourceProvisionerAbstract(ResourceManageable resource)
resource
- The resource to be managed by the provisionerpublic long getAllocatedResourceForVm(Vm vm)
ResourceProvisioner
getAllocatedResourceForVm
in interface ResourceProvisioner
vm
- the VMpublic void deallocateResourceForAllVms()
ResourceProvisioner
deallocateResourceForAllVms
in interface ResourceProvisioner
protected abstract long deallocateResourceForVmAndSetAllocationMapEntryToZero(Vm vm)
vm
- the VM to deallocate resourcepublic ResourceManageable getResource()
ResourceProvisioner
getResource
in interface ResourceProvisioner
public final void setResource(ResourceManageable resource)
ResourceProvisioner
setResource
in interface ResourceProvisioner
resource
- the resource managed by this provisionerprotected Class<? extends ResourceManageable> getResourceClass()
protected Map<Vm,Long> getResourceAllocationMap()
public long getCapacity()
ResourceProvisioner
getCapacity
in interface ResourceProvisioner
public long getTotalAllocatedResource()
ResourceProvisioner
getTotalAllocatedResource
in interface ResourceProvisioner
public long getAvailableResource()
ResourceProvisioner
getAvailableResource
in interface ResourceProvisioner
public boolean isResourceAllocatedToVm(Vm vm)
ResourceProvisioner
isResourceAllocatedToVm
in interface ResourceProvisioner
vm
- the VM to check if the resource is allocated toCopyright © 2015–2018 Systems, Security and Image Communication Lab - Instituto de Telecomunicações (IT) - Universidade da Beira Interior (UBI) - Instituto Federal de Educação Ciência e Tecnologia do Tocantins (IFTO). All rights reserved.