flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxm <...@git.apache.org>
Subject [GitHub] flink pull request #2463: [FLINK-4538][FLINK-4348] ResourceManager slot allo...
Date Fri, 09 Sep 2016 16:50:23 GMT
Github user mxm commented on a diff in the pull request:

    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java
    @@ -89,32 +93,37 @@ public SlotManager(ResourceManagerGateway resourceManagerGateway)
     	 * RPC's main thread to avoid race condition).
     	 * @param request The detailed request of the slot
    +	 * @return SlotRequestRegistered The confirmation message to be send to the caller
    -	public void requestSlot(final SlotRequest request) {
    +	public SlotRequestRegistered requestSlot(final SlotRequest request) {
    +		final AllocationID allocationId = request.getAllocationId();
     		if (isRequestDuplicated(request)) {
    -			LOG.warn("Duplicated slot request, AllocationID:{}", request.getAllocationId());
    -			return;
    +			LOG.warn("Duplicated slot request, AllocationID:{}", allocationId);
    +			return null;
     		// try to fulfil the request with current free slots
    -		ResourceSlot slot = chooseSlotToUse(request, freeSlots);
    +		final ResourceSlot slot = chooseSlotToUse(request, freeSlots);
     		if (slot != null) {
     			LOG.info("Assigning SlotID({}) to AllocationID({}), JobID:{}", slot.getSlotId(),
    -				request.getAllocationId(), request.getJobId());
    +				allocationId, request.getJobId());
     			// record this allocation in bookkeeping
    -			allocationMap.addAllocation(slot.getSlotId(), request.getAllocationId());
    +			allocationMap.addAllocation(slot.getSlotId(), allocationId);
     			// remove selected slot from free pool
    -			// TODO: send slot request to TaskManager
    +			slot.getTaskExecutorGateway()
    +				.requestSlot(allocationId, leaderIdRegistry.getLeaderID());
    --- End diff --
    Thank you for your comments @beyond1920. Your observations are correct. I've skipped this
part of the implementation and wanted to address it next.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message