Class DefaultSlotStatusSyncer
java.lang.Object
org.apache.flink.runtime.resourcemanager.slotmanager.DefaultSlotStatusSyncer
- All Implemented Interfaces:
SlotStatusSyncer
Default implementation of
SlotStatusSyncer for fine-grained slot management.-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
DefaultSlotStatusSyncer
-
-
Method Details
-
initialize
public void initialize(org.apache.flink.runtime.resourcemanager.slotmanager.TaskManagerTracker taskManagerTracker, ResourceTracker resourceTracker, ResourceManagerId resourceManagerId, Executor mainThreadExecutor) Description copied from interface:SlotStatusSyncerInitialize this syncer.- Specified by:
initializein interfaceSlotStatusSyncer- 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
public void close()Description copied from interface:SlotStatusSyncerClose this syncer, clear all the state.- Specified by:
closein interfaceSlotStatusSyncer
-
allocateSlot
public CompletableFuture<Void> allocateSlot(InstanceID instanceId, org.apache.flink.api.common.JobID jobId, String targetAddress, ResourceProfile resourceProfile) Description copied from interface:SlotStatusSyncerAllocate a slot from the task manager.- Specified by:
allocateSlotin interfaceSlotStatusSyncer- 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
Description copied from interface:SlotStatusSyncerFree the given slot.- Specified by:
freeSlotin interfaceSlotStatusSyncer- Parameters:
allocationId- of the given slot.
-
reportSlotStatus
Description copied from interface:SlotStatusSyncerReconcile the slot status with the slot report.- Specified by:
reportSlotStatusin interfaceSlotStatusSyncer- Parameters:
instanceId- of the task managerslotReport- reported- Returns:
- whether the previous allocations can be applied
-
freeInactiveSlots
public void freeInactiveSlots(org.apache.flink.api.common.JobID jobId) Description copied from interface:SlotStatusSyncerFrees all currently inactive slot allocated for the given job.- Specified by:
freeInactiveSlotsin interfaceSlotStatusSyncer- Parameters:
jobId- of the job
-