diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 19659f2d79..f81c1ad8b1 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -27,7 +27,7 @@ jobs:
build:
strategy:
matrix:
- java-version: [8, 11]
+ java-version: [8, 11, 17]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
diff --git a/tez-tools/pom.xml b/tez-tools/pom.xml
index 8811d80687..b5a8326c12 100644
--- a/tez-tools/pom.xml
+++ b/tez-tools/pom.xml
@@ -50,6 +50,25 @@
tez-tfile-parser
+
+ jdk8-16
+
+ [1.8,16]
+
+
+ tez-javadoc-tools-base-jdk8
+
+
+
+ jdk17plus
+
+
+ [17,)
+
+
+ tez-javadoc-tools-base
+
+
diff --git a/tez-tools/tez-javadoc-tools-base-jdk8/findbugs-exclude.xml b/tez-tools/tez-javadoc-tools-base-jdk8/findbugs-exclude.xml
new file mode 100644
index 0000000000..d6e84af607
--- /dev/null
+++ b/tez-tools/tez-javadoc-tools-base-jdk8/findbugs-exclude.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tez-tools/tez-javadoc-tools-base-jdk8/pom.xml b/tez-tools/tez-javadoc-tools-base-jdk8/pom.xml
new file mode 100644
index 0000000000..f611309e63
--- /dev/null
+++ b/tez-tools/tez-javadoc-tools-base-jdk8/pom.xml
@@ -0,0 +1,106 @@
+
+
+
+
+ 4.0.0
+
+ org.apache.tez
+ tez-tools
+ 0.10.5-SNAPSHOT
+
+ tez-javadoc-tools-base-jdk8
+
+
+
+ org.slf4j
+ slf4j-api
+
+
+ org.apache.tez
+ tez-api
+
+
+ org.apache.hadoop
+ hadoop-annotations
+
+
+ commons-lang
+ commons-lang
+
+
+
+
+
+ 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
+
+
+
+
+
+
+
+
+
+ org.apache.rat
+ apache-rat-plugin
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+ true
+
+
+
+ maven-javadoc-plugin
+
+ org.apache.tez.tools.javadoc.doclet
+
+
+
+
+
+
diff --git a/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java b/tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java
similarity index 82%
rename from tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java
rename to tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java
index 0713467c73..58bc5a55ce 100644
--- a/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java
+++ b/tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/doclet/ConfigStandardDoclet.java
@@ -6,9 +6,9 @@
* 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
- *
+ *
+ * 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.
@@ -21,6 +21,15 @@
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;
@@ -31,21 +40,13 @@
import org.apache.tez.tools.javadoc.util.HtmlWriter;
import org.apache.tez.tools.javadoc.util.XmlWriter;
-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;
-
public final class ConfigStandardDoclet {
private static final String DEBUG_SWITCH = "-debug";
private static boolean debugMode = false;
- private ConfigStandardDoclet() {}
+ private ConfigStandardDoclet() {
+ }
public static LanguageVersion languageVersion() {
return LanguageVersion.JAVA_1_5;
@@ -109,7 +110,7 @@ private static void processDoc(ClassDoc doc) {
logMessage("Processing config class: " + doc);
Config config = new Config(doc.name(), templateName);
- Map configProperties = config.configProperties;
+ Map configProperties = config.getConfigProperties();
FieldDoc[] fields = doc.fields();
for (FieldDoc field : fields) {
@@ -144,16 +145,16 @@ private static void processDoc(ClassDoc doc) {
+ ", name=" + name
+ ", field=" + field.name()
+ ", val=" + field.constantValueExpression());
- configProperty.defaultValue = field.constantValueExpression();
+ configProperty.setDefaultValue(field.constantValueExpression());
} else {
- configProperty.defaultValue = field.constantValue().toString();
+ configProperty.setDefaultValue(field.constantValue().toString());
}
- configProperty.inferredType = field.type().simpleTypeName();
+ configProperty.setInferredType(field.type().simpleTypeName());
- if (name.equals("TEZ_AM_STAGING_DIR") && configProperty.defaultValue != null) {
- String defaultValue = configProperty.defaultValue;
+ if (name.equals("TEZ_AM_STAGING_DIR") && configProperty.getDefaultValue() != null) {
+ String defaultValue = configProperty.getDefaultValue();
defaultValue = defaultValue.replace(System.getProperty("user.name"), "${user.name}");
- configProperty.defaultValue = defaultValue;
+ configProperty.setDefaultValue(defaultValue);
}
continue;
@@ -164,7 +165,7 @@ private static void processDoc(ClassDoc doc) {
configProperties.put(name, new ConfigProperty());
}
ConfigProperty configProperty = configProperties.get(name);
- configProperty.propertyName = field.constantValue().toString();
+ configProperty.setPropertyName(field.constantValue().toString());
AnnotationDesc[] annotationDescs = field.annotations();
@@ -172,53 +173,49 @@ private static void processDoc(ClassDoc doc) {
if (annotationDesc.annotationType().qualifiedTypeName().equals(
Private.class.getCanonicalName())) {
- configProperty.isPrivate = true;
+ configProperty.setPrivate(true);
}
if (annotationDesc.annotationType().qualifiedTypeName().equals(
Unstable.class.getCanonicalName())) {
- configProperty.isUnstable = true;
+ configProperty.setUnstable(true);
}
if (annotationDesc.annotationType().qualifiedTypeName().equals(
Evolving.class.getCanonicalName())) {
- configProperty.isEvolving = true;
+ configProperty.setEvolving(true);
}
if (annotationDesc.annotationType().qualifiedTypeName().equals(
ConfigurationProperty.class.getCanonicalName())) {
- configProperty.isValidConfigProp = true;
+ configProperty.setValidConfigProp(true);
for (ElementValuePair element : annotationDesc.elementValues()) {
if (element.element().name().equals("type")) {
- configProperty.type = stripQuotes(element.value().toString());
+ configProperty.setType(stripQuotes(element.value().toString()));
} else {
logMessage("Unhandled annotation property: " + element.element().name());
}
}
}
- }
-
- configProperty.description = field.commentText();
- }
-
- HtmlWriter writer = new HtmlWriter();
- try {
- writer.write(config);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
+ 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);
+ 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);
+ if (s.charAt(0) == '"' && s.charAt(s.length() - 1) == '"') {
+ return s.substring(1, s.length() - 1);
}
return s;
}
diff --git a/tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/doclet/package-info.java b/tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/doclet/package-info.java
new file mode 100644
index 0000000000..190ae4622e
--- /dev/null
+++ b/tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/doclet/package-info.java
@@ -0,0 +1,22 @@
+/**
+ * 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.
+ */
+
+@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-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/model/Config.java b/tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/model/Config.java
new file mode 100644
index 0000000000..aa9330023c
--- /dev/null
+++ b/tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/model/Config.java
@@ -0,0 +1,51 @@
+/**
+ * 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-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/model/ConfigProperty.java b/tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/model/ConfigProperty.java
new file mode 100644
index 0000000000..175cddeab2
--- /dev/null
+++ b/tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/model/ConfigProperty.java
@@ -0,0 +1,121 @@
+/**
+ * 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[] validValues;
+ 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;
+ }
+
+ protected String[] getValidValues() {
+ return validValues;
+ }
+
+ 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()
+ + ", validValues=" + (getValidValues() == null ? "null" : getValidValues())
+ + ", isConfigProp=" + isValidConfigProp();
+ }
+}
diff --git a/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/model/Config.java b/tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/model/package-info.java
similarity index 65%
rename from tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/model/Config.java
rename to tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/model/package-info.java
index 604d48ac5e..76acd05258 100644
--- a/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/model/Config.java
+++ b/tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/model/package-info.java
@@ -16,25 +16,7 @@
* limitations under the License.
*/
+@Private
package org.apache.tez.tools.javadoc.model;
-import java.util.Map;
-import java.util.TreeMap;
-
-public class Config {
-
- public final String templateName;
- public final String configName;
- public Map configProperties;
-
- public Config(String configName, String templateName) {
- this.configName = configName;
- this.templateName = templateName;
- this.configProperties = new TreeMap();
- }
-
- public Config() {
- this(null, null);
- }
-
-}
+import org.apache.hadoop.classification.InterfaceAudience.Private;
\ No newline at end of file
diff --git a/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/HtmlWriter.java b/tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/util/HtmlWriter.java
similarity index 77%
rename from tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/HtmlWriter.java
rename to tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/util/HtmlWriter.java
index 4b531e87e5..1445114214 100644
--- a/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/HtmlWriter.java
+++ b/tez-tools/tez-javadoc-tools-base-jdk8/src/main/java/org/apache/tez/tools/javadoc/util/HtmlWriter.java
@@ -6,9 +6,9 @@
* 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
- *
+ *
+ * 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.
@@ -19,13 +19,11 @@
package org.apache.tez.tools.javadoc.util;
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
-import org.apache.tez.dag.api.TezException;
import org.apache.tez.tools.javadoc.model.Config;
import org.apache.tez.tools.javadoc.model.ConfigProperty;
@@ -36,12 +34,12 @@ public class HtmlWriter extends Writer {
public void write(Config config) throws IOException {
PrintWriter out = null;
- if (config.configName == null || config.configName.isEmpty()) {
+ if (config.getConfigName() == null || config.getConfigName().isEmpty()) {
throw new RuntimeException("Config Name is null or empty");
}
try {
- File file = new File(config.configName + ".html");
+ File file = new File(config.getConfigName() + ".html");
out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
out.println("");
@@ -52,7 +50,7 @@ public void write(Config config) throws IOException {
out.println("
");
out.println(" ");
- out.println(""+ config.configName +" ");
+ out.println("" + config.getConfigName() + " ");
// out.println(" ");
out.println("");
@@ -103,7 +101,7 @@ public void write(Config config) throws IOException {
out.println("");
out.println("
");
- out.println("
"+ config.configName +" ");
+ out.println("
" + config.getConfigName() + " ");
out.println("
");
out.println("
");
@@ -118,29 +116,35 @@ public void write(Config config) throws IOException {
out.println("" + "Is Evolving?" + " ");
out.println("");
- for (ConfigProperty configProperty : config.configProperties.values()) {
+ for (ConfigProperty configProperty : config.getConfigProperties().values()) {
if (!isValidConfigProperty(configProperty)) {
continue;
}
String altClass = "";
- if (configProperty.isPrivate) {
+ if (configProperty.isPrivate()) {
altClass = "class=\"tr_private\"";
- } else if (configProperty.isEvolving || configProperty.isUnstable) {
+ } else if (configProperty.isEvolving() || configProperty.isUnstable()) {
altClass = "class=\"tr_evolve_unstable\"";
}
out.println("");
- out.println("" + configProperty.propertyName + " ");
- out.println("" + configProperty.defaultValue + " ");
- out.println("" + configProperty.description + " ");
- out.println("" + configProperty.type + " ");
+ out.println("" + configProperty.getPropertyName() + " ");
+ out.println("" + configProperty.getDefaultValue() + " ");
+ out.println("" + configProperty.getDescription() + " ");
+ out.println("" + configProperty.getType() + " ");
// Re-enable after adding values
// out.println("" + configProperty.validValues + " ");
- out.println("" + configProperty.isPrivate + " ");
- out.println("" + configProperty.isEvolving + " ");
- out.println("" + configProperty.isUnstable + " ");
+ out.println(
+ "" + configProperty.isPrivate() + " ");
+ out.println(
+ ""
+ + configProperty.isEvolving() + " ");
+ out.println(
+ ""
+ + configProperty.isUnstable() + " ");
out.println(" ");
}
@@ -150,12 +154,10 @@ public void write(Config config) throws IOException {
out.println("");
out.println("