flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tillrohrmann <...@git.apache.org>
Subject [GitHub] flink pull request #2389: [FLINK-4348] [cluster management] Implement commun...
Date Tue, 23 Aug 2016 13:48:21 GMT
Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2389#discussion_r75868574
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/rpc/resourcemanager/ResourceManager.java
---
    @@ -94,26 +130,218 @@ public RegistrationResponse apply(final JobMasterGateway jobMasterGateway)
{
     	 * @return Slot assignment
     	 */
     	@RpcMethod
    -	public SlotAssignment requestSlot(SlotRequest slotRequest) {
    -		System.out.println("SlotRequest: " + slotRequest);
    -		return new SlotAssignment();
    +	public AcknowledgeSlotRequest requestSlot(SlotRequest slotRequest) {
    +		// TODO slotManager.requestSlot(slotRequest);
    +		return new AcknowledgeSlotRequest(slotRequest.getAllocationID());
     	}
     
     
     	/**
    -	 *
    -	 * @param resourceManagerLeaderId  The fencing token for the ResourceManager leader

    -	 * @param taskExecutorAddress      The address of the TaskExecutor that registers
    -	 * @param resourceID               The resource ID of the TaskExecutor that registers
    +	 * @param resourceManagerLeaderId The fencing token for the ResourceManager leader
    +	 * @param taskExecutorAddress     The address of the TaskExecutor that registers
    +	 * @param resourceID              The resource ID of the TaskExecutor that registers
     	 *
     	 * @return The response by the ResourceManager.
     	 */
     	@RpcMethod
    -	public org.apache.flink.runtime.rpc.registration.RegistrationResponse registerTaskExecutor(
    -			UUID resourceManagerLeaderId,
    -			String taskExecutorAddress,
    -			ResourceID resourceID) {
    +	public Future<org.apache.flink.runtime.rpc.registration.RegistrationResponse>
registerTaskExecutor(
    +		final UUID resourceManagerLeaderId,
    +		final String taskExecutorAddress,
    +		final ResourceID resourceID
    +	) {
    +		log.info("received register from taskExecutor {}, address {}", resourceID, taskExecutorAddress);
    +		Future<TaskExecutorGateway> taskExecutorFuture =
    +			getRpcService().connect(taskExecutorAddress, TaskExecutorGateway.class);
    +
    +		return taskExecutorFuture.map(new Mapper<TaskExecutorGateway, org.apache.flink.runtime.rpc.registration.RegistrationResponse>()
{
    +			@Override
    +			public org.apache.flink.runtime.rpc.registration.RegistrationResponse apply(final
TaskExecutorGateway taskExecutorGateway) {
    +				// decline registration if resourceManager cannot connect to the taskExecutor using
the given address
    +				if(taskExecutorGateway == null) {
    --- End diff --
    
    Hmm you're right that this can currently happen. We should fix that in the underlying
RPC service implementation. In case that the actor ref cannot be resolve an exception should
be thrown. I'll open an PR for it.


---
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.
---

Mime
View raw message