flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] tillrohrmann commented on a change in pull request #6898: [FLINK-10431] Extraction of scheduling-related code from SlotPool into preliminary Scheduler
Date Wed, 24 Oct 2018 17:02:58 GMT
tillrohrmann commented on a change in pull request #6898: [FLINK-10431] Extraction of scheduling-related
code from SlotPool into preliminary Scheduler
URL: https://github.com/apache/flink/pull/6898#discussion_r227872881
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolGateway.java
 ##########
 @@ -145,17 +149,61 @@
 	 * <p>If the returned future must not be completed right away (a.k.a. the slot request
 	 * can be queued), allowQueuedScheduling must be set to true.
 	 *
+	 * @deprecated this method will be removed once the handling of slot sharing is completely
extracted from the slot
+	 * pool into a dedicated {@link Scheduler} component. The call is then replaced by calls
to
+	 * {@link #getAvailableSlotsInformation()}, {@link #allocateAvailableSlot(SlotRequestId,
AllocationID)}, and
+	 * {@link #requestNewAllocatedSlot(SlotRequestId, ResourceProfile, Time)}.
+	 *
 	 * @param slotRequestId identifying the requested slot
 	 * @param scheduledUnit for which to allocate slot
 	 * @param slotProfile profile that specifies the requirements for the requested slot
 	 * @param allowQueuedScheduling true if the slot request can be queued (e.g. the returned
future must not be completed)
 	 * @param timeout for the operation
 	 * @return Future which is completed with the allocated {@link LogicalSlot}
 	 */
+	@Deprecated
 	CompletableFuture<LogicalSlot> allocateSlot(
 			SlotRequestId slotRequestId,
 			ScheduledUnit scheduledUnit,
 			SlotProfile slotProfile,
 			boolean allowQueuedScheduling,
 			@RpcTimeout Time timeout);
+
+	/**
+	 * Returns a list of {@link SlotInfo} objects about all slots that are currently available
in the slot
+	 * pool.
+	 *
+	 * @return a list of {@link SlotInfo} objects about all slots that are currently available
in the slot pool.
+	 */
+	@Nonnull
+	List<SlotInfo> getAvailableSlotsInformation();
+
+	/**
+	 * Allocates the available slot with the given allocation id under the given request id.
This method returns
+	 * {@code null} if no slot with the given allocation id is available.
+	 *
+	 * @param slotRequestId identifying the requested slot
+	 * @param allocationID the allocation id of the requested available slot
+	 * @return the previously available slot with the given allocation id or {@code null} if
no such slot existed.
+	 */
+	@Nullable
+	AllocatedSlot allocateAvailableSlot(
+		@Nonnull SlotRequestId slotRequestId,
+		@Nonnull AllocationID allocationID);
+
+	/**
+	 * Request the allocation of a new slot from the resource manager. This method will not
return a slot from the
+	 * already available slots from the pool, but instead will add a new slot to that pool that
is immediately allocated
+	 * and returned.
+	 *
+	 * @param slotRequestId identifying the requested slot
+	 * @param resourceProfile resource profile that specifies the resource requirements for
the requested slot
+	 * @param timeout timeout for the allocation procedure
+	 * @return a newly allocated slot that was previously not available.
+	 */
+	@Nonnull
+	CompletableFuture<AllocatedSlot> requestNewAllocatedSlot(
 
 Review comment:
   Same here with the `AllocatedSlot`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message