public class DeclarativeSlotPoolBridge extends DeclarativeSlotPoolService implements SlotPool
SlotPool implementation which uses the DeclarativeSlotPool to allocate slots.log| 构造器和说明 |
|---|
DeclarativeSlotPoolBridge(org.apache.flink.api.common.JobID jobId,
DeclarativeSlotPoolFactory declarativeSlotPoolFactory,
org.apache.flink.util.clock.Clock clock,
org.apache.flink.api.common.time.Time rpcTimeout,
org.apache.flink.api.common.time.Time idleSlotTimeout,
org.apache.flink.api.common.time.Time batchSlotTimeout,
RequestSlotMatchingStrategy requestSlotMatchingStrategy) |
| 限定符和类型 | 方法和说明 |
|---|---|
Optional<PhysicalSlot> |
allocateAvailableSlot(SlotRequestId slotRequestId,
AllocationID allocationID,
ResourceProfile requirementProfile)
Allocates the available slot with the given allocation id under the given request id for the
given requirement profile.
|
<T> Optional<T> |
castInto(Class<T> clazz)
Tries to cast this slot pool service into the given clazz.
|
void |
disableBatchSlotRequestTimeoutCheck()
Disables batch slot request timeout check.
|
Collection<SlotInfo> |
getAllocatedSlotsInformation()
Returns a list of
SlotInfo objects about all slots that are currently allocated in
the slot pool. |
Collection<SlotInfoWithUtilization> |
getAvailableSlotsInformation()
Returns a list of
SlotInfoWithUtilization objects about all slots that are currently
available in the slot pool. |
int |
getNumPendingRequests() |
void |
notifyNotEnoughResourcesAvailable(Collection<ResourceRequirement> acquiredResources)
Notifies that not enough resources are available to fulfill the resource requirements.
|
Collection<SlotOffer> |
offerSlots(TaskManagerLocation taskManagerLocation,
TaskManagerGateway taskManagerGateway,
Collection<SlotOffer> offers)
Offers multiple slots to the
SlotPoolService. |
protected void |
onClose()
This method is called when the slot pool service is closed.
|
protected void |
onFailAllocation(ResourceCounter previouslyFulfilledRequirements)
This method is called when an allocation fails.
|
protected void |
onReleaseTaskManager(ResourceCounter previouslyFulfilledRequirement)
This method is called when a TaskManager is released.
|
protected void |
onStart(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor componentMainThreadExecutor)
This method is called when the slot pool service is started.
|
void |
releaseSlot(SlotRequestId slotRequestId,
Throwable cause)
Releases the slot with the given
SlotRequestId. |
CompletableFuture<PhysicalSlot> |
requestNewAllocatedBatchSlot(SlotRequestId slotRequestId,
ResourceProfile resourceProfile,
Collection<AllocationID> preferredAllocations) |
CompletableFuture<PhysicalSlot> |
requestNewAllocatedSlot(SlotRequestId slotRequestId,
ResourceProfile resourceProfile,
Collection<AllocationID> preferredAllocations,
org.apache.flink.api.common.time.Time timeout)
Request the allocation of a new slot from the resource manager.
|
void |
setIsJobRestarting(boolean isJobRestarting)
To set whether the underlying is currently restarting or not.
|
assertHasBeenStarted, close, connectToResourceManager, createAllocatedSlotReport, disconnectResourceManager, failAllocation, getDeclarativeSlotPool, getRelativeTimeMillis, getSlotServiceStatus, registerTaskManager, releaseFreeSlotsOnTaskManager, releaseTaskManager, startclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, connectToResourceManager, createAllocatedSlotReport, disconnectResourceManager, registerTaskManager, releaseTaskManager, requestNewAllocatedBatchSlot, requestNewAllocatedSlot, startpublic DeclarativeSlotPoolBridge(org.apache.flink.api.common.JobID jobId,
DeclarativeSlotPoolFactory declarativeSlotPoolFactory,
org.apache.flink.util.clock.Clock clock,
org.apache.flink.api.common.time.Time rpcTimeout,
org.apache.flink.api.common.time.Time idleSlotTimeout,
org.apache.flink.api.common.time.Time batchSlotTimeout,
RequestSlotMatchingStrategy requestSlotMatchingStrategy)
public <T> Optional<T> castInto(Class<T> clazz)
SlotPoolServicecastInto 在接口中 SlotPoolServicecastInto 在类中 DeclarativeSlotPoolServiceT - type of clazzclazz - to cast the slot pool service intoOptional.of(T) the target type if it can be cast; otherwise Optional.empty()protected void onStart(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor componentMainThreadExecutor)
DeclarativeSlotPoolServiceonStart 在类中 DeclarativeSlotPoolServicecomponentMainThreadExecutor - componentMainThreadExecutor used by this slot pool serviceprotected void onClose()
DeclarativeSlotPoolServiceonClose 在类中 DeclarativeSlotPoolServicepublic void setIsJobRestarting(boolean isJobRestarting)
setIsJobRestarting 在接口中 SlotPoolisJobRestarting - whether this is restarting or notpublic Collection<SlotOffer> offerSlots(TaskManagerLocation taskManagerLocation, TaskManagerGateway taskManagerGateway, Collection<SlotOffer> offers)
SlotPoolServiceSlotPoolService. The slot offerings can be individually
accepted or rejected by returning the collection of accepted slot offers.offerSlots 在接口中 SlotPoolofferSlots 在接口中 SlotPoolServiceofferSlots 在类中 DeclarativeSlotPoolServicetaskManagerLocation - from which the slot offers originatetaskManagerGateway - to talk to the slot offereroffers - slot offers which are offered to the SlotPoolServiceprotected void onReleaseTaskManager(ResourceCounter previouslyFulfilledRequirement)
DeclarativeSlotPoolServiceonReleaseTaskManager 在类中 DeclarativeSlotPoolServicepreviouslyFulfilledRequirement - previouslyFulfilledRequirement by the released
TaskManagerpublic Optional<PhysicalSlot> allocateAvailableSlot(@Nonnull SlotRequestId slotRequestId, @Nonnull AllocationID allocationID, @Nonnull ResourceProfile requirementProfile)
SlotPoolIllegalStateException will be thrown.allocateAvailableSlot 在接口中 SlotPoolslotRequestId - identifying the requested slotallocationID - the allocation id of the requested available slotrequirementProfile - resource profile of the requirement for which to allocate the slot@Nonnull public CompletableFuture<PhysicalSlot> requestNewAllocatedSlot(@Nonnull SlotRequestId slotRequestId, @Nonnull ResourceProfile resourceProfile, @Nonnull Collection<AllocationID> preferredAllocations, @Nullable org.apache.flink.api.common.time.Time timeout)
SlotPoolrequestNewAllocatedSlot 在接口中 SlotPoolslotRequestId - identifying the requested slotresourceProfile - resource profile that specifies the resource requirements for the
requested slotpreferredAllocations - preferred allocations for the new allocated slottimeout - timeout for the allocation procedure@Nonnull public CompletableFuture<PhysicalSlot> requestNewAllocatedBatchSlot(@Nonnull SlotRequestId slotRequestId, @Nonnull ResourceProfile resourceProfile, @Nonnull Collection<AllocationID> preferredAllocations)
requestNewAllocatedBatchSlot 在接口中 SlotPoolprotected void onFailAllocation(ResourceCounter previouslyFulfilledRequirements)
DeclarativeSlotPoolServiceonFailAllocation 在类中 DeclarativeSlotPoolServicepreviouslyFulfilledRequirements - previouslyFulfilledRequirements by the failed
allocationpublic void releaseSlot(@Nonnull SlotRequestId slotRequestId, @Nullable Throwable cause)
AllocatedSlotActionsSlotRequestId. Additionally, one can provide a cause
for the slot release.releaseSlot 在接口中 AllocatedSlotActionsslotRequestId - identifying the slot to releasecause - of the slot release, null if nonepublic void notifyNotEnoughResourcesAvailable(Collection<ResourceRequirement> acquiredResources)
SlotPoolServicenotifyNotEnoughResourcesAvailable 在接口中 SlotPoolServiceacquiredResources - the resources that have been acquiredpublic Collection<SlotInfo> getAllocatedSlotsInformation()
SlotPoolSlotInfo objects about all slots that are currently allocated in
the slot pool.getAllocatedSlotsInformation 在接口中 SlotPoolSlotInfo objects about all slots that are currently allocated in
the slot pool.@Nonnull public Collection<SlotInfoWithUtilization> getAvailableSlotsInformation()
SlotPoolSlotInfoWithUtilization objects about all slots that are currently
available in the slot pool.getAvailableSlotsInformation 在接口中 SlotPoolSlotInfoWithUtilization objects about all slots that are currently
available in the slot pool.public void disableBatchSlotRequestTimeoutCheck()
SlotPooldisableBatchSlotRequestTimeoutCheck 在接口中 SlotPool@VisibleForTesting public int getNumPendingRequests()
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.