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 8CDCC200AF7 for ; Tue, 31 May 2016 06:44:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8B72B160A3C; Tue, 31 May 2016 04:44:09 +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 ABB7F160A19 for ; Tue, 31 May 2016 06:44:08 +0200 (CEST) Received: (qmail 6155 invoked by uid 500); 31 May 2016 04:44:07 -0000 Mailing-List: contact yarn-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list yarn-dev@hadoop.apache.org Received: (qmail 6142 invoked by uid 99); 31 May 2016 04:44:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2016 04:44:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id D53B9C0FD9 for ; Tue, 31 May 2016 04:44:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.979 X-Spam-Level: * X-Spam-Status: No, score=1.979 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=cloudera-com.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 9mmATDi8oF3e for ; Tue, 31 May 2016 04:44:04 +0000 (UTC) Received: from mail-yw0-f177.google.com (mail-yw0-f177.google.com [209.85.161.177]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 380CE5F245 for ; Tue, 31 May 2016 04:44:04 +0000 (UTC) Received: by mail-yw0-f177.google.com with SMTP id h19so177955253ywc.0 for ; Mon, 30 May 2016 21:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudera-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=anHODaWutCOw5GdKZas54LmrUuIpurnKNDKmFPZIeVQ=; b=joDfYcxOaz+HSHQVbpaa4+fE0KKsUYgftrGUej9QOdCwWTkM7xZOtXWlPivEyYEOs3 CaXF6AVwZpaUMFkeG3FLe1dP71emQci2nzloLav9WluWSBIdZZa9VuMggoYLQBWBxKJm PrzLUGcr8NvLhctwmqQHWyonV1qo9CtBinkI2EXLjJGDum+OooKPi48xk1E2fJ8pZHFH xDjbUVhim2rBTP226wVWFVu5hAiO9XTgc+dYV2lx05NDu1LMOHPIEX4d0uDBPTxRtPDh Ncp09ppMq0h/vFz5UvbKNptOXzxguvp4mgUH18NJOzXtYbIJexTzAXCdvmxZH9XIbMGK nYlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=anHODaWutCOw5GdKZas54LmrUuIpurnKNDKmFPZIeVQ=; b=YNsexnNH5/21N3SHUYHvtoyd+f+dNUOBxNLJ71xTHt2MuHvPINSG1zMw6W9WeR9/Pp QImmfH2pGdmn4CKA1RQ/XQ74xpJDN/gXUoY5zRyr1u0P/Kr4BO/J3Y/2KI6HeplSdKq3 7QKs3Idq2Dw7yPkxGYC8LGWiZZO9sWHu9EYEjAwtUJvjK6cG0dOT4wdq2lVXt3/ck+hG cVA8kq0eqgiNyY7FmkzGnzku2GqmtwG1ZZ+4uccW/jF7oyxCCIWiS8DNxUNQ85CMYTFl uh0XLKw6O/AUqKxfymd3z60u0KhrJ/jb63DtYQuK0OfDlgC+Xrm9XyyM5wTR3whXLnAZ T0vQ== X-Gm-Message-State: ALyK8tKJg23+ZVC2zEddgzqLrcY0CHD2JHtPmbO+TRnusWdAfKkEG3XGRT04ost1ZVVLWvw1sE915LoIbsyw5IJ7 MIME-Version: 1.0 X-Received: by 10.129.124.193 with SMTP id x184mr18629938ywc.24.1464669843572; Mon, 30 May 2016 21:44:03 -0700 (PDT) Received: by 10.13.193.199 with HTTP; Mon, 30 May 2016 21:44:03 -0700 (PDT) In-Reply-To: References: <140D71EF-F7D6-4D7C-B370-401A8561164E@hortonworks.com> Date: Mon, 30 May 2016 21:44:03 -0700 Message-ID: Subject: Re: [DISCUSS] what exactly are the stability guarantees of the YARN APIs From: Karthik Kambatla To: Sangjin Lee Cc: Steve Loughran , "yarn-dev@hadoop.apache.org" Content-Type: multipart/alternative; boundary=001a1149333cbd87a405341c0531 archived-at: Tue, 31 May 2016 04:44:09 -0000 --001a1149333cbd87a405341c0531 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Inline. On Sat, May 28, 2016 at 11:34 AM, Sangjin Lee wrote: > I think there is more to it. The InterfaceStability javadoc states: > Incompatible changes must not be made to classes marked as stable. > > And in practice, I don't think the class annotation can be considered a > simple sum of method annotations. There is a notion of class compatibilit= y > distinct from method stability. One key example is interfaces and abstrac= t > classes as in this case. The moment a new abstract method is added, the > class becomes incompatible as it would break all downstream subclasses or > implementing classes. That's the case even if *all methods are declared > stable*. Thus, adding any abstract method (no matter what their > scope/stability is) should be considered in violation of the stable > contract of the class. > Fair point. I was referring to them in the context of adding @Evolving methods to @Stable classes. Our policy states that "Classes not annotated are implicitly =E2=80=9CPrivate=E2=80=9D. Class members not annotated inher= it the annotations of the enclosing class." So, the annotation on a method overrides that of the enclosing class. This seems pretty reasonable to me. Do you think there is reason to revisit this? If yes, we should update this for Hadoop 3. > > Regarding interfaces and abstract classes, one future enhancement to the > InterfaceStability annotation we could consider is formally separating th= e > contract for users of the API and the implementers of the API. They follo= w > different rules. It could be feasible to have an interface as Public/Stab= le > for users (anyone can use the API in a stable manner) but Private for > implementers. The idea is that it is still a public interface but no > third-party code should not subclass or implement it. I suspect a fair > amount of hadoop's public interface might fall into that category. That > itself is probably an incompatible change, so we might have to wait until > after 3.0, however. > Interesting thought. Agree that we do not anticipate users sub-classing most of our Public-Stable classes. There are also classes which we do not anticipate end-users to directly use, but devs might want to sub-class. This applies to pluggable entities; e.g. SchedulingPolicy in fairscheduler. We are currently using Public-Evolving to capture this intent. Should we add a third annotation in addition to Audience and Stability to capture whether a class can be extended? Given the few classes we anticipate being extended, this is likely lesser work. :) > > > On Sat, May 28, 2016 at 10:07 AM, Karthik Kambatla > wrote: > >> Inline. >> >> On Sat, May 28, 2016 at 3:51 AM, Steve Loughran >> wrote: >> >> > >> > In SLIDER-1130, I discovered that some changes to some YARN classes ha= d >> > broken my test code =E2=80=94new abstract methods had been defined, wh= ich broke >> the >> > subclasses I have to mock a YARN cluster. These are invaluable classes= , >> as, >> > once eventually the hadoop regressions had been worked around, they >> showed >> > that the label code was broken ( YARN-5135 ) and the fixYARN-4991 not >> > backported to branch-2 >> > >> > If the classes that had changed were tagged as @Private or @Evolving, >> I'd >> > have just said, "oh well, never mind" >> > >> > Except, the two interfaces that broke: ContainerStatus and NodeReport >> =E2=80=94are >> > marked @Public, @Stable >> > >> > Given that my code broke, I don't believe that the guarantees of a >> @Stable >> > interface, "Can evolve while retaining compatibility for minor release >> > boundaries; in other words, incompatible changes to APIs marked Stable >> are >> > allowed only at major releases (i.e. at m.0)." are being kept. >> > >> > Now, in YARN-5130, we now have a patch to remark the interfaces as >> > Unstable. >> > >> > However, while I can apply that patch myself, I want to raise a broade= r >> > question: what does the Yarn team consider constitutes "stable"? >> > >> > And do that changes that took place in YARN-3886 and YARN-2882 meet >> those >> > requirements? New methods are going in, some of which are now being >> tagged >> > as @Evolving? >> >> >> > I fail to see how something marked as @Stable can add @Evolving method= s, >> > and given that changes are breaking downstream code, I worry that not >> > enough care is being taken over the maintenance of the guarantee which >> > @Public, @Stable interfaces make to users >> > >> >> Are you referring to adding @Evolving methods to @Stable classes? If yes= , >> my understanding is - the annotations are per-method and the class >> annotations are a convenience to avoid having to annotate each method. >> >> >> > >> > >> > >> > -Steve >> > >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: yarn-dev-unsubscribe@hadoop.apache.org >> > For additional commands, e-mail: yarn-dev-help@hadoop.apache.org >> > >> > >> > > --001a1149333cbd87a405341c0531--