Interface ResourceManagerGateway

    • Method Detail

      • registerJobMaster

        CompletableFuture<RegistrationResponse> registerJobMaster​(JobMasterId jobMasterId,
                                                                  ResourceID jobMasterResourceId,
                                                                  String jobMasterAddress,
                                                                  org.apache.flink.api.common.JobID jobId,
                                                                  Duration timeout)
        Register a JobMaster at the resource manager.
        Parameters:
        jobMasterId - The fencing token for the JobMaster leader
        jobMasterResourceId - The resource ID of the JobMaster that registers
        jobMasterAddress - The address of the JobMaster that registers
        jobId - The Job ID of the JobMaster that registers
        timeout - Timeout for the future to complete
        Returns:
        Future registration response
      • declareRequiredResources

        CompletableFuture<Acknowledge> declareRequiredResources​(JobMasterId jobMasterId,
                                                                ResourceRequirements resourceRequirements,
                                                                Duration timeout)
        Declares the absolute resource requirements for a job.
        Parameters:
        jobMasterId - id of the JobMaster
        resourceRequirements - resource requirements
        Returns:
        The confirmation that the requirements have been processed
      • sendSlotReport

        CompletableFuture<Acknowledge> sendSlotReport​(ResourceID taskManagerResourceId,
                                                      InstanceID taskManagerRegistrationId,
                                                      SlotReport slotReport,
                                                      Duration timeout)
        Sends the given SlotReport to the ResourceManager.
        Parameters:
        taskManagerResourceId - The resource ID of the sending TaskManager
        taskManagerRegistrationId - id identifying the sending TaskManager
        slotReport - which is sent to the ResourceManager
        timeout - for the operation
        Returns:
        Future which is completed with Acknowledge once the slot report has been received.
      • notifySlotAvailable

        void notifySlotAvailable​(InstanceID instanceId,
                                 SlotID slotID,
                                 AllocationID oldAllocationId)
        Sent by the TaskExecutor to notify the ResourceManager that a slot has become available.
        Parameters:
        instanceId - TaskExecutor's instance id
        slotID - The SlotID of the freed slot
        oldAllocationId - to which the slot has been allocated
      • deregisterApplication

        CompletableFuture<Acknowledge> deregisterApplication​(ApplicationStatus finalStatus,
                                                             @Nullable
                                                             String diagnostics)
        Deregister Flink from the underlying resource management system.
        Parameters:
        finalStatus - final status with which to deregister the Flink application
        diagnostics - additional information for the resource management system, can be null
      • getNumberOfRegisteredTaskManagers

        CompletableFuture<Integer> getNumberOfRegisteredTaskManagers()
        Gets the currently registered number of TaskManagers.
        Returns:
        The future to the number of registered TaskManagers.
      • heartbeatFromTaskManager

        CompletableFuture<Void> heartbeatFromTaskManager​(ResourceID heartbeatOrigin,
                                                         TaskExecutorHeartbeatPayload heartbeatPayload)
        Sends the heartbeat to resource manager from task manager.
        Parameters:
        heartbeatOrigin - unique id of the task manager
        heartbeatPayload - payload from the originating TaskManager
        Returns:
        future which is completed exceptionally if the operation fails
      • heartbeatFromJobManager

        CompletableFuture<Void> heartbeatFromJobManager​(ResourceID heartbeatOrigin)
        Sends the heartbeat to resource manager from job manager.
        Parameters:
        heartbeatOrigin - unique id of the job manager
        Returns:
        future which is completed exceptionally if the operation fails
      • disconnectTaskManager

        void disconnectTaskManager​(ResourceID resourceID,
                                   Exception cause)
        Disconnects a TaskManager specified by the given resourceID from the ResourceManager.
        Parameters:
        resourceID - identifying the TaskManager to disconnect
        cause - for the disconnection of the TaskManager
      • disconnectJobManager

        void disconnectJobManager​(org.apache.flink.api.common.JobID jobId,
                                  org.apache.flink.api.common.JobStatus jobStatus,
                                  Exception cause)
        Disconnects a JobManager specified by the given resourceID from the ResourceManager.
        Parameters:
        jobId - JobID for which the JobManager was the leader
        jobStatus - status of the job at the time of disconnection
        cause - for the disconnection of the JobManager
      • requestTaskManagerDetailsInfo

        CompletableFuture<TaskManagerInfoWithSlots> requestTaskManagerDetailsInfo​(ResourceID taskManagerId,
                                                                                  Duration timeout)
        Requests detail information about the given TaskExecutor.
        Parameters:
        taskManagerId - identifying the TaskExecutor for which to return information
        timeout - of the request
        Returns:
        Future TaskManager information and its allocated slots
      • requestResourceOverview

        CompletableFuture<ResourceOverview> requestResourceOverview​(Duration timeout)
        Requests the resource overview. The resource overview provides information about the connected TaskManagers, the total number of slots and the number of available slots.
        Parameters:
        timeout - of the request
        Returns:
        Future containing the resource overview
      • requestTaskManagerMetricQueryServiceAddresses

        CompletableFuture<Collection<org.apache.flink.api.java.tuple.Tuple2<ResourceID,​String>>> requestTaskManagerMetricQueryServiceAddresses​(Duration timeout)
        Requests the paths for the TaskManager's MetricQueryService to query.
        Parameters:
        timeout - for the asynchronous operation
        Returns:
        Future containing the collection of resource ids and the corresponding metric query service path
      • requestThreadDump

        CompletableFuture<ThreadDumpInfo> requestThreadDump​(ResourceID taskManagerId,
                                                            Duration timeout)
        Requests the thread dump from the given TaskExecutor.
        Parameters:
        taskManagerId - taskManagerId identifying the TaskExecutor to get the thread dump from
        timeout - timeout of the asynchronous operation
        Returns:
        Future containing the thread dump information