[FLINK-8742][docs] Move docs generator annotations to flink-annotations This closes #5821.
Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/14f0c569 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/14f0c569 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/14f0c569 Branch: refs/heads/release-1.5 Commit: 14f0c5694ab73ba1fdb6038ce23c10f17d31d8d8 Parents: 9e2581e Author: zentol <ches...@apache.org> Authored: Thu Apr 5 12:17:27 2018 +0200 Committer: zentol <ches...@apache.org> Committed: Fri Apr 6 15:24:03 2018 +0200 ---------------------------------------------------------------------- .../flink/annotation/docs/ConfigGroup.java | 36 ++++++++++++++++++ .../flink/annotation/docs/ConfigGroups.java | 39 ++++++++++++++++++++ .../apache/flink/configuration/ConfigGroup.java | 36 ------------------ .../flink/configuration/ConfigGroups.java | 39 -------------------- .../apache/flink/configuration/CoreOptions.java | 2 + .../configuration/HighAvailabilityOptions.java | 2 + .../configuration/ResourceManagerOptions.java | 2 + .../flink/configuration/SecurityOptions.java | 2 + flink-docs/pom.xml | 5 +++ .../ConfigOptionsDocGenerator.java | 4 +- .../ConfigOptionsDocGeneratorTest.java | 4 +- 11 files changed, 92 insertions(+), 79 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/14f0c569/flink-annotations/src/main/java/org/apache/flink/annotation/docs/ConfigGroup.java ---------------------------------------------------------------------- diff --git a/flink-annotations/src/main/java/org/apache/flink/annotation/docs/ConfigGroup.java b/flink-annotations/src/main/java/org/apache/flink/annotation/docs/ConfigGroup.java new file mode 100644 index 0000000..2b70bd6 --- /dev/null +++ b/flink-annotations/src/main/java/org/apache/flink/annotation/docs/ConfigGroup.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.annotation.docs; + +import org.apache.flink.annotation.Internal; + +import java.lang.annotation.Target; + +/** + * A class that specifies a group of config options. The name of the group will be used as the basis for the + * filename of the generated html file, as defined in {@link ConfigOptionsDocGenerator}. + * + * @see ConfigGroups + */ +@Target({}) +@Internal +public @interface ConfigGroup { + String name(); + String keyPrefix(); +} http://git-wip-us.apache.org/repos/asf/flink/blob/14f0c569/flink-annotations/src/main/java/org/apache/flink/annotation/docs/ConfigGroups.java ---------------------------------------------------------------------- diff --git a/flink-annotations/src/main/java/org/apache/flink/annotation/docs/ConfigGroups.java b/flink-annotations/src/main/java/org/apache/flink/annotation/docs/ConfigGroups.java new file mode 100644 index 0000000..53bf856 --- /dev/null +++ b/flink-annotations/src/main/java/org/apache/flink/annotation/docs/ConfigGroups.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.annotation.docs; + +import org.apache.flink.annotation.Internal; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation used on classes containing config optionss that enables the separation of options into different + * tables based on key prefixes. A config option is assigned to a {@link ConfigGroup} if the option key matches + * the group prefix. If a key matches multiple prefixes the longest matching prefix takes priority. An option is never + * assigned to multiple groups. Options that don't match any group are implicitly added to a default group. + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Internal +public @interface ConfigGroups { + ConfigGroup[] groups() default {}; +} http://git-wip-us.apache.org/repos/asf/flink/blob/14f0c569/flink-core/src/main/java/org/apache/flink/configuration/ConfigGroup.java ---------------------------------------------------------------------- diff --git a/flink-core/src/main/java/org/apache/flink/configuration/ConfigGroup.java b/flink-core/src/main/java/org/apache/flink/configuration/ConfigGroup.java deleted file mode 100644 index 3cd1d7f..0000000 --- a/flink-core/src/main/java/org/apache/flink/configuration/ConfigGroup.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flink.configuration; - -import org.apache.flink.annotation.Internal; - -import java.lang.annotation.Target; - -/** - * A class that specifies a group of {@link ConfigOption}. The name of the group will be used as the basis for the - * filename of the generated html file, as defined in {@link ConfigOptionsDocGenerator}. - * - * @see ConfigGroups - */ -@Target({}) -@Internal -public @interface ConfigGroup { - String name(); - String keyPrefix(); -} http://git-wip-us.apache.org/repos/asf/flink/blob/14f0c569/flink-core/src/main/java/org/apache/flink/configuration/ConfigGroups.java ---------------------------------------------------------------------- diff --git a/flink-core/src/main/java/org/apache/flink/configuration/ConfigGroups.java b/flink-core/src/main/java/org/apache/flink/configuration/ConfigGroups.java deleted file mode 100644 index 94e52ee..0000000 --- a/flink-core/src/main/java/org/apache/flink/configuration/ConfigGroups.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flink.configuration; - -import org.apache.flink.annotation.Internal; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation used on classes containing {@link ConfigOption}s that enables the separation of options into different - * tables based on key prefixes. A {@link ConfigOption} is assigned to a {@link ConfigGroup} if the option key matches - * the group prefix. If a key matches multiple prefixes the longest matching prefix takes priority. An option is never - * assigned to multiple groups. Options that don't match any group are implicitly added to a default group. - */ -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Internal -public @interface ConfigGroups { - ConfigGroup[] groups() default {}; -} http://git-wip-us.apache.org/repos/asf/flink/blob/14f0c569/flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java ---------------------------------------------------------------------- diff --git a/flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java b/flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java index 4f8c074..343e2d2 100644 --- a/flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java +++ b/flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java @@ -19,6 +19,8 @@ package org.apache.flink.configuration; import org.apache.flink.annotation.PublicEvolving; +import org.apache.flink.annotation.docs.ConfigGroup; +import org.apache.flink.annotation.docs.ConfigGroups; import static org.apache.flink.configuration.ConfigOptions.key; http://git-wip-us.apache.org/repos/asf/flink/blob/14f0c569/flink-core/src/main/java/org/apache/flink/configuration/HighAvailabilityOptions.java ---------------------------------------------------------------------- diff --git a/flink-core/src/main/java/org/apache/flink/configuration/HighAvailabilityOptions.java b/flink-core/src/main/java/org/apache/flink/configuration/HighAvailabilityOptions.java index 8ef605b..f9d4ad9 100644 --- a/flink-core/src/main/java/org/apache/flink/configuration/HighAvailabilityOptions.java +++ b/flink-core/src/main/java/org/apache/flink/configuration/HighAvailabilityOptions.java @@ -19,6 +19,8 @@ package org.apache.flink.configuration; import org.apache.flink.annotation.PublicEvolving; +import org.apache.flink.annotation.docs.ConfigGroup; +import org.apache.flink.annotation.docs.ConfigGroups; import static org.apache.flink.configuration.ConfigOptions.key; http://git-wip-us.apache.org/repos/asf/flink/blob/14f0c569/flink-core/src/main/java/org/apache/flink/configuration/ResourceManagerOptions.java ---------------------------------------------------------------------- diff --git a/flink-core/src/main/java/org/apache/flink/configuration/ResourceManagerOptions.java b/flink-core/src/main/java/org/apache/flink/configuration/ResourceManagerOptions.java index dfaf89f..4ce4981 100644 --- a/flink-core/src/main/java/org/apache/flink/configuration/ResourceManagerOptions.java +++ b/flink-core/src/main/java/org/apache/flink/configuration/ResourceManagerOptions.java @@ -19,6 +19,8 @@ package org.apache.flink.configuration; import org.apache.flink.annotation.PublicEvolving; +import org.apache.flink.annotation.docs.ConfigGroup; +import org.apache.flink.annotation.docs.ConfigGroups; /** * The set of configuration options relating to the ResourceManager. http://git-wip-us.apache.org/repos/asf/flink/blob/14f0c569/flink-core/src/main/java/org/apache/flink/configuration/SecurityOptions.java ---------------------------------------------------------------------- diff --git a/flink-core/src/main/java/org/apache/flink/configuration/SecurityOptions.java b/flink-core/src/main/java/org/apache/flink/configuration/SecurityOptions.java index 17ff622..0f25c6c 100644 --- a/flink-core/src/main/java/org/apache/flink/configuration/SecurityOptions.java +++ b/flink-core/src/main/java/org/apache/flink/configuration/SecurityOptions.java @@ -19,6 +19,8 @@ package org.apache.flink.configuration; import org.apache.flink.annotation.PublicEvolving; +import org.apache.flink.annotation.docs.ConfigGroup; +import org.apache.flink.annotation.docs.ConfigGroups; import static org.apache.flink.configuration.ConfigOptions.key; http://git-wip-us.apache.org/repos/asf/flink/blob/14f0c569/flink-docs/pom.xml ---------------------------------------------------------------------- diff --git a/flink-docs/pom.xml b/flink-docs/pom.xml index 94716ab..ad53007 100644 --- a/flink-docs/pom.xml +++ b/flink-docs/pom.xml @@ -35,6 +35,11 @@ under the License. <dependencies> <dependency> <groupId>org.apache.flink</groupId> + <artifactId>flink-annotations</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.flink</groupId> <artifactId>flink-core</artifactId> <version>${project.version}</version> </dependency> http://git-wip-us.apache.org/repos/asf/flink/blob/14f0c569/flink-docs/src/main/java/org/apache/flink/docs/configuration/ConfigOptionsDocGenerator.java ---------------------------------------------------------------------- diff --git a/flink-docs/src/main/java/org/apache/flink/docs/configuration/ConfigOptionsDocGenerator.java b/flink-docs/src/main/java/org/apache/flink/docs/configuration/ConfigOptionsDocGenerator.java index 93112af..3bec09c 100644 --- a/flink-docs/src/main/java/org/apache/flink/docs/configuration/ConfigOptionsDocGenerator.java +++ b/flink-docs/src/main/java/org/apache/flink/docs/configuration/ConfigOptionsDocGenerator.java @@ -19,9 +19,9 @@ package org.apache.flink.docs.configuration; import org.apache.flink.annotation.VisibleForTesting; +import org.apache.flink.annotation.docs.ConfigGroup; +import org.apache.flink.annotation.docs.ConfigGroups; import org.apache.flink.api.java.tuple.Tuple2; -import org.apache.flink.configuration.ConfigGroup; -import org.apache.flink.configuration.ConfigGroups; import org.apache.flink.configuration.ConfigOption; import org.apache.flink.configuration.CoreOptions; import org.apache.flink.configuration.WebOptions; http://git-wip-us.apache.org/repos/asf/flink/blob/14f0c569/flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java ---------------------------------------------------------------------- diff --git a/flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java b/flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java index c8969f2..ba30617 100644 --- a/flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java +++ b/flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java @@ -18,9 +18,9 @@ package org.apache.flink.docs.configuration; +import org.apache.flink.annotation.docs.ConfigGroup; +import org.apache.flink.annotation.docs.ConfigGroups; import org.apache.flink.api.java.tuple.Tuple2; -import org.apache.flink.configuration.ConfigGroup; -import org.apache.flink.configuration.ConfigGroups; import org.apache.flink.configuration.ConfigOption; import org.apache.flink.configuration.ConfigOptions;