Search in sources :

Example 11 with SlotStatus

use of org.apache.flink.runtime.taskexecutor.SlotStatus in project flink by apache.

the class TaskSlotTable method createSlotReport.

// ---------------------------------------------------------------------
// Slot report methods
// ---------------------------------------------------------------------
public SlotReport createSlotReport(ResourceID resourceId) {
    final int numberSlots = taskSlots.size();
    List<SlotStatus> slotStatuses = Arrays.asList(new SlotStatus[numberSlots]);
    for (int i = 0; i < numberSlots; i++) {
        TaskSlot taskSlot = taskSlots.get(i);
        SlotID slotId = new SlotID(resourceId, taskSlot.getIndex());
        SlotStatus slotStatus = new SlotStatus(slotId, taskSlot.getResourceProfile(), taskSlot.getJobId(), taskSlot.getAllocationId());
        slotStatuses.set(i, slotStatus);
    }
    final SlotReport slotReport = new SlotReport(slotStatuses);
    return slotReport;
}
Also used : SlotID(org.apache.flink.runtime.clusterframework.types.SlotID) SlotStatus(org.apache.flink.runtime.taskexecutor.SlotStatus) SlotReport(org.apache.flink.runtime.taskexecutor.SlotReport)

Aggregations

SlotID (org.apache.flink.runtime.clusterframework.types.SlotID)11 SlotStatus (org.apache.flink.runtime.taskexecutor.SlotStatus)11 SlotReport (org.apache.flink.runtime.taskexecutor.SlotReport)10 Test (org.junit.Test)9 JobID (org.apache.flink.api.common.JobID)8 AllocationID (org.apache.flink.runtime.clusterframework.types.AllocationID)8 SlotRequest (org.apache.flink.runtime.resourcemanager.SlotRequest)6 ResourceID (org.apache.flink.runtime.clusterframework.types.ResourceID)3 TaskExecutorRegistration (org.apache.flink.runtime.resourcemanager.registration.TaskExecutorRegistration)3 UUID (java.util.UUID)2 Time (org.apache.flink.api.common.time.Time)2 ResourceProfile (org.apache.flink.runtime.clusterframework.types.ResourceProfile)2 TestingHighAvailabilityServices (org.apache.flink.runtime.highavailability.TestingHighAvailabilityServices)2 JobMasterGateway (org.apache.flink.runtime.jobmaster.JobMasterGateway)2 TestingLeaderElectionService (org.apache.flink.runtime.leaderelection.TestingLeaderElectionService)2 RegistrationResponse (org.apache.flink.runtime.registration.RegistrationResponse)2 JobLeaderIdService (org.apache.flink.runtime.resourcemanager.JobLeaderIdService)2 ResourceManagerConfiguration (org.apache.flink.runtime.resourcemanager.ResourceManagerConfiguration)2 TestingSlotManager (org.apache.flink.runtime.resourcemanager.TestingSlotManager)2 RMSlotRequestReply (org.apache.flink.runtime.resourcemanager.messages.jobmanager.RMSlotRequestReply)2