Interface ResourceTracker

  • All Known Implementing Classes:
    DefaultResourceTracker

    public interface ResourceTracker
    Tracks for each job how many resource are required/acquired.
    • Method Detail

      • notifyResourceRequirements

        void notifyResourceRequirements​(org.apache.flink.api.common.JobID jobId,
                                        Collection<ResourceRequirement> resourceRequirements)
        Notifies the tracker about a new or updated ResourceRequirements.
        Parameters:
        jobId - the job that the resource requirements belongs to
        resourceRequirements - new resource requirements
      • notifyAcquiredResource

        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.
        Parameters:
        jobId - the job that acquired the resource
        resourceProfile - profile of the resource
      • notifyLostResource

        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.
        Parameters:
        jobId - the job that lost the resource
        resourceProfile - profile of the resource
      • getMissingResources

        Map<org.apache.flink.api.common.JobID,​Collection<ResourceRequirement>> getMissingResources()
        Returns a collection of ResourceRequirements that describe which resources the corresponding job is missing.
        Returns:
        missing resources for each jobs
      • getAcquiredResources

        Collection<ResourceRequirement> getAcquiredResources​(org.apache.flink.api.common.JobID jobId)
        Returns a collection of ResourceRequirements that describe which resources have been assigned to a job.
        Parameters:
        jobId - job ID
        Returns:
        required/exceeding resources for each jobs
      • isRequirementEmpty

        boolean isRequirementEmpty​(org.apache.flink.api.common.JobID jobId)
        Returns whether the ResourceRequirement of the given job is empty.
        Parameters:
        jobId - job ID
        Returns:
        true if the ResourceRequirement of the given job is empty
      • clear

        void clear()
        Removes all state from the tracker.