Class DefaultResourceTracker
java.lang.Object
org.apache.flink.runtime.resourcemanager.slotmanager.DefaultResourceTracker
- All Implemented Interfaces:
ResourceTracker
Default
ResourceTracker implementation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all state from the tracker.getAcquiredResources(org.apache.flink.api.common.JobID jobId) Returns a collection ofResourceRequirements that describe which resources have been assigned to a job.Map<org.apache.flink.api.common.JobID,Collection<ResourceRequirement>> Returns a collection ofResourceRequirementsthat describe which resources the corresponding job is missing.booleanisRequirementEmpty(org.apache.flink.api.common.JobID jobId) Returns whether theResourceRequirementof the given job is empty.voidnotifyAcquiredResource(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.voidnotifyLostResource(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.voidnotifyResourceRequirements(org.apache.flink.api.common.JobID jobId, Collection<ResourceRequirement> resourceRequirements) Notifies the tracker about a new or updatedResourceRequirements.
-
Constructor Details
-
DefaultResourceTracker
public DefaultResourceTracker()
-
-
Method Details
-
notifyResourceRequirements
public void notifyResourceRequirements(org.apache.flink.api.common.JobID jobId, Collection<ResourceRequirement> resourceRequirements) Description copied from interface:ResourceTrackerNotifies the tracker about a new or updatedResourceRequirements.- Specified by:
notifyResourceRequirementsin 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:ResourceTrackerNotifies the tracker about the acquisition of a resource with the given resource profile, for the given job.- Specified by:
notifyAcquiredResourcein 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:ResourceTrackerNotifies the tracker about the loss of a resource with the given resource profile, for the given job.- Specified by:
notifyLostResourcein interfaceResourceTracker- Parameters:
jobId- the job that lost the resourceresourceProfile- profile of the resource
-
clear
public void clear()Description copied from interface:ResourceTrackerRemoves all state from the tracker.- Specified by:
clearin interfaceResourceTracker
-
getMissingResources
Description copied from interface:ResourceTrackerReturns a collection ofResourceRequirementsthat describe which resources the corresponding job is missing.- Specified by:
getMissingResourcesin interfaceResourceTracker- Returns:
- missing resources for each jobs
-
getAcquiredResources
public Collection<ResourceRequirement> getAcquiredResources(org.apache.flink.api.common.JobID jobId) Description copied from interface:ResourceTrackerReturns a collection ofResourceRequirements that describe which resources have been assigned to a job.- Specified by:
getAcquiredResourcesin 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:ResourceTrackerReturns whether theResourceRequirementof the given job is empty.- Specified by:
isRequirementEmptyin interfaceResourceTracker- Parameters:
jobId- job ID- Returns:
- true if the
ResourceRequirementof the given job is empty
-