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 6665C200B83 for ; Fri, 2 Sep 2016 10:53:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 63E26160ACB; Fri, 2 Sep 2016 08:53:22 +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 AA15D160AAB for ; Fri, 2 Sep 2016 10:53:21 +0200 (CEST) Received: (qmail 98321 invoked by uid 500); 2 Sep 2016 08:53:20 -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 98292 invoked by uid 99); 2 Sep 2016 08:53:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Sep 2016 08:53:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 863EC2C1B79 for ; Fri, 2 Sep 2016 08:53:20 +0000 (UTC) Date: Fri, 2 Sep 2016 08:53:20 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-4490) Decouple Slot and Instance MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 02 Sep 2016 08:53:22 -0000 [ https://issues.apache.org/jira/browse/FLINK-4490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15457976#comment-15457976 ] ASF GitHub Bot commented on FLINK-4490: --------------------------------------- Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/2447#discussion_r77313861 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/instance/SlotSharingGroupAssignment.java --- @@ -576,7 +560,7 @@ private void internalDisposeEmptySharedSlot(SharedSlot sharedSlot) { if (parent == null) { // root slot, return to the instance. - sharedSlot.getInstance().returnAllocatedSlot(sharedSlot); + sharedSlot.getOwner().returnAllocatedSlot(sharedSlot); --- End diff -- Can we use `sharedSlot.releaseSlot` instead? It seems not so right to get the owner which is then used to call `returnAllocatedSlot` with the same slot. I think this violates the law of Demeter. Alternatively, we could add a method `returnSlot` to `Slot` which does: `owner.returnAllocatedSlot(this)`. > Decouple Slot and Instance > -------------------------- > > Key: FLINK-4490 > URL: https://issues.apache.org/jira/browse/FLINK-4490 > Project: Flink > Issue Type: Sub-task > Components: Distributed Coordination > Reporter: Kurt Young > Fix For: 1.2.0 > > > Currently, {{Slot}} and {{Instance}} holds each other. For {{Instance}} holding {{Slot}}, it makes sense because it reflects how many resources it can provide and how many are using. > But it's not very necessary for {{Slot}} to hold {{Instance}} which it belongs to. It only needs to hold some connection information and gateway to talk to. Another downside for {{Slot}} holding {{Instance}} is that {{Instance}} actually contains some allocate/de-allocation logicals, it will be difficult if we want to do some allocation refactor without letting {{Slot}} noticed. > We should abstract the connection information of {{Instance}} to let {{Slot}} holds. (Actually we have {{InstanceConnectionInfo}} now, but lacks of instance's akka gateway, maybe we can just adding the akka gateway to the {{InstanceConnectionInfo}}) -- This message was sent by Atlassian JIRA (v6.3.4#6332)