public class DefaultResourceTracker extends Object implements ResourceTracker
ResourceTracker
implementation.Constructor and Description |
---|
DefaultResourceTracker() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all state from the tracker.
|
Collection<ResourceRequirement> |
getAcquiredResources(JobID jobId)
Returns a collection of
ResourceRequirement s that describe which resources have been
assigned to a job. |
Map<JobID,Collection<ResourceRequirement>> |
getMissingResources()
Returns a collection of
ResourceRequirements that describe which resources the
corresponding job is missing. |
boolean |
isRequirementEmpty(JobID jobId)
Returns whether the
ResourceRequirement of the given job is empty. |
void |
notifyAcquiredResource(JobID jobId,
ResourceProfile resourceProfile)
Notifies the tracker about the acquisition of a resource with the given resource profile, for
the given job.
|
void |
notifyLostResource(JobID jobId,
ResourceProfile resourceProfile)
Notifies the tracker about the loss of a resource with the given resource profile, for the
given job.
|
void |
notifyResourceRequirements(JobID jobId,
Collection<ResourceRequirement> resourceRequirements)
Notifies the tracker about a new or updated
ResourceRequirements . |
public void notifyResourceRequirements(JobID jobId, Collection<ResourceRequirement> resourceRequirements)
ResourceTracker
ResourceRequirements
.notifyResourceRequirements
in interface ResourceTracker
jobId
- the job that the resource requirements belongs toresourceRequirements
- new resource requirementspublic void notifyAcquiredResource(JobID jobId, ResourceProfile resourceProfile)
ResourceTracker
notifyAcquiredResource
in interface ResourceTracker
jobId
- the job that acquired the resourceresourceProfile
- profile of the resourcepublic void notifyLostResource(JobID jobId, ResourceProfile resourceProfile)
ResourceTracker
notifyLostResource
in interface ResourceTracker
jobId
- the job that lost the resourceresourceProfile
- profile of the resourcepublic void clear()
ResourceTracker
clear
in interface ResourceTracker
public Map<JobID,Collection<ResourceRequirement>> getMissingResources()
ResourceTracker
ResourceRequirements
that describe which resources the
corresponding job is missing.getMissingResources
in interface ResourceTracker
public Collection<ResourceRequirement> getAcquiredResources(JobID jobId)
ResourceTracker
ResourceRequirement
s that describe which resources have been
assigned to a job.getAcquiredResources
in interface ResourceTracker
jobId
- job IDpublic boolean isRequirementEmpty(JobID jobId)
ResourceTracker
ResourceRequirement
of the given job is empty.isRequirementEmpty
in interface ResourceTracker
jobId
- job IDResourceRequirement
of the given job is emptyCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.