public class SchedulerImpl extends Object implements Scheduler
Constructor and Description |
---|
SchedulerImpl(SlotSelectionStrategy slotSelectionStrategy,
SlotPool slotPool) |
SchedulerImpl(SlotSelectionStrategy slotSelectionStrategy,
SlotPool slotPool,
Map<SlotSharingGroupId,SlotSharingManager> slotSharingManagers) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<LogicalSlot> |
allocateBatchSlot(SlotRequestId slotRequestId,
ScheduledUnit scheduledUnit,
SlotProfile slotProfile)
Allocating batch slot with specific requirement.
|
CompletableFuture<LogicalSlot> |
allocateSlot(SlotRequestId slotRequestId,
ScheduledUnit scheduledUnit,
SlotProfile slotProfile,
Time allocationTimeout)
Allocating slot with specific requirement.
|
void |
cancelSlotRequest(SlotRequestId slotRequestId,
SlotSharingGroupId slotSharingGroupId,
Throwable cause)
Cancels the slot request with the given
SlotRequestId and SlotSharingGroupId . |
boolean |
requiresPreviousExecutionGraphAllocations()
Returns true, iff the scheduling strategy of the scheduler requires to know about previous
allocations.
|
void |
returnLogicalSlot(LogicalSlot logicalSlot)
Return the given slot to the slot owner.
|
void |
start(ComponentMainThreadExecutor mainThreadExecutor)
Start the scheduler by initializing the main thread executor.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allocateSlot
public SchedulerImpl(@Nonnull SlotSelectionStrategy slotSelectionStrategy, @Nonnull SlotPool slotPool)
@VisibleForTesting public SchedulerImpl(@Nonnull SlotSelectionStrategy slotSelectionStrategy, @Nonnull SlotPool slotPool, @Nonnull Map<SlotSharingGroupId,SlotSharingManager> slotSharingManagers)
public void start(@Nonnull ComponentMainThreadExecutor mainThreadExecutor)
Scheduler
public CompletableFuture<LogicalSlot> allocateSlot(SlotRequestId slotRequestId, ScheduledUnit scheduledUnit, SlotProfile slotProfile, Time allocationTimeout)
SlotProvider
allocateSlot
in interface SlotProvider
slotRequestId
- identifying the slot requestscheduledUnit
- The task to allocate the slot forslotProfile
- profile of the requested slotallocationTimeout
- after which the allocation fails with a timeout exceptionpublic CompletableFuture<LogicalSlot> allocateBatchSlot(SlotRequestId slotRequestId, ScheduledUnit scheduledUnit, SlotProfile slotProfile)
SlotProvider
allocateBatchSlot
in interface SlotProvider
slotRequestId
- identifying the slot requestscheduledUnit
- The task to allocate the slot forslotProfile
- profile of the requested slotpublic void cancelSlotRequest(SlotRequestId slotRequestId, @Nullable SlotSharingGroupId slotSharingGroupId, Throwable cause)
SlotProvider
SlotRequestId
and SlotSharingGroupId
.cancelSlotRequest
in interface SlotProvider
slotRequestId
- identifying the slot request to cancelslotSharingGroupId
- identifying the slot request to cancelcause
- of the cancellationpublic void returnLogicalSlot(LogicalSlot logicalSlot)
SlotOwner
returnLogicalSlot
in interface SlotOwner
logicalSlot
- to returnpublic boolean requiresPreviousExecutionGraphAllocations()
Scheduler
requiresPreviousExecutionGraphAllocations
in interface Scheduler
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.