Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9B263200B7E for ; Tue, 23 Aug 2016 03:21:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 99FC2160AB3; Tue, 23 Aug 2016 01:21:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E0D33160ABC for ; Tue, 23 Aug 2016 03:21:06 +0200 (CEST) Received: (qmail 15805 invoked by uid 500); 23 Aug 2016 01:21:06 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 15791 invoked by uid 99); 23 Aug 2016 01:21:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Aug 2016 01:21:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 9656C1A5465 for ; Tue, 23 Aug 2016 01:21:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -5.446 X-Spam-Level: X-Spam-Status: No, score=-5.446 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id vNIpEGiqOTaV for ; Tue, 23 Aug 2016 01:21:04 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with SMTP id 6468F5FAC4 for ; Tue, 23 Aug 2016 01:21:04 +0000 (UTC) Received: (qmail 15335 invoked by uid 99); 23 Aug 2016 01:21:03 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Aug 2016 01:21:03 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A8BE1E0441; Tue, 23 Aug 2016 01:21:03 +0000 (UTC) From: beyond1920 To: issues@flink.incubator.apache.org Reply-To: issues@flink.incubator.apache.org References: In-Reply-To: Subject: [GitHub] flink pull request #2389: [FLINK-4348] [cluster management] Implement commun... Content-Type: text/plain Message-Id: <20160823012103.A8BE1E0441@git1-us-west.apache.org> Date: Tue, 23 Aug 2016 01:21:03 +0000 (UTC) archived-at: Tue, 23 Aug 2016 01:21:07 -0000 Github user beyond1920 commented on a diff in the pull request: https://github.com/apache/flink/pull/2389#discussion_r75789222 --- 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 registerTaskExecutor( + final UUID resourceManagerLeaderId, + final String taskExecutorAddress, + final ResourceID resourceID + ) { + log.info("received register from taskExecutor {}, address {}", resourceID, taskExecutorAddress); + Future taskExecutorFuture = + getRpcService().connect(taskExecutorAddress, TaskExecutorGateway.class); + + return taskExecutorFuture.map(new Mapper() { + @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 -- getRpcService().connect(taskExecutorAddress, TaskExecutorGateway.class); now if the address is invalid, then taskExecutorGateway is null. --- 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. ---