public interface SlotProvider
It supports two allocating modes:
CompletableFuture.getNow(Object)
to get the allocated slot.Modifier and Type | Method and Description |
---|---|
default CompletableFuture<LogicalSlot> |
allocateBatchSlot(SlotRequestId slotRequestId,
ScheduledUnit scheduledUnit,
SlotProfile slotProfile,
boolean allowQueuedScheduling)
Allocating batch slot with specific requirement.
|
default CompletableFuture<LogicalSlot> |
allocateSlot(ScheduledUnit scheduledUnit,
boolean allowQueued,
SlotProfile slotProfile,
Time allocationTimeout)
Allocating slot with specific requirement.
|
CompletableFuture<LogicalSlot> |
allocateSlot(SlotRequestId slotRequestId,
ScheduledUnit scheduledUnit,
SlotProfile slotProfile,
boolean allowQueuedScheduling,
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 . |
CompletableFuture<LogicalSlot> allocateSlot(SlotRequestId slotRequestId, ScheduledUnit scheduledUnit, SlotProfile slotProfile, boolean allowQueuedScheduling, Time allocationTimeout)
slotRequestId
- identifying the slot requestscheduledUnit
- The task to allocate the slot forslotProfile
- profile of the requested slotallowQueuedScheduling
- Whether allow the task be queued if we do not have enough resourceallocationTimeout
- after which the allocation fails with a timeout exceptiondefault CompletableFuture<LogicalSlot> allocateBatchSlot(SlotRequestId slotRequestId, ScheduledUnit scheduledUnit, SlotProfile slotProfile, boolean allowQueuedScheduling)
slotRequestId
- identifying the slot requestscheduledUnit
- The task to allocate the slot forslotProfile
- profile of the requested slotallowQueuedScheduling
- Whether allow the task be queued if we do not have enough resourcedefault CompletableFuture<LogicalSlot> allocateSlot(ScheduledUnit scheduledUnit, boolean allowQueued, SlotProfile slotProfile, Time allocationTimeout)
scheduledUnit
- The task to allocate the slot forallowQueued
- Whether allow the task be queued if we do not have enough resourceslotProfile
- profile of the requested slotallocationTimeout
- after which the allocation fails with a timeout exceptionvoid cancelSlotRequest(SlotRequestId slotRequestId, @Nullable SlotSharingGroupId slotSharingGroupId, Throwable cause)
SlotRequestId
and SlotSharingGroupId
.slotRequestId
- identifying the slot request to cancelslotSharingGroupId
- identifying the slot request to cancelcause
- of the cancellationCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.