Interface SlotStatusSyncer
- All Known Implementing Classes:
DefaultSlotStatusSyncer
public interface SlotStatusSyncer
Syncer for slot status. Take the responsibility of allocating/freeing slot and reconciling the
slot status with task managers.
-
Method Summary
Modifier and TypeMethodDescriptionallocateSlot(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 Details
-
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
Free the given slot.- Parameters:
allocationId- of the given slot.
-
reportSlotStatus
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
-