Interface SlotStatusSyncer
-
- All Known Implementing Classes:
DefaultSlotStatusSyncer
public interface SlotStatusSyncerSyncer for slot status. Take the responsibility of allocating/freeing slot and reconciling the slot status with task managers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletableFuture<Void>allocateSlot(InstanceID instanceId, org.apache.flink.api.common.JobID jobId, String targetAddress, ResourceProfile resourceProfile)Allocate a slot from the task manager.voidclose()Close this syncer, clear all the state.voidfreeInactiveSlots(org.apache.flink.api.common.JobID jobId)Frees all currently inactive slot allocated for the given job.voidfreeSlot(AllocationID allocationId)Free the given slot.voidinitialize(org.apache.flink.runtime.resourcemanager.slotmanager.TaskManagerTracker taskManagerTracker, ResourceTracker resourceTracker, ResourceManagerId resourceManagerId, Executor mainThreadExecutor)Initialize this syncer.booleanreportSlotStatus(InstanceID instanceId, SlotReport slotReport)Reconcile the slot status with the slot report.
-
-
-
Method Detail
-
initialize
void initialize(org.apache.flink.runtime.resourcemanager.slotmanager.TaskManagerTracker taskManagerTracker, ResourceTracker resourceTracker, ResourceManagerId resourceManagerId, Executor mainThreadExecutor)Initialize this syncer.- Parameters:
taskManagerTracker- track the state of task managers and slotsresourceTracker- track the state of resource declarationresourceManagerId- for slot allocationmainThreadExecutor- to handle the request future
-
close
void close()
Close this syncer, clear all the state.
-
allocateSlot
CompletableFuture<Void> allocateSlot(InstanceID instanceId, org.apache.flink.api.common.JobID jobId, String targetAddress, ResourceProfile resourceProfile)
Allocate a slot from the task manager.- Parameters:
instanceId- of the task managerjobId- of the slottargetAddress- of the jobresourceProfile- of the slot- Returns:
- a
CompletableFutureof the slot allocation, which will be completed exceptionally if the allocation fails
-
freeSlot
void freeSlot(AllocationID allocationId)
Free the given slot.- Parameters:
allocationId- of the given slot.
-
reportSlotStatus
boolean reportSlotStatus(InstanceID instanceId, SlotReport slotReport)
Reconcile the slot status with the slot report.- Parameters:
instanceId- of the task managerslotReport- reported- Returns:
- whether the previous allocations can be applied
-
freeInactiveSlots
void freeInactiveSlots(org.apache.flink.api.common.JobID jobId)
Frees all currently inactive slot allocated for the given job.- Parameters:
jobId- of the job
-
-