Differential D19762 Diff 47220 src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | /* -( Lease Acquisition )-------------------------------------------------- */ | ||||
* @return void | * @return void | ||||
* @task lease | * @task lease | ||||
*/ | */ | ||||
abstract public function destroyLease( | abstract public function destroyLease( | ||||
DrydockBlueprint $blueprint, | DrydockBlueprint $blueprint, | ||||
DrydockResource $resource, | DrydockResource $resource, | ||||
DrydockLease $lease); | DrydockLease $lease); | ||||
/** | |||||
* Return true to try to allocate a new resource and expand the resource | |||||
* pool instead of permitting an otherwise valid acquisition on an existing | |||||
* resource. | |||||
* | |||||
* This allows the blueprint to provide a soft hint about when the resource | |||||
* pool should grow. | |||||
* | |||||
* Returning "true" in all cases generally makes sense when a blueprint | |||||
* controls a fixed pool of resources, like a particular number of physical | |||||
* hosts: you want to put all the hosts in service, so whenever it is | |||||
* possible to allocate a new host you want to do this. | |||||
* | |||||
* Returning "false" in all cases generally make sense when a blueprint | |||||
* has a flexible pool of expensive resources and you want to pack leases | |||||
* onto them as tightly as possible. | |||||
* | |||||
* @param DrydockBlueprint The blueprint for an existing resource being | |||||
* acquired. | |||||
* @param DrydockResource The resource being acquired, which we may want to | |||||
* build a supplemental resource for. | |||||
* @param DrydockLease The current lease performing acquisition. | |||||
* @return bool True to prefer allocating a supplemental resource. | |||||
* | |||||
* @task lease | |||||
*/ | |||||
public function shouldAllocateSupplementalResource( | |||||
DrydockBlueprint $blueprint, | |||||
DrydockResource $resource, | |||||
DrydockLease $lease) { | |||||
return false; | |||||
} | |||||
/* -( Resource Allocation )------------------------------------------------ */ | /* -( Resource Allocation )------------------------------------------------ */ | ||||
/** | /** | ||||
* Enforce fundamental implementation/lease checks. Allows implementations to | * Enforce fundamental implementation/lease checks. Allows implementations to | ||||
* reject a lease which no concrete blueprint can ever satisfy. | * reject a lease which no concrete blueprint can ever satisfy. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 345 Lines • Show Last 20 Lines |