Return-Path: X-Original-To: apmail-flink-dev-archive@www.apache.org Delivered-To: apmail-flink-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 496C618826 for ; Sat, 6 Feb 2016 14:17:30 +0000 (UTC) Received: (qmail 63984 invoked by uid 500); 6 Feb 2016 14:17:30 -0000 Delivered-To: apmail-flink-dev-archive@flink.apache.org Received: (qmail 63912 invoked by uid 500); 6 Feb 2016 14:17:30 -0000 Mailing-List: contact dev-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 dev@flink.apache.org Received: (qmail 63900 invoked by uid 99); 6 Feb 2016 14:17:29 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Feb 2016 14:17:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 5601DC0F2D for ; Sat, 6 Feb 2016 14:17:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.28 X-Spam-Level: * X-Spam-Status: No, score=1.28 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id f_1ejZimf6Rc for ; Sat, 6 Feb 2016 14:17:27 +0000 (UTC) Received: from mail-ig0-f174.google.com (mail-ig0-f174.google.com [209.85.213.174]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id A03B920D7B for ; Sat, 6 Feb 2016 14:17:26 +0000 (UTC) Received: by mail-ig0-f174.google.com with SMTP id hb3so31322740igb.0 for ; Sat, 06 Feb 2016 06:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=wwOMXZxXSqI0HrREVD9AGTQQ5lTTOABE18bxNapBKag=; b=BC+5tbwfM8vnAhm55+sTws1bK1WbK02HLV7iOVbAnNIZLbu3Liuey50xalf8sjIshM rrk4ZZAsDzWqwiC0N1alwiNfQH+CZjVYmnTOn1IcvS9OzCDYGz4ZqMsjExxSl7BXYkZr LjoBdjlE8ONU+spbr9aXwLbziqT7Oj9ZgVTGAy6cM66XVvC1DpG/R4V740dxsaUdnJif UKQcHENnuIXFtn6hcRQ5/fFYfV39L06aBRYC6SD4LiEZsEfl0aPQoZCcyXXX86v2rda+ YolUwTgq8hJEV2a8cQvrF02tENgyAlYFWZLzvr2V5BH/lulWQtSJ71yj9GBZYUnCH6sE Vzng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=wwOMXZxXSqI0HrREVD9AGTQQ5lTTOABE18bxNapBKag=; b=BWuKNF/uW938HMWp5D8w/2JXM/8tjCAJUboO2Tvmb5ynuApeuF4nqXIFw+AGlI7X0c zO1P483rBx0TPmqKsTvba0SO7iuF4gKt52YS6edtHKffs2pjcRpXGblwnKBu7Jn8Vrg5 5/vwk8vCqGIx3BhEEOfnDtxttojUv3GDWowKpoUiZYOxFVkxvPlfsLBHSsVfb7ypL8e+ xR/87wkvsLKf3m9A5HfLxuUG+h26bNR5eHwKIInRp9KwlQE4hLXHziN5M4kq9Qcpjj14 pVyS3RTQ75s6A7982IeX1DJSIvu0GOYFCn+BCS7A4L4Dad3m44nMgbevlPOoymKOzM9T YlFg== X-Gm-Message-State: AG10YOSKS4DnyWTOSXVrmMEx8ntiIx0A7mts2soT+bzLygjmG/3J5xgqtn48nNHwF5Q7QkZHwsQPeGO4WmEiqQ== MIME-Version: 1.0 X-Received: by 10.50.59.146 with SMTP id z18mr15834881igq.62.1454768245665; Sat, 06 Feb 2016 06:17:25 -0800 (PST) Sender: ewenstephan@gmail.com Received: by 10.107.159.194 with HTTP; Sat, 6 Feb 2016 06:17:25 -0800 (PST) In-Reply-To: References: Date: Sat, 6 Feb 2016 15:17:25 +0100 X-Google-Sender-Auth: fCfo2EQZfjfoPc5vKtMjMdrkJVg Message-ID: Subject: Re: [ANNOUNCE] Please annotate public interfaces! From: Stephan Ewen To: "dev@flink.apache.org" Content-Type: multipart/alternative; boundary=047d7bea3dfc8379e5052b1aa0d8 --047d7bea3dfc8379e5052b1aa0d8 Content-Type: text/plain; charset=UTF-8 Hi! These suggestions sound good in general. I am wondering if "Experimental" is not the wrong word here, because most of the things are not experimental, but just possibly subject to slight changes (though API breaking). Experimental has the connotation that something is unstable (execution wise) and should best be avoided altogether. If half of the Flink code base is marked "Experimental", it seems to contradict that this is actually in 1.0 shape. I actually like the term "Internal" that was also suggested. It pretty much says what we actually want to say: A certain method or class is not declared part of the public API, but as of now only internal API. Greetings, Stephan On Fri, Feb 5, 2016 at 8:38 PM, Fabian Hueske wrote: > Hi, > > @Experimental and @Internal have the class scope, because we need to be > able to mark internal classes of @Public classes as experimental or > internal. > > In some cases we annotated classes as @Public and all (or most) methods as > @Experimental, to indicate that a class can be used, but its internals > might change. > For example TypeInformation is a public class (and many classes that extend > this class) but most methods are @Experimental to allow users to used a > TypeInformation as is, but keep the freedom to change the internals. If you > find something that does not look correct, please start a discussion about. > The annotations can still be changed before the 1.0 release. > > I agree with Max that annotating more classes with @Experimental (not only > inner classes) would be a good idea. > IMO, we should annotate all classes that belong to the user-facing API with > either @Public or @Experimental. This would mean that all non-annotated > classes are not part of the API and must be considered as internal. I > believe this would avoid a lot of uncertainty and also easy the annotation > management as a whole. For instance, we can more easily check how the API > (stable and experimental) changed between releases. > > Cheers, Fabian > > 2016-02-05 17:24 GMT+01:00 Maximilian Michels : > > > Hi Robert, > > > > Thanks a lot for all the work of going through the classes. At first > > sight, the classes look quite well chosen. > > > > One question concerning the @Public, @Experimental, and @Internal > > annotations: > > > > @Public may only be used for classes or interfaces. @Experimental or > > @Internal are used for marking methods in @Public classes only? If > > that is the case, we should restrict the annotations to this scope via > > @Target. The current master also permits to tag classes with > > @Experimental or @Internal. > > > > Marking classes with @Experimental might actually make sense. What was > > the rational behind always declaring a class public first to restrict > > its methods to internal or experimental? > > > > Cheers, > > Max > > > > On Fri, Feb 5, 2016 at 3:07 PM, Robert Metzger > > wrote: > > > Hi, > > > > > > tl;dr: we now have @Public, @Internal, @Experimental annotations. Check > > > your stuff before the release! > > > > > > Fabian and I spend some time the last weeks to annotate all classes we > > > consider to be userfacing and stable with the "*@Public*" annotation. I > > > just pushed those changes to master. > > > > > > There is also an annotation "*@Internal*" for marking interfaces users > > > should not use because they are internal to the system (for example > > > "DataStream.getId()"). > > > > > > The annotation "*@Experimental*" marks unstable methods within stable > > > classes (for example SingleOutputStreamOperator.uid()). > > > Also note that we should also annotate @Deprecated methods with > > > @Experimental so that they are not part of the stable interface (this > > works > > > only before the 1.0 release). I checked that all current @Deprecated > > > annotations are excluded. > > > > > > > > > *I would like to ask everyone to spend some time before the 1.0 release > > to > > > go through some core classes and see if there is anything we forgot.* > > > *We will not be able to touch methods and classes which are public > after > > > the 1.0 release.* > > > > > > Some areas where I feel we should check closely are the following: > > > - InputFormats > > > - State-related classes > > > - Windowing related classes > > > - DataStream API (global() / forward(); output to files; ... ). > > > > > > Fabian and I also realized that there are some downsides to this > > annotation > > > approach. > > > a) By not annotating all classes, its easy to forget some classes. And > > its > > > not obvious to users that "no annotation" means "not public". > > > > > > b) For example the "SourceFunction.SourceContext" interface is @Public > > > because users use the methods of the interface. > > > However, the underlying implementations are internal to Flink (users > will > > > most likely not implement their own SourceContexts). Adding a new > method > > to > > > the SourceContext interface will break its compatibilty (because users > > > would need to implement the new method), however, for API users it does > > not > > > matter when we are adding new methods. > > > We decided to make the interface @Public, but we added a comment > > explaining > > > the issue. > > > If we want to add a method after the 1.0 release, we can define an > > exclude > > > in the maven plugin which enforces the interface stability. > > > > > > > > > For making the whole annotation analysis business a bit easier, I'm > > > currently working on a little tool to output a list of public classes > and > > > methods. I'll post that on the mailing list at a later point. > > > > > > Regards, > > > Robert > > > --047d7bea3dfc8379e5052b1aa0d8--