Repository: spark Updated Branches: refs/heads/master b46f75a5a -> 9610efc25
[SPARK-26055][CORE] InterfaceStability annotations should be retained at runtime ## What changes were proposed in this pull request? It's good to have annotations available at runtime, so that tools like MiMa can detect them and deal with then specially. e.g. we don't want to track compatibility for unstable classes. This PR makes `InterfaceStability` annotations to be retained at runtime, to be consistent with `Experimental` and `DeveloperApi` ## How was this patch tested? N/A Closes #23029 from cloud-fan/annotation. Authored-by: Wenchen Fan <wenc...@databricks.com> Signed-off-by: Wenchen Fan <wenc...@databricks.com> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/9610efc2 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/9610efc2 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/9610efc2 Branch: refs/heads/master Commit: 9610efc252c94f93689d45e320df1c5815d97b25 Parents: b46f75a Author: Wenchen Fan <wenc...@databricks.com> Authored: Thu Nov 15 20:25:27 2018 +0800 Committer: Wenchen Fan <wenc...@databricks.com> Committed: Thu Nov 15 20:25:27 2018 +0800 ---------------------------------------------------------------------- .../java/org/apache/spark/annotation/DeveloperApi.java | 1 + .../java/org/apache/spark/annotation/Experimental.java | 1 + .../org/apache/spark/annotation/InterfaceStability.java | 11 ++++++++++- .../main/java/org/apache/spark/annotation/Private.java | 6 ++---- 4 files changed, 14 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/9610efc2/common/tags/src/main/java/org/apache/spark/annotation/DeveloperApi.java ---------------------------------------------------------------------- diff --git a/common/tags/src/main/java/org/apache/spark/annotation/DeveloperApi.java b/common/tags/src/main/java/org/apache/spark/annotation/DeveloperApi.java index 0ecef6d..890f2fa 100644 --- a/common/tags/src/main/java/org/apache/spark/annotation/DeveloperApi.java +++ b/common/tags/src/main/java/org/apache/spark/annotation/DeveloperApi.java @@ -29,6 +29,7 @@ import java.lang.annotation.*; * of the known issue that Scaladoc displays only either the annotation or the comment, whichever * comes first. */ +@Documented @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.PACKAGE}) http://git-wip-us.apache.org/repos/asf/spark/blob/9610efc2/common/tags/src/main/java/org/apache/spark/annotation/Experimental.java ---------------------------------------------------------------------- diff --git a/common/tags/src/main/java/org/apache/spark/annotation/Experimental.java b/common/tags/src/main/java/org/apache/spark/annotation/Experimental.java index ff81202..9687592 100644 --- a/common/tags/src/main/java/org/apache/spark/annotation/Experimental.java +++ b/common/tags/src/main/java/org/apache/spark/annotation/Experimental.java @@ -30,6 +30,7 @@ import java.lang.annotation.*; * of the known issue that Scaladoc displays only either the annotation or the comment, whichever * comes first. */ +@Documented @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.PACKAGE}) http://git-wip-us.apache.org/repos/asf/spark/blob/9610efc2/common/tags/src/main/java/org/apache/spark/annotation/InterfaceStability.java ---------------------------------------------------------------------- diff --git a/common/tags/src/main/java/org/apache/spark/annotation/InterfaceStability.java b/common/tags/src/main/java/org/apache/spark/annotation/InterfaceStability.java index 323098f..02bcec7 100644 --- a/common/tags/src/main/java/org/apache/spark/annotation/InterfaceStability.java +++ b/common/tags/src/main/java/org/apache/spark/annotation/InterfaceStability.java @@ -17,7 +17,7 @@ package org.apache.spark.annotation; -import java.lang.annotation.Documented; +import java.lang.annotation.*; /** * Annotation to inform users of how much to rely on a particular package, @@ -31,6 +31,9 @@ public class InterfaceStability { * (e.g. from 1.0 to 2.0). */ @Documented + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, + ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.PACKAGE}) public @interface Stable {}; /** @@ -38,6 +41,9 @@ public class InterfaceStability { * Evolving interfaces can change from one feature release to another release (i.e. 2.1 to 2.2). */ @Documented + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, + ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.PACKAGE}) public @interface Evolving {}; /** @@ -45,5 +51,8 @@ public class InterfaceStability { * Classes that are unannotated are considered Unstable. */ @Documented + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, + ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.PACKAGE}) public @interface Unstable {}; } http://git-wip-us.apache.org/repos/asf/spark/blob/9610efc2/common/tags/src/main/java/org/apache/spark/annotation/Private.java ---------------------------------------------------------------------- diff --git a/common/tags/src/main/java/org/apache/spark/annotation/Private.java b/common/tags/src/main/java/org/apache/spark/annotation/Private.java index 9082fcf..a460d60 100644 --- a/common/tags/src/main/java/org/apache/spark/annotation/Private.java +++ b/common/tags/src/main/java/org/apache/spark/annotation/Private.java @@ -17,10 +17,7 @@ package org.apache.spark.annotation; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; +import java.lang.annotation.*; /** * A class that is considered private to the internals of Spark -- there is a high-likelihood @@ -35,6 +32,7 @@ import java.lang.annotation.Target; * of the known issue that Scaladoc displays only either the annotation or the comment, whichever * comes first. */ +@Documented @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.PACKAGE}) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org