-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-3359][BUILD][DOCS] More changes to resolve javadoc 8 errors that will help unidoc/genjavadoc compatibility #15999
Conversation
I should double check the built javadoc. Will leave some images in the changes. BTW, this still does not fully resolve the problem (cc @srowen). |
Test build #69105 has finished for PR 15999 at commit
|
retest this please |
Test build #69109 has started for PR 15999 at commit |
retest this please |
*/ | ||
@Since("1.3.0") | ||
class IsotonicRegression private (private var isotonic: Boolean) extends Serializable { | ||
|
||
/** | ||
* Constructs IsotonicRegression instance with default parameter isotonic = true. | ||
* | ||
* @return New instance of IsotonicRegression. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javadoc complains about @return
for class.
[error] .../java/org/apache/spark/mllib/regression/IsotonicRegression.java:27: error: invalid use of @return
[error] * @return New instance of IsotonicRegression.
[error] ^
* `JavaPairRDD<String, byte[]> rdd = sparkContext.dataStreamFiles("hdfs://a-hdfs-path")`, | ||
* <code> | ||
* JavaPairRDD<String, byte[]> rdd = sparkContext.dataStreamFiles("hdfs://a-hdfs-path") | ||
* </code>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`JavaPairRDD<String, byte[]> rdd = sparkContext.dataStreamFiles("hdfs://a-hdfs-path")`
prints
JavaPairRDD<String, byte[]> rdd = ...
in scaladoc
JavaPairRDD<String, byte[]> rdd = ...
in javadoc
So, I had to use <code>...</code>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to myself. It still prints the codes as above.
If we want to use <
or >
, we might better always wrap this with
{{{
...
}}}
rather than backticks or <code>...</code>
.
@@ -1513,7 +1513,7 @@ private class LogisticAggregator( | |||
} | |||
|
|||
/** | |||
* When maxMargin > 0, the original formula could cause overflow. | |||
* When maxMargin > 0, the original formula could cause overflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javadoc does not allow < and > as plain. This complains as below:
[error] .../spark/mllib/target/java/org/apache/spark/ml/classification/LogisticAggregator.java:127: error: bad use of '>'
[error] * Fortunately, when max(margins) = maxMargin > 0, the loss function and the multiplier can easily
[error] ^
@@ -289,7 +289,6 @@ object MultilayerPerceptronClassifier | |||
* @param uid uid | |||
* @param layers array of layer sizes including input and output layers | |||
* @param weights the weights of layers | |||
* @return prediction model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same instance with https://github.com/apache/spark/pull/15999/files#r89451946
@@ -1283,7 +1283,7 @@ class BinaryLogisticRegressionSummary private[classification] ( | |||
* P(y_i=K-1|\vec{x}_i, \beta) = \frac{e^{\vec{x}_i^T \vec{\beta}_{K-1}}\,}{\sum_{k=0}^{K-1} | |||
* e^{\vec{x}_i^T \vec{\beta}_k}} | |||
* $$ | |||
* </blockquote></p> | |||
* </blockquote> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javadoc complains about this: error: unexpected end tag: </p>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -2354,7 +2354,7 @@ private[spark] object Utils extends Logging { | |||
* A spark url (`spark://host:port`) is a special URI that its scheme is `spark` and only contains | |||
* host and port. | |||
* | |||
* @throws SparkException if `sparkUrl` is invalid. | |||
* @note Throws `SparkException` if sparkUrl is invalid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SparkException
reference is not found in javadoc.
[error] .../java/org/apache/spark/util/Utils.java:841: error: reference not found
[error] * @throws SparkException if sparkUrl is invalid.
[error] ^
I am not too sure using @note
instead is right.
"-tag", "tparam:X", | ||
"-tag", "constructor:X", | ||
"-tag", "todo:X", | ||
"-tag", "groupname:X" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tags, @ constructor
, @ todo
and @groupname
were excluded as they are unrecognisable in javadoc.
<tag> | ||
<name>groupname</name> | ||
<placement>X</placement> | ||
</tag> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same instances with https://github.com/apache/spark/pull/15999/files#r89453582
* [[https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https Oracle | ||
* blog page]]. | ||
* <a href="https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https"> | ||
* Oracle blog page</a>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For hyperlinks, it seems
these are fine (try it):
<a href="https://.../...">link ABC</a>
<a href="https://.../...">
link ABC</a>
<a href="https://.../...">link
ABC</a>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heroic effort! LGTM
* @see [[http://en.wikipedia.org/wiki/Latent_Dirichlet_allocation Latent Dirichlet allocation | ||
* (Wikipedia)]] | ||
* @see <a href="http://en.wikipedia.org/wiki/Latent_Dirichlet_allocation"> | ||
* Latent Dirichlet allocation (Wikipedia)</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I observed that there are three cases of the indentations for @see
.
@see ...
...
@see ...
...
@see ...
...
I just tried to match those up to @note
in the way I did before which is the first case.
Test build #69119 has finished for PR 15999 at commit
|
Oh thank you! Will double check and change the title tomorrow. |
Test build #69122 has finished for PR 15999 at commit
|
Let's get this in for 2.1, even if it doesn't fix 100% of the errors. This looks like a big step towards making it work with javadoc 8. Let me know when ready @HyukjinKwon |
* Loads a JSON file ([[http://jsonlines.org/ JSON Lines text format or newline-delimited JSON]]) | ||
* and returns the result as a [[DataFrame]]. | ||
* Loads a JSON file (<a href="http://jsonlines.org/">JSON Lines text format or | ||
* newline-delimited JSON</a>) and returns the result as a [[DataFrame]]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `JavaPairRDD<String, byte[]> rdd = sparkContext.dataStreamFiles("hdfs://a-hdfs-path")`, | ||
* {{{ | ||
* JavaPairRDD<String, byte[]> rdd = sparkContext.dataStreamFiles("hdfs://a-hdfs-path") | ||
* }}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to myself - see #15999 (comment). It seems we always should use {{{...}}}
instead of backticks or <code>...</code>
to print out <
and >
for both scaladoc and javadoc.
It is fine now.
I just double-checked and I think it is ready. Thank you @srowen. |
Test build #69153 has finished for PR 15999 at commit
|
Merged to master/2.1 |
…at will help unidoc/genjavadoc compatibility ## What changes were proposed in this pull request? This PR only tries to fix things that looks pretty straightforward and were fixed in other previous PRs before. This PR roughly fixes several things as below: - Fix unrecognisable class and method links in javadoc by changing it from `[[..]]` to `` `...` `` ``` [error] .../spark/sql/core/target/java/org/apache/spark/sql/streaming/DataStreamReader.java:226: error: reference not found [error] * Loads text files and returns a {link DataFrame} whose schema starts with a string column named ``` - Fix an exception annotation and remove code backticks in `throws` annotation Currently, sbt unidoc with Java 8 complains as below: ``` [error] .../java/org/apache/spark/sql/streaming/StreamingQuery.java:72: error: unexpected text [error] * throws StreamingQueryException, if <code>this</code> query has terminated with an exception. ``` `throws` should specify the correct class name from `StreamingQueryException,` to `StreamingQueryException` without backticks. (see [JDK-8007644](https://bugs.openjdk.java.net/browse/JDK-8007644)). - Fix `[[http..]]` to `<a href="http..."></a>`. ```diff - * [[https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https Oracle - * blog page]]. + * <a href="https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https"> + * Oracle blog page</a>. ``` `[[http...]]` link markdown in scaladoc is unrecognisable in javadoc. - It seems class can't have `return` annotation. So, two cases of this were removed. ``` [error] .../java/org/apache/spark/mllib/regression/IsotonicRegression.java:27: error: invalid use of return [error] * return New instance of IsotonicRegression. ``` - Fix < to `<` and > to `>` according to HTML rules. - Fix `</p>` complaint - Exclude unrecognisable in javadoc, `constructor`, `todo` and `groupname`. ## How was this patch tested? Manually tested by `jekyll build` with Java 7 and 8 ``` java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode) ``` ``` java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) ``` Note: this does not yet make sbt unidoc suceed with Java 8 yet but it reduces the number of errors with Java 8. Author: hyukjinkwon <[email protected]> Closes #15999 from HyukjinKwon/SPARK-3359-errors. (cherry picked from commit 51b1c15) Signed-off-by: Sean Owen <[email protected]>
…at will help unidoc/genjavadoc compatibility ## What changes were proposed in this pull request? This PR only tries to fix things that looks pretty straightforward and were fixed in other previous PRs before. This PR roughly fixes several things as below: - Fix unrecognisable class and method links in javadoc by changing it from `[[..]]` to `` `...` `` ``` [error] .../spark/sql/core/target/java/org/apache/spark/sql/streaming/DataStreamReader.java:226: error: reference not found [error] * Loads text files and returns a {link DataFrame} whose schema starts with a string column named ``` - Fix an exception annotation and remove code backticks in `throws` annotation Currently, sbt unidoc with Java 8 complains as below: ``` [error] .../java/org/apache/spark/sql/streaming/StreamingQuery.java:72: error: unexpected text [error] * throws StreamingQueryException, if <code>this</code> query has terminated with an exception. ``` `throws` should specify the correct class name from `StreamingQueryException,` to `StreamingQueryException` without backticks. (see [JDK-8007644](https://bugs.openjdk.java.net/browse/JDK-8007644)). - Fix `[[http..]]` to `<a href="http..."></a>`. ```diff - * [[https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https Oracle - * blog page]]. + * <a href="https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https"> + * Oracle blog page</a>. ``` `[[http...]]` link markdown in scaladoc is unrecognisable in javadoc. - It seems class can't have `return` annotation. So, two cases of this were removed. ``` [error] .../java/org/apache/spark/mllib/regression/IsotonicRegression.java:27: error: invalid use of return [error] * return New instance of IsotonicRegression. ``` - Fix < to `<` and > to `>` according to HTML rules. - Fix `</p>` complaint - Exclude unrecognisable in javadoc, `constructor`, `todo` and `groupname`. ## How was this patch tested? Manually tested by `jekyll build` with Java 7 and 8 ``` java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode) ``` ``` java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) ``` Note: this does not yet make sbt unidoc suceed with Java 8 yet but it reduces the number of errors with Java 8. Author: hyukjinkwon <[email protected]> Closes apache#15999 from HyukjinKwon/SPARK-3359-errors.
…at will help unidoc/genjavadoc compatibility ## What changes were proposed in this pull request? This PR only tries to fix things that looks pretty straightforward and were fixed in other previous PRs before. This PR roughly fixes several things as below: - Fix unrecognisable class and method links in javadoc by changing it from `[[..]]` to `` `...` `` ``` [error] .../spark/sql/core/target/java/org/apache/spark/sql/streaming/DataStreamReader.java:226: error: reference not found [error] * Loads text files and returns a {link DataFrame} whose schema starts with a string column named ``` - Fix an exception annotation and remove code backticks in `throws` annotation Currently, sbt unidoc with Java 8 complains as below: ``` [error] .../java/org/apache/spark/sql/streaming/StreamingQuery.java:72: error: unexpected text [error] * throws StreamingQueryException, if <code>this</code> query has terminated with an exception. ``` `throws` should specify the correct class name from `StreamingQueryException,` to `StreamingQueryException` without backticks. (see [JDK-8007644](https://bugs.openjdk.java.net/browse/JDK-8007644)). - Fix `[[http..]]` to `<a href="http..."></a>`. ```diff - * [[https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https Oracle - * blog page]]. + * <a href="https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https"> + * Oracle blog page</a>. ``` `[[http...]]` link markdown in scaladoc is unrecognisable in javadoc. - It seems class can't have `return` annotation. So, two cases of this were removed. ``` [error] .../java/org/apache/spark/mllib/regression/IsotonicRegression.java:27: error: invalid use of return [error] * return New instance of IsotonicRegression. ``` - Fix < to `<` and > to `>` according to HTML rules. - Fix `</p>` complaint - Exclude unrecognisable in javadoc, `constructor`, `todo` and `groupname`. ## How was this patch tested? Manually tested by `jekyll build` with Java 7 and 8 ``` java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode) ``` ``` java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) ``` Note: this does not yet make sbt unidoc suceed with Java 8 yet but it reduces the number of errors with Java 8. Author: hyukjinkwon <[email protected]> Closes apache#15999 from HyukjinKwon/SPARK-3359-errors.
## What changes were proposed in this pull request? This PR proposes to run Spark unidoc to test Javadoc 8 build as Javadoc 8 is easily re-breakable. There are several problems with it: - It introduces little extra bit of time to run the tests. In my case, it took 1.5 mins more (`Elapsed :[94.8746569157]`). How it was tested is described in "How was this patch tested?". - > One problem that I noticed was that Unidoc appeared to be processing test sources: if we can find a way to exclude those from being processed in the first place then that might significantly speed things up. (see joshrosen's [comment](https://issues.apache.org/jira/browse/SPARK-18692?focusedCommentId=15947627&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15947627)) To complete this automated build, It also suggests to fix existing Javadoc breaks / ones introduced by test codes as described above. There fixes are similar instances that previously fixed. Please refer #15999 and #16013 Note that this only fixes **errors** not **warnings**. Please see my observation #17389 (comment) for spurious errors by warnings. ## How was this patch tested? Manually via `jekyll build` for building tests. Also, tested via running `./dev/run-tests`. This was tested via manually adding `time.time()` as below: ```diff profiles_and_goals = build_profiles + sbt_goals print("[info] Building Spark unidoc (w/Hive 1.2.1) using SBT with these arguments: ", " ".join(profiles_and_goals)) + import time + st = time.time() exec_sbt(profiles_and_goals) + print("Elapsed :[%s]" % str(time.time() - st)) ``` produces ``` ... ======================================================================== Building Unidoc API Documentation ======================================================================== ... [info] Main Java API documentation successful. ... Elapsed :[94.8746569157] ... Author: hyukjinkwon <[email protected]> Closes #17477 from HyukjinKwon/SPARK-18692.
PR apache#15999 included fixes for doc strings in the ML shared param traits (occurrences of `>` and `>=`). This PR simply uses the HTML-escaped version of the param doc to embed into the Scaladoc, to ensure that when `SharedParamsCodeGen` is run, the generated javadoc will be compliant for Java 8. ## How was this patch tested? Existing tests Author: Nick Pentreath <[email protected]> Closes apache#18420 from MLnick/shared-params-javadoc8.
PR #15999 included fixes for doc strings in the ML shared param traits (occurrences of `>` and `>=`). This PR simply uses the HTML-escaped version of the param doc to embed into the Scaladoc, to ensure that when `SharedParamsCodeGen` is run, the generated javadoc will be compliant for Java 8. ## How was this patch tested? Existing tests Author: Nick Pentreath <[email protected]> Closes #18420 from MLnick/shared-params-javadoc8. (cherry picked from commit 70085e8) Signed-off-by: Sean Owen <[email protected]>
PR apache#15999 included fixes for doc strings in the ML shared param traits (occurrences of `>` and `>=`). This PR simply uses the HTML-escaped version of the param doc to embed into the Scaladoc, to ensure that when `SharedParamsCodeGen` is run, the generated javadoc will be compliant for Java 8. ## How was this patch tested? Existing tests Author: Nick Pentreath <[email protected]> Closes apache#18420 from MLnick/shared-params-javadoc8.
What changes were proposed in this pull request?
This PR only tries to fix things that looks pretty straightforward and were fixed in other previous PRs before.
This PR roughly fixes several things as below:
Fix unrecognisable class and method links in javadoc by changing it from
[[..]]
to`...`
Fix an exception annotation and remove code backticks in
@throws
annotationCurrently, sbt unidoc with Java 8 complains as below:
@throws
should specify the correct class name fromStreamingQueryException,
toStreamingQueryException
without backticks. (see JDK-8007644).Fix
[[http..]]
to<a href="http..."></a>
.[[http...]]
link markdown in scaladoc is unrecognisable in javadoc.It seems class can't have
@return
annotation. So, two cases of this were removed.Fix < toThis should be<
and > to>
according to HTML rules.@literal{<}
or something likegreater than
.Fix
</p>
complaintExclude unrecognisable in javadoc,
@constructor
,@todo
and@groupname
.How was this patch tested?
Manually tested by
jekyll build
with Java 7 and 8Note: this does not yet make sbt unidoc suceed with Java 8 yet but it reduces the number of errors with Java 8.