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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletableFuture<Void>
allocateSlot(InstanceID instanceId, JobID jobId, String targetAddress, ResourceProfile resourceProfile)
Allocate a slot from the task manager.void
close()
Close this syncer, clear all the state.void
freeInactiveSlots(JobID jobId)
Frees all currently inactive slot allocated for the given job.void
freeSlot(AllocationID allocationId)
Free the given slot.void
initialize(org.apache.flink.runtime.resourcemanager.slotmanager.TaskManagerTracker taskManagerTracker, ResourceTracker resourceTracker, ResourceManagerId resourceManagerId, Executor mainThreadExecutor)
Initialize this syncer.boolean
reportSlotStatus(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, 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
CompletableFuture
of 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(JobID jobId)
Frees all currently inactive slot allocated for the given job.- Parameters:
jobId
- of the job
-
-