From 27b75d41106849c75bd939556319178a96f63f02 Mon Sep 17 00:00:00 2001 From: Raghav Aggarwal Date: Tue, 2 Jun 2026 23:28:48 +0530 Subject: [PATCH] TEZ-4633: Set Baseline to JDK 21 and cleanup obsolete JVM configurations --- docs/src/site/markdown/install.md | 2 +- pom.xml | 1 - .../org/apache/tez/client/TezClientUtils.java | 2 +- .../apache/tez/common/JavaOptsChecker.java | 9 - .../org/apache/tez/common/TezCommonUtils.java | 4 +- .../apache/tez/dag/api/TezConfiguration.java | 26 +- .../apache/tez/client/TestTezClientUtils.java | 21 +- .../tez/common/TestJavaOptsChecker.java | 30 +-- tez-tools/tez-javadoc-tools/pom.xml | 94 ------- .../tools/javadoc/model/ConfigProperty.java | 115 --------- .../javadoc/doclet/ConfigStandardDoclet.java | 230 ------------------ .../tools/javadoc/doclet/package-info.java | 25 -- .../tez/tools/javadoc/model/Config.java | 51 ---- .../tez/tools/javadoc/model/package-info.java | 25 -- .../tez/tools/javadoc/util/HtmlWriter.java | 160 ------------ .../apache/tez/tools/javadoc/util/Writer.java | 39 --- .../tez/tools/javadoc/util/XmlWriter.java | 107 -------- .../tez/tools/javadoc/util/package-info.java | 25 -- .../javadoc/doclet/ConfigStandardDoclet.java | 59 ++--- .../tools/javadoc/doclet/package-info.java | 2 +- .../tez/tools/javadoc/model/Config.java | 16 +- .../tools/javadoc/model/ConfigProperty.java | 16 +- .../tez/tools/javadoc/model/package-info.java | 2 +- .../tez/tools/javadoc/util/HtmlWriter.java | 22 +- .../apache/tez/tools/javadoc/util/Writer.java | 20 +- .../tez/tools/javadoc/util/XmlWriter.java | 16 +- .../tez/tools/javadoc/util/package-info.java | 2 +- 27 files changed, 100 insertions(+), 1021 deletions(-) delete mode 100644 tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/model/ConfigProperty.java delete mode 100644 tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java delete mode 100644 tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/doclet/package-info.java delete mode 100644 tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/model/Config.java delete mode 100644 tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/model/package-info.java delete mode 100644 tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/HtmlWriter.java delete mode 100644 tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/Writer.java delete mode 100644 tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/XmlWriter.java delete mode 100644 tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/package-info.java rename tez-tools/tez-javadoc-tools/src/main/{java-17 => java}/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java (96%) rename tez-tools/tez-javadoc-tools/src/main/{java-17 => java}/org/apache/tez/tools/javadoc/doclet/package-info.java (99%) rename tez-tools/tez-javadoc-tools/src/main/{java-17 => java}/org/apache/tez/tools/javadoc/model/Config.java (76%) rename tez-tools/tez-javadoc-tools/src/main/{java-8-16 => java}/org/apache/tez/tools/javadoc/model/ConfigProperty.java (87%) rename tez-tools/tez-javadoc-tools/src/main/{java-17 => java}/org/apache/tez/tools/javadoc/model/package-info.java (99%) rename tez-tools/tez-javadoc-tools/src/main/{java-17 => java}/org/apache/tez/tools/javadoc/util/HtmlWriter.java (93%) rename tez-tools/tez-javadoc-tools/src/main/{java-17 => java}/org/apache/tez/tools/javadoc/util/Writer.java (71%) rename tez-tools/tez-javadoc-tools/src/main/{java-17 => java}/org/apache/tez/tools/javadoc/util/XmlWriter.java (90%) rename tez-tools/tez-javadoc-tools/src/main/{java-17 => java}/org/apache/tez/tools/javadoc/util/package-info.java (99%) diff --git a/docs/src/site/markdown/install.md b/docs/src/site/markdown/install.md index 44ca862a82..0217ae3ba2 100644 --- a/docs/src/site/markdown/install.md +++ b/docs/src/site/markdown/install.md @@ -33,7 +33,7 @@ or higher. ``` 2. Build tez using `mvn clean package -DskipTests=true -Dmaven.javadoc.skip=true` - - This assumes that you have already installed JDK8 or later and Maven 3 or later. + - This assumes that you have already installed JDK 21 or later and Maven 3 or later. - Tez also requires Protocol Buffers 3.19.4, including the protoc-compiler. * This can be downloaded from https://github.com/google/protobuf/tags/. * On Mac OS X with the homebrew package manager `brew install protobuf250` diff --git a/pom.xml b/pom.xml index 38f2fec787..f1cdbcb6d5 100644 --- a/pom.xml +++ b/pom.xml @@ -1492,7 +1492,6 @@ - diff --git a/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java b/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java index 15dbd969d0..9e6338ddd8 100644 --- a/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java +++ b/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java @@ -1077,7 +1077,7 @@ static String constructAMLaunchOpts(TezConfiguration tezConf, Resource capabilit amOpts = amOpts + tezConf.get(TezConfiguration.TEZ_AM_LAUNCH_CMD_OPTS, TezConfiguration.TEZ_AM_LAUNCH_CMD_OPTS_DEFAULT); - amOpts = amOpts + TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_JDK17_CMD_OPTS_DEFAULT; + amOpts = amOpts + TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_ADD_OPENS_DEFAULT; amOpts = maybeAddDefaultMemoryJavaOpts(amOpts, capability, tezConf.getDouble(TezConfiguration.TEZ_CONTAINER_MAX_JAVA_HEAP_FRACTION, TezConfiguration.TEZ_CONTAINER_MAX_JAVA_HEAP_FRACTION_DEFAULT)); diff --git a/tez-api/src/main/java/org/apache/tez/common/JavaOptsChecker.java b/tez-api/src/main/java/org/apache/tez/common/JavaOptsChecker.java index e9f7cb03a1..04f2c9f734 100644 --- a/tez-api/src/main/java/org/apache/tez/common/JavaOptsChecker.java +++ b/tez-api/src/main/java/org/apache/tez/common/JavaOptsChecker.java @@ -65,15 +65,6 @@ public void checkOpts(String opts) throws TezException { } if (gcOpts.size() > 1) { - // Handle special case for " -XX:+UseParNewGC -XX:+UseConcMarkSweepGC " - // which can be specified together. - if (gcOpts.size() == 2) { - if (gcOpts.contains("UseParNewGC") - && gcOpts.contains("UseConcMarkSweepGC")) { - return; - } - } - LOG.debug("Found clashing GC opts, conflicting GC Values={}", gcOpts); throw new TezException("Invalid/conflicting GC options found," diff --git a/tez-api/src/main/java/org/apache/tez/common/TezCommonUtils.java b/tez-api/src/main/java/org/apache/tez/common/TezCommonUtils.java index 0c74f1bf2f..d3980c7c31 100644 --- a/tez-api/src/main/java/org/apache/tez/common/TezCommonUtils.java +++ b/tez-api/src/main/java/org/apache/tez/common/TezCommonUtils.java @@ -575,8 +575,6 @@ public static long getDAGSessionTimeout(Configuration conf) { public static int getJavaVersion() { String javaVersionString = System.getProperty("java.version"); - return javaVersionString.split("\\.")[0].equals("1") - ? Integer.parseInt(javaVersionString.split("\\.")[1]) // "1.8" -> 8 - : Integer.parseInt(javaVersionString.split("\\.")[0]); // "9.x" -> 9, "11.x" -> 11 + return Integer.parseInt(javaVersionString.split("\\.")[0]); // "21.x" -> 21 } } diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/TezConfiguration.java b/tez-api/src/main/java/org/apache/tez/dag/api/TezConfiguration.java index a19700d858..0f7d6d3754 100644 --- a/tez-api/src/main/java/org/apache/tez/dag/api/TezConfiguration.java +++ b/tez-api/src/main/java/org/apache/tez/dag/api/TezConfiguration.java @@ -33,7 +33,6 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.util.Shell; import org.apache.hadoop.yarn.api.records.LocalResource; -import org.apache.tez.common.TezCommonUtils; import org.apache.tez.common.annotation.ConfigurationClass; import org.apache.tez.common.annotation.ConfigurationProperty; import org.apache.tez.dag.api.EdgeProperty.ConcurrentEdgeTriggerType; @@ -400,7 +399,7 @@ public TezConfiguration(boolean loadDefaults) { public static final String TEZ_AM_LAUNCH_CLUSTER_DEFAULT_CMD_OPTS_DEFAULT = "-server -Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN"; - public static final String TEZ_AM_LAUNCH_CLUSTER_JDK17_CMD_OPTS_DEFAULT = + public static final String TEZ_AM_LAUNCH_CLUSTER_ADD_OPENS_DEFAULT = " --add-opens java.base/java.lang=ALL-UNNAMED"; /** * String value. Command line options provided during the launch of the Tez @@ -410,11 +409,8 @@ public TezConfiguration(boolean loadDefaults) { @ConfigurationScope(Scope.AM) @ConfigurationProperty public static final String TEZ_AM_LAUNCH_CMD_OPTS = TEZ_AM_PREFIX + "launch.cmd-opts"; - public static final String TEZ_AM_LAUNCH_CMD_OPTS_JDK8_DEFAULT = - "-XX:+PrintGCDetails -verbose:gc -XX:+PrintGCTimeStamps -XX:+UseNUMA -XX:+UseParallelGC"; - public static final String TEZ_AM_LAUNCH_CMD_OPTS_JDK9_DEFAULT = - "-verbose:gc -Xlog:gc*,safepoint::time,uptime -XX:+UseNUMA -XX:+UseParallelGC"; - public static final String TEZ_AM_LAUNCH_CMD_OPTS_DEFAULT; + public static final String TEZ_AM_LAUNCH_CMD_OPTS_DEFAULT = + "-Xlog:gc*,safepoint::time,uptime -XX:+UseNUMA -XX:+UseParallelGC"; /** * String value. Command line options which will be prepended to {@link @@ -438,21 +434,9 @@ public TezConfiguration(boolean loadDefaults) { @ConfigurationProperty public static final String TEZ_TASK_LAUNCH_CMD_OPTS = TEZ_TASK_PREFIX + "launch.cmd-opts"; - public static final String TEZ_TASK_LAUNCH_CMD_OPTS_JDK8_DEFAULT = - "-XX:+PrintGCDetails -verbose:gc -XX:+PrintGCTimeStamps -XX:+UseNUMA -XX:+UseParallelGC"; - public static final String TEZ_TASK_LAUNCH_CMD_OPTS_JDK9_DEFAULT = - "-verbose:gc -Xlog:gc*,safepoint::time,uptime -XX:+UseNUMA -XX:+UseParallelGC"; - public static final String TEZ_TASK_LAUNCH_CMD_OPTS_DEFAULT; + public static final String TEZ_TASK_LAUNCH_CMD_OPTS_DEFAULT = + "-Xlog:gc*,safepoint::time,uptime -XX:+UseNUMA -XX:+UseParallelGC"; - static { - if (TezCommonUtils.getJavaVersion() >= 9) { - TEZ_AM_LAUNCH_CMD_OPTS_DEFAULT = TEZ_AM_LAUNCH_CMD_OPTS_JDK9_DEFAULT; - TEZ_TASK_LAUNCH_CMD_OPTS_DEFAULT = TEZ_TASK_LAUNCH_CMD_OPTS_JDK9_DEFAULT; - } else { - TEZ_AM_LAUNCH_CMD_OPTS_DEFAULT = TEZ_AM_LAUNCH_CMD_OPTS_JDK8_DEFAULT; - TEZ_TASK_LAUNCH_CMD_OPTS_DEFAULT = TEZ_TASK_LAUNCH_CMD_OPTS_JDK8_DEFAULT; - } - } /** * Double value. Tez automatically determines the Xmx for the JVMs used to run diff --git a/tez-api/src/test/java/org/apache/tez/client/TestTezClientUtils.java b/tez-api/src/test/java/org/apache/tez/client/TestTezClientUtils.java index 42ccb1a3ff..2d18bc5d3e 100644 --- a/tez-api/src/test/java/org/apache/tez/client/TestTezClientUtils.java +++ b/tez-api/src/test/java/org/apache/tez/client/TestTezClientUtils.java @@ -538,17 +538,17 @@ public void testAMCommandOpts() { assertEquals(tmpOpts + " " + TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_DEFAULT_CMD_OPTS_DEFAULT + " " + amCommandOpts - + TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_JDK17_CMD_OPTS_DEFAULT, + + TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_ADD_OPENS_DEFAULT, amOptsConstructed); // Test2: Setup cluster-default command opts explicitly String clusterDefaultCommandOpts = - "-server -Djava.net.preferIPv4Stack=true -XX:+PrintGCDetails -verbose:gc "; + "-server -Djava.net.preferIPv4Stack=true -Xlog:gc "; tezConf.set(TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_DEFAULT_CMD_OPTS, clusterDefaultCommandOpts); amOptsConstructed = TezClientUtils.constructAMLaunchOpts(tezConf, Resource.newInstance(1024, 1)); assertEquals(tmpOpts + " " + clusterDefaultCommandOpts + " " + amCommandOpts - + TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_JDK17_CMD_OPTS_DEFAULT, amOptsConstructed); + + TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_ADD_OPENS_DEFAULT, amOptsConstructed); // Test3: Don't setup Xmx explicitly @@ -560,17 +560,17 @@ public void testAMCommandOpts() { // It's OK for the Xmx value to show up before cluster default options, since Xmx will not be replaced if it already exists. assertEquals( " -Xmx" + ((int) (1024 * factor)) + "m" + " " + tmpOpts + " " + clusterDefaultCommandOpts + " " + - amCommandOpts + TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_JDK17_CMD_OPTS_DEFAULT, + amCommandOpts + TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_ADD_OPENS_DEFAULT, amOptsConstructed); // Test4: Ensure admin options with Xmx does not cause them to be overridden. This should almost never be done though. clusterDefaultCommandOpts = - "-server -Djava.net.preferIPv4Stack=true -XX:+PrintGCDetails -verbose:gc -Xmx200m"; + "-server -Djava.net.preferIPv4Stack=true -Xlog:gc -Xmx200m"; tezConf.set(TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_DEFAULT_CMD_OPTS, clusterDefaultCommandOpts); amOptsConstructed = TezClientUtils.constructAMLaunchOpts(tezConf, Resource.newInstance(1024, 1)); assertEquals(tmpOpts + " " + clusterDefaultCommandOpts + " " + amCommandOpts - + TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_JDK17_CMD_OPTS_DEFAULT, amOptsConstructed); + + TezConfiguration.TEZ_AM_LAUNCH_CLUSTER_ADD_OPENS_DEFAULT, amOptsConstructed); } @Test(timeout = 5000) @@ -590,11 +590,10 @@ public void testTaskCommandOpts() throws TezException { // Test2: Setup cluster-default command opts explicitly String taskClusterDefaultCommandOpts = - "-server -Djava.net.preferIPv4Stack=true -XX:+PrintGCDetails -verbose:gc "; - tezConf.set(TezConfiguration.TEZ_TASK_LAUNCH_CLUSTER_DEFAULT_CMD_OPTS, - taskClusterDefaultCommandOpts); - taskOptsConstructed = - TezClientUtils.addDefaultsToTaskLaunchCmdOpts("", tezConf); + "-server -Djava.net.preferIPv4Stack=true -Xlog:gc "; + tezConf.set( + TezConfiguration.TEZ_TASK_LAUNCH_CLUSTER_DEFAULT_CMD_OPTS, taskClusterDefaultCommandOpts); + taskOptsConstructed = TezClientUtils.addDefaultsToTaskLaunchCmdOpts("", tezConf); expected = taskClusterDefaultCommandOpts + " " + taskCommandOpts; assertTrue( "Did not find Expected prefix: [" + expected + "] in string [" + taskOptsConstructed + diff --git a/tez-api/src/test/java/org/apache/tez/common/TestJavaOptsChecker.java b/tez-api/src/test/java/org/apache/tez/common/TestJavaOptsChecker.java index c945c89b8d..1fc510662a 100644 --- a/tez-api/src/test/java/org/apache/tez/common/TestJavaOptsChecker.java +++ b/tez-api/src/test/java/org/apache/tez/common/TestJavaOptsChecker.java @@ -36,7 +36,7 @@ public void testBasicChecker() throws TezException { @Test(timeout = 5000) public void testMultipleGC() { // Clashing GC values - String opts = "-XX:+UseConcMarkSweepGC -XX:+UseG1GC -XX:+UseParallelGC "; + String opts = "-XX:+UseSerialGC -XX:+UseG1GC -XX:+UseParallelGC "; try { javaOptsChecker.checkOpts(opts); Assert.fail("Expected check to fail with opts=" + opts); @@ -49,7 +49,7 @@ public void testMultipleGC() { @Test(timeout = 5000) public void testPositiveNegativeOpts() throws TezException { // Multiple positive GC values - String opts = "-XX:+UseConcMarkSweepGC -XX:+UseG1GC -XX:+UseParallelGC -XX:-UseG1GC "; + String opts = "-XX:+UseSerialGC -XX:+UseG1GC -XX:+UseParallelGC -XX:-UseG1GC "; try { javaOptsChecker.checkOpts(opts); Assert.fail("Expected check to fail with opts=" + opts); @@ -83,32 +83,8 @@ public void testPositiveNegativeOpts() throws TezException { javaOptsChecker.checkOpts(opts); // Invalid negative can be ignored - opts = " -XX:+UseG1GC -XX:+UseParallelGC -XX:-UseG1GC -XX:-UseConcMarkSweepGC "; + opts = " -XX:+UseG1GC -XX:+UseParallelGC -XX:-UseG1GC -XX:-UseSerialGC "; javaOptsChecker.checkOpts(opts); - - } - - @Test(timeout = 5000) - public void testSpecialCaseNonConflictingGCOptions() throws TezException { - String opts = " -XX:+UseParNewGC -XX:+UseConcMarkSweepGC "; - javaOptsChecker.checkOpts(opts); - - opts += " -XX:+DisableExplicitGC "; - javaOptsChecker.checkOpts(opts); - - opts += " -XX:-UseG1GC "; - javaOptsChecker.checkOpts(opts); - - opts += " -XX:+UseG1GC "; - try { - javaOptsChecker.checkOpts(opts); - Assert.fail("Expected check to fail with opts=" + opts); - } catch (TezException e) { - Assert.assertTrue(e.getMessage(), - e.getMessage().contains("Invalid/conflicting GC options found")); - } - - } } diff --git a/tez-tools/tez-javadoc-tools/pom.xml b/tez-tools/tez-javadoc-tools/pom.xml index a3927227ba..686829b1d9 100644 --- a/tez-tools/tez-javadoc-tools/pom.xml +++ b/tez-tools/tez-javadoc-tools/pom.xml @@ -47,100 +47,6 @@ - - - platform-macosx - - - ${java.home}/../Classes/classes.jar - - - - - com.sun - tools - ${java.version} - system - ${java.home}/../Classes/classes.jar - - - - - other-os - - - ${java.home}/../lib/tools.jar - - - - - com.sun - tools - ${java.version} - system - ${java.home}/../lib/tools.jar - - - - - - java8-16 - - [1.8,16] - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - generate-sources - - add-source - - - - src/main/java-8-16 - - - - - - - - - - - java17 - - [17,) - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - generate-sources - - add-source - - - - src/main/java-17 - - - - - - - - - - - diff --git a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/model/ConfigProperty.java b/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/model/ConfigProperty.java deleted file mode 100644 index 27208de55b..0000000000 --- a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/model/ConfigProperty.java +++ /dev/null @@ -1,115 +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.tez.tools.javadoc.model; - -public class ConfigProperty { - - private String propertyName; - private String defaultValue; - private String description; - private String type = "string"; - private boolean isPrivate = false; - private boolean isUnstable = false; - private boolean isEvolving = false; - private boolean isValidConfigProp = false; - private String inferredType; - - public String getPropertyName() { - return propertyName; - } - - public void setPropertyName(String propertyName) { - this.propertyName = propertyName; - } - - public String getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(String defaultValue) { - this.defaultValue = defaultValue; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public boolean isPrivate() { - return isPrivate; - } - - public void setPrivate(boolean aPrivate) { - isPrivate = aPrivate; - } - - public boolean isUnstable() { - return isUnstable; - } - - public void setUnstable(boolean unstable) { - isUnstable = unstable; - } - - public boolean isEvolving() { - return isEvolving; - } - - public void setEvolving(boolean evolving) { - isEvolving = evolving; - } - - public boolean isValidConfigProp() { - return isValidConfigProp; - } - - public void setValidConfigProp(boolean validConfigProp) { - isValidConfigProp = validConfigProp; - } - - public String getInferredType() { - return inferredType; - } - - public void setInferredType(String inferredType) { - this.inferredType = inferredType; - } - - @Override - public String toString() { - return "name=" + getPropertyName() - + ", defaultValue=" + getDefaultValue() - + ", description=" + getDescription() - + ", type=" + getType() - + ", inferredType=" + getInferredType() - + ", private=" + isPrivate() - + ", isConfigProp=" + isValidConfigProp(); - } -} diff --git a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java b/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java deleted file mode 100644 index a67b9dbcde..0000000000 --- a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java +++ /dev/null @@ -1,230 +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.tez.tools.javadoc.doclet; - -import java.io.IOException; -import java.util.Map; - -import com.sun.javadoc.AnnotationDesc; -import com.sun.javadoc.AnnotationDesc.ElementValuePair; -import com.sun.javadoc.ClassDoc; -import com.sun.javadoc.DocErrorReporter; -import com.sun.javadoc.FieldDoc; -import com.sun.javadoc.LanguageVersion; -import com.sun.javadoc.RootDoc; -import com.sun.tools.doclets.standard.Standard; - -import org.apache.hadoop.classification.InterfaceAudience.Private; -import org.apache.hadoop.classification.InterfaceStability.Evolving; -import org.apache.hadoop.classification.InterfaceStability.Unstable; -import org.apache.tez.common.annotation.ConfigurationClass; -import org.apache.tez.common.annotation.ConfigurationProperty; -import org.apache.tez.tools.javadoc.model.Config; -import org.apache.tez.tools.javadoc.model.ConfigProperty; -import org.apache.tez.tools.javadoc.util.HtmlWriter; -import org.apache.tez.tools.javadoc.util.XmlWriter; - -public final class ConfigStandardDoclet { - - private static final String DEBUG_SWITCH = "-debug"; - private static boolean debugMode = false; - - private ConfigStandardDoclet() { - } - - public static LanguageVersion languageVersion() { - return LanguageVersion.JAVA_1_5; - } - - private static void logMessage(String message) { - if (!debugMode) { - return; - } - System.out.println(message); - } - - public static boolean start(RootDoc root) { - //look for debug flag - for (String[] opts : root.options()) { - for (String opt : opts) { - if (opt.equals(DEBUG_SWITCH)) { - debugMode = true; - break; - } - } - } - - logMessage("Running doclet " + ConfigStandardDoclet.class.getSimpleName()); - ClassDoc[] classes = root.classes(); - for (ClassDoc aClass : classes) { - processDoc(aClass); - } - - return true; - } - - private static void processDoc(ClassDoc doc) { - logMessage("Parsing : " + doc); - if (!doc.isClass()) { - logMessage("Ignoring non-class: " + doc); - return; - } - - AnnotationDesc[] annotations = doc.annotations(); - boolean isConfigClass = false; - String templateName = null; - for (AnnotationDesc annotation : annotations) { - logMessage("Checking annotation: " + annotation.annotationType()); - if (annotation.annotationType().qualifiedTypeName().equals( - ConfigurationClass.class.getName())) { - isConfigClass = true; - for (ElementValuePair element : annotation.elementValues()) { - if (element.element().name().equals("templateFileName")) { - templateName = stripQuotes(element.value().toString()); - } - } - break; - } - } - - if (!isConfigClass) { - logMessage("Ignoring non-config class: " + doc); - return; - } - - logMessage("Processing config class: " + doc); - Config config = new Config(doc.name(), templateName); - Map configProperties = config.getConfigProperties(); - - FieldDoc[] fields = doc.fields(); - for (FieldDoc field : fields) { - if (field.isPrivate()) { - logMessage("Skipping private field: " + field); - continue; - } - if (!field.isStatic()) { - logMessage("Skipping non-static field: " + field); - continue; - } - - if (field.name().endsWith("_PREFIX")) { - logMessage("Skipping non-config prefix constant field: " + field); - continue; - } - if (field.name().equals("TEZ_SITE_XML")) { - logMessage("Skipping constant field: " + field); - continue; - } - - if (field.name().endsWith("_DEFAULT")) { - - String name = field.name().substring(0, - field.name().lastIndexOf("_DEFAULT")); - if (!configProperties.containsKey(name)) { - configProperties.put(name, new ConfigProperty()); - } - ConfigProperty configProperty = configProperties.get(name); - if (field.constantValue() == null) { - logMessage("Got null constant value" - + ", name=" + name - + ", field=" + field.name() - + ", val=" + field.constantValueExpression()); - configProperty.setDefaultValue(field.constantValueExpression()); - } else { - configProperty.setDefaultValue(field.constantValue().toString()); - } - configProperty.setInferredType(field.type().simpleTypeName()); - - if (name.equals("TEZ_AM_STAGING_DIR") && configProperty.getDefaultValue() != null) { - String defaultValue = configProperty.getDefaultValue(); - defaultValue = defaultValue.replace(System.getProperty("user.name"), "${user.name}"); - configProperty.setDefaultValue(defaultValue); - } - - continue; - } - - String name = field.name(); - if (!configProperties.containsKey(name)) { - configProperties.put(name, new ConfigProperty()); - } - ConfigProperty configProperty = configProperties.get(name); - configProperty.setPropertyName(field.constantValue().toString()); - - AnnotationDesc[] annotationDescs = field.annotations(); - - for (AnnotationDesc annotationDesc : annotationDescs) { - - if (annotationDesc.annotationType().qualifiedTypeName().equals( - Private.class.getCanonicalName())) { - configProperty.setPrivate(true); - } - if (annotationDesc.annotationType().qualifiedTypeName().equals( - Unstable.class.getCanonicalName())) { - configProperty.setUnstable(true); - } - if (annotationDesc.annotationType().qualifiedTypeName().equals( - Evolving.class.getCanonicalName())) { - configProperty.setEvolving(true); - } - if (annotationDesc.annotationType().qualifiedTypeName().equals( - ConfigurationProperty.class.getCanonicalName())) { - configProperty.setValidConfigProp(true); - - for (ElementValuePair element : annotationDesc.elementValues()) { - if (element.element().name().equals("type")) { - configProperty.setType(stripQuotes(element.value().toString())); - } else { - logMessage("Unhandled annotation property: " + element.element().name()); - } - } - } - - HtmlWriter writer = new HtmlWriter(); - try { - writer.write(config); - } catch (IOException e) { - throw new RuntimeException(e); - } - - XmlWriter xmlWriter = new XmlWriter(); - try { - xmlWriter.write(config); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - } - } - - private static String stripQuotes(String s) { - if (s.charAt(0) == '"' && s.charAt(s.length() - 1) == '"') { - return s.substring(1, s.length() - 1); - } - return s; - } - - public static int optionLength(String option) { - return Standard.optionLength(option); - } - - public static boolean validOptions(String[][] options, DocErrorReporter reporter) { - return true; - } -} diff --git a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/doclet/package-info.java b/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/doclet/package-info.java deleted file mode 100644 index de13838477..0000000000 --- a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/doclet/package-info.java +++ /dev/null @@ -1,25 +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. - */ - -/** - * Custom Javadoc doclets for Tez (e.g. config documentation generator). - */ -@Private -package org.apache.tez.tools.javadoc.doclet; - -import org.apache.hadoop.classification.InterfaceAudience.Private; \ No newline at end of file diff --git a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/model/Config.java b/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/model/Config.java deleted file mode 100644 index 0556a4e37a..0000000000 --- a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/model/Config.java +++ /dev/null @@ -1,51 +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.tez.tools.javadoc.model; - -import java.util.Map; -import java.util.TreeMap; - -public class Config { - - private final String templateName; - private final String configName; - private Map configProperties; - - public Config(String configName, String templateName) { - this.configName = configName; - this.templateName = templateName; - this.setConfigProperties(new TreeMap()); - } - - public String getTemplateName() { - return templateName; - } - - public String getConfigName() { - return configName; - } - - public Map getConfigProperties() { - return configProperties; - } - - public void setConfigProperties(Map configProperties) { - this.configProperties = configProperties; - } -} diff --git a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/model/package-info.java b/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/model/package-info.java deleted file mode 100644 index 10fcee1f4c..0000000000 --- a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/model/package-info.java +++ /dev/null @@ -1,25 +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. - */ - -/** - * Data model types used by the Tez Javadoc doclets. - */ -@Private -package org.apache.tez.tools.javadoc.model; - -import org.apache.hadoop.classification.InterfaceAudience.Private; \ No newline at end of file diff --git a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/HtmlWriter.java b/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/HtmlWriter.java deleted file mode 100644 index 548908c8e1..0000000000 --- a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/HtmlWriter.java +++ /dev/null @@ -1,160 +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.tez.tools.javadoc.util; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; - -import org.apache.tez.tools.javadoc.model.Config; -import org.apache.tez.tools.javadoc.model.ConfigProperty; - -public class HtmlWriter extends Writer { - - private static final String DEFAULT_STYLESHEET = "default-stylesheet.css"; - - public void write(Config config) throws IOException { - PrintWriter out = null; - - if (config.getConfigName() == null || config.getConfigName().isEmpty()) { - throw new RuntimeException("Config Name is null or empty"); - } - - try { - File file = new File(config.getConfigName() + ".html"); - out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8")); - - out.println(""); - out.println(""); - - out.println(""); - - out.println(""); - out.println(""); - out.println("" + config.getConfigName() + ""); - out.println(""); - - out.println(""); - - out.println(""); - - out.println("
"); - out.println("
"); - - out.println("

" + config.getConfigName() + "

"); - out.println("
"); - - out.println(""); - out.println(""); - out.println(""); - out.println(""); - out.println(""); - out.println(""); - // out.println(""); - out.println(""); - out.println(""); - out.println(""); - out.println(""); - - for (ConfigProperty configProperty : config.getConfigProperties().values()) { - if (!isValidConfigProperty(configProperty)) { - continue; - } - - String altClass = ""; - if (configProperty.isPrivate()) { - altClass = "class=\"tr_private\""; - } else if (configProperty.isEvolving() || configProperty.isUnstable()) { - altClass = "class=\"tr_evolve_unstable\""; - } - - out.println(""); - out.println(""); - out.println(""); - out.println(""); - out.println(""); - - out.println( - ""); - out.println( - ""); - out.println( - ""); - out.println(""); - } - - out.println("
" + "Property Name" + "" + "Default Value" + "" + "Description" + "" + "Type" + "" + "Valid Values" + "" + "Is Private?" + "" + "Is Unstable?" + "" + "Is Evolving?" + "
" + configProperty.getPropertyName() + "" + configProperty.getDefaultValue() + "" + configProperty.getDescription() + "" + configProperty.getType() + "" + configProperty.isPrivate() + "" - + configProperty.isEvolving() + "" - + configProperty.isUnstable() + "
"); - - out.println("
"); - out.println("
"); - out.println(""); - out.println(""); - } finally { - if (out != null) { - out.close(); - } - } - } -} diff --git a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/Writer.java b/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/Writer.java deleted file mode 100644 index ca8ff80d95..0000000000 --- a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/Writer.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.tez.tools.javadoc.util; - -import java.io.IOException; - -import org.apache.tez.tools.javadoc.model.Config; -import org.apache.tez.tools.javadoc.model.ConfigProperty; - -public abstract class Writer { - - public abstract void write(Config config) throws IOException; - - public boolean isValidConfigProperty(ConfigProperty configProperty) { - if (!configProperty.isValidConfigProp()) { - return false; - } - if (configProperty.getPropertyName() == null || configProperty.getPropertyName().isEmpty()) { - return false; - } - return true; - } -} diff --git a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/XmlWriter.java b/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/XmlWriter.java deleted file mode 100644 index f2586f7cd7..0000000000 --- a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/XmlWriter.java +++ /dev/null @@ -1,107 +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.tez.tools.javadoc.util; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; - -import org.apache.commons.lang3.StringEscapeUtils; -import org.apache.tez.tools.javadoc.model.Config; -import org.apache.tez.tools.javadoc.model.ConfigProperty; - -import com.google.common.io.ByteStreams; - -public class XmlWriter extends Writer { - - public void write(Config config) throws IOException { - PrintWriter out = null; - - if (config.getConfigName() == null || config.getConfigName().isEmpty()) { - throw new RuntimeException("Config Name is null or empty"); - } - - String fileName = config.getTemplateName() == null || - config.getTemplateName().isEmpty() ? config.getConfigName() : config.getTemplateName(); - if (!fileName.endsWith(".xml")) { - fileName += ".xml"; - } - - try { - File file = new File(fileName); - writeApacheHeader(file); - - out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file, true), "UTF-8")); - - out.println(""); - out.println(); - out.println(""); - out.println(); - out.println(""); - - for (ConfigProperty configProperty : config.getConfigProperties().values()) { - if (!isValidConfigProperty(configProperty)) { - continue; - } - out.println(); - out.println(" "); - out.println(" " + configProperty.getPropertyName() + ""); - if (configProperty.getDefaultValue() != null && !configProperty.getDefaultValue().isEmpty()) { - out.println(" " + configProperty.getDefaultValue() + ""); - } - if (configProperty.getDescription() != null && !configProperty.getDescription().isEmpty()) { - out.println(" " - + StringEscapeUtils.escapeXml(configProperty.getDescription()) + ""); - } - if (configProperty.getType() != null && !configProperty.getType().isEmpty()) { - out.println(" " + configProperty.getType() + ""); - } - if (configProperty.isUnstable()) { - out.println(" true"); - } - if (configProperty.isEvolving()) { - out.println(" true"); - } - if (configProperty.isPrivate()) { - out.println(" true"); - } - out.println(" "); - } - - out.println(); - out.println(""); - } finally { - if (out != null) { - out.close(); - } - } - } - - private void writeApacheHeader(File file) throws IOException { - try (InputStream in = this.getClass().getClassLoader().getResourceAsStream("apache-licence.xml.header"); - OutputStream out = new FileOutputStream(file)) { - ByteStreams.copy(in, out); - } - } -} diff --git a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/package-info.java b/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/package-info.java deleted file mode 100644 index 1c2fed4282..0000000000 --- a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/util/package-info.java +++ /dev/null @@ -1,25 +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. - */ - -/** - * Utility classes for the Tez Javadoc doclets. - */ -@Private -package org.apache.tez.tools.javadoc.util; - -import org.apache.hadoop.classification.InterfaceAudience.Private; \ No newline at end of file diff --git a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java similarity index 96% rename from tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java rename to tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java index bd321475c4..1691c43c92 100644 --- a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java +++ b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java @@ -1,4 +1,4 @@ -/** +/* * 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 @@ -7,30 +7,24 @@ * "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 + * 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. + * 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.tez.tools.javadoc.doclet; -import com.sun.source.util.DocTrees; -import jdk.javadoc.doclet.Doclet; -import jdk.javadoc.doclet.DocletEnvironment; -import jdk.javadoc.doclet.Reporter; -import org.apache.hadoop.classification.InterfaceAudience.Private; -import org.apache.hadoop.classification.InterfaceStability.Evolving; -import org.apache.hadoop.classification.InterfaceStability.Unstable; -import org.apache.tez.common.annotation.ConfigurationClass; -import org.apache.tez.common.annotation.ConfigurationProperty; -import org.apache.tez.tools.javadoc.model.Config; -import org.apache.tez.tools.javadoc.model.ConfigProperty; -import org.apache.tez.tools.javadoc.util.HtmlWriter; -import org.apache.tez.tools.javadoc.util.XmlWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; import javax.lang.model.SourceVersion; import javax.lang.model.element.AnnotationMirror; @@ -42,13 +36,22 @@ import javax.lang.model.element.TypeElement; import javax.lang.model.element.VariableElement; import javax.tools.Diagnostic; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; + +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.tez.common.annotation.ConfigurationClass; +import org.apache.tez.common.annotation.ConfigurationProperty; +import org.apache.tez.tools.javadoc.model.Config; +import org.apache.tez.tools.javadoc.model.ConfigProperty; +import org.apache.tez.tools.javadoc.util.HtmlWriter; +import org.apache.tez.tools.javadoc.util.XmlWriter; + +import com.sun.source.util.DocTrees; + +import jdk.javadoc.doclet.Doclet; +import jdk.javadoc.doclet.DocletEnvironment; +import jdk.javadoc.doclet.Reporter; public class ConfigStandardDoclet implements Doclet { diff --git a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/doclet/package-info.java b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/doclet/package-info.java similarity index 99% rename from tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/doclet/package-info.java rename to tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/doclet/package-info.java index de13838477..7d2ec087ae 100644 --- a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/doclet/package-info.java +++ b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/doclet/package-info.java @@ -22,4 +22,4 @@ @Private package org.apache.tez.tools.javadoc.doclet; -import org.apache.hadoop.classification.InterfaceAudience.Private; \ No newline at end of file +import org.apache.hadoop.classification.InterfaceAudience.Private; diff --git a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/model/Config.java b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/model/Config.java similarity index 76% rename from tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/model/Config.java rename to tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/model/Config.java index d5121aaad7..af36c4ed3b 100644 --- a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/model/Config.java +++ b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/model/Config.java @@ -1,4 +1,4 @@ -/** +/* * 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 @@ -7,15 +7,15 @@ * "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 + * 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. + * 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.tez.tools.javadoc.model; import java.util.Map; diff --git a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/model/ConfigProperty.java b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/model/ConfigProperty.java similarity index 87% rename from tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/model/ConfigProperty.java rename to tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/model/ConfigProperty.java index 27208de55b..653c50312d 100644 --- a/tez-tools/tez-javadoc-tools/src/main/java-8-16/org/apache/tez/tools/javadoc/model/ConfigProperty.java +++ b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/model/ConfigProperty.java @@ -1,4 +1,4 @@ -/** +/* * 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 @@ -7,15 +7,15 @@ * "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 + * 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. + * 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.tez.tools.javadoc.model; public class ConfigProperty { diff --git a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/model/package-info.java b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/model/package-info.java similarity index 99% rename from tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/model/package-info.java rename to tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/model/package-info.java index 10fcee1f4c..6b17b63d30 100644 --- a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/model/package-info.java +++ b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/model/package-info.java @@ -22,4 +22,4 @@ @Private package org.apache.tez.tools.javadoc.model; -import org.apache.hadoop.classification.InterfaceAudience.Private; \ No newline at end of file +import org.apache.hadoop.classification.InterfaceAudience.Private; diff --git a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/util/HtmlWriter.java b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/HtmlWriter.java similarity index 93% rename from tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/util/HtmlWriter.java rename to tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/HtmlWriter.java index 9c512ee7f7..a5b1dd2959 100644 --- a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/util/HtmlWriter.java +++ b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/HtmlWriter.java @@ -1,4 +1,4 @@ -/** +/* * 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 @@ -7,23 +7,23 @@ * "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 + * 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. + * 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.tez.tools.javadoc.util; -import org.apache.tez.tools.javadoc.model.Config; -import org.apache.tez.tools.javadoc.model.ConfigProperty; - import java.io.*; import java.nio.charset.StandardCharsets; +import org.apache.tez.tools.javadoc.model.Config; +import org.apache.tez.tools.javadoc.model.ConfigProperty; + public class HtmlWriter extends Writer { private static final String DEFAULT_STYLESHEET = "default-stylesheet.css"; diff --git a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/util/Writer.java b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/Writer.java similarity index 71% rename from tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/util/Writer.java rename to tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/Writer.java index 523f8cae9f..c45ffe4b02 100644 --- a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/util/Writer.java +++ b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/Writer.java @@ -1,4 +1,4 @@ -/** +/* * 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 @@ -7,22 +7,22 @@ * "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 + * 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. + * 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.tez.tools.javadoc.util; +import java.io.IOException; + import org.apache.tez.tools.javadoc.model.Config; import org.apache.tez.tools.javadoc.model.ConfigProperty; -import java.io.IOException; - public abstract class Writer { public abstract void write(Config config) throws IOException; diff --git a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/util/XmlWriter.java b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/XmlWriter.java similarity index 90% rename from tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/util/XmlWriter.java rename to tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/XmlWriter.java index ba4b80119c..e1d88e8248 100644 --- a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/util/XmlWriter.java +++ b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/XmlWriter.java @@ -1,4 +1,4 @@ -/** +/* * 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 @@ -7,15 +7,15 @@ * "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 + * 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. + * 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.tez.tools.javadoc.util; import java.io.File; diff --git a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/util/package-info.java b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/package-info.java similarity index 99% rename from tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/util/package-info.java rename to tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/package-info.java index 1c2fed4282..5495c566ed 100644 --- a/tez-tools/tez-javadoc-tools/src/main/java-17/org/apache/tez/tools/javadoc/util/package-info.java +++ b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/package-info.java @@ -22,4 +22,4 @@ @Private package org.apache.tez.tools.javadoc.util; -import org.apache.hadoop.classification.InterfaceAudience.Private; \ No newline at end of file +import org.apache.hadoop.classification.InterfaceAudience.Private;