Class DefaultResourceTracker
- java.lang.Object
-
- org.apache.flink.runtime.resourcemanager.slotmanager.DefaultResourceTracker
-
- All Implemented Interfaces:
ResourceTracker
public class DefaultResourceTracker extends Object implements ResourceTracker
DefaultResourceTracker
implementation.
-
-
Constructor Summary
Constructors Constructor Description DefaultResourceTracker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Removes all state from the tracker.Collection<ResourceRequirement>
getAcquiredResources(org.apache.flink.api.common.JobID jobId)
Returns a collection ofResourceRequirement
s that describe which resources have been assigned to a job.Map<org.apache.flink.api.common.JobID,Collection<ResourceRequirement>>
getMissingResources()
Returns a collection ofResourceRequirements
that describe which resources the corresponding job is missing.boolean
isRequirementEmpty(org.apache.flink.api.common.JobID jobId)
Returns whether theResourceRequirement
of the given job is empty.void
notifyAcquiredResource(org.apache.flink.api.common.JobID jobId, ResourceProfile resourceProfile)
Notifies the tracker about the acquisition of a resource with the given resource profile, for the given job.void
notifyLostResource(org.apache.flink.api.common.JobID jobId, ResourceProfile resourceProfile)
Notifies the tracker about the loss of a resource with the given resource profile, for the given job.void
notifyResourceRequirements(org.apache.flink.api.common.JobID jobId, Collection<ResourceRequirement> resourceRequirements)
Notifies the tracker about a new or updatedResourceRequirements
.
-
-
-
Method Detail
-
notifyResourceRequirements
public void notifyResourceRequirements(org.apache.flink.api.common.JobID jobId, Collection<ResourceRequirement> resourceRequirements)
Description copied from interface:ResourceTracker
Notifies the tracker about a new or updatedResourceRequirements
.- Specified by:
notifyResourceRequirements
in interfaceResourceTracker
- Parameters:
jobId
- the job that the resource requirements belongs toresourceRequirements
- new resource requirements
-
notifyAcquiredResource
public void notifyAcquiredResource(org.apache.flink.api.common.JobID jobId, ResourceProfile resourceProfile)
Description copied from interface:ResourceTracker
Notifies the tracker about the acquisition of a resource with the given resource profile, for the given job.- Specified by:
notifyAcquiredResource
in interfaceResourceTracker
- Parameters:
jobId
- the job that acquired the resourceresourceProfile
- profile of the resource
-
notifyLostResource
public void notifyLostResource(org.apache.flink.api.common.JobID jobId, ResourceProfile resourceProfile)
Description copied from interface:ResourceTracker
Notifies the tracker about the loss of a resource with the given resource profile, for the given job.- Specified by:
notifyLostResource
in interfaceResourceTracker
- Parameters:
jobId
- the job that lost the resourceresourceProfile
- profile of the resource
-
clear
public void clear()
Description copied from interface:ResourceTracker
Removes all state from the tracker.- Specified by:
clear
in interfaceResourceTracker
-
getMissingResources
public Map<org.apache.flink.api.common.JobID,Collection<ResourceRequirement>> getMissingResources()
Description copied from interface:ResourceTracker
Returns a collection ofResourceRequirements
that describe which resources the corresponding job is missing.- Specified by:
getMissingResources
in interfaceResourceTracker
- Returns:
- missing resources for each jobs
-
getAcquiredResources
public Collection<ResourceRequirement> getAcquiredResources(org.apache.flink.api.common.JobID jobId)
Description copied from interface:ResourceTracker
Returns a collection ofResourceRequirement
s that describe which resources have been assigned to a job.- Specified by:
getAcquiredResources
in interfaceResourceTracker
- Parameters:
jobId
- job ID- Returns:
- required/exceeding resources for each jobs
-
isRequirementEmpty
public boolean isRequirementEmpty(org.apache.flink.api.common.JobID jobId)
Description copied from interface:ResourceTracker
Returns whether theResourceRequirement
of the given job is empty.- Specified by:
isRequirementEmpty
in interfaceResourceTracker
- Parameters:
jobId
- job ID- Returns:
- true if the
ResourceRequirement
of the given job is empty
-
-