-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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][DOCS] Make javadoc8 working for unidoc/genjavadoc compatibility in Java API documentation #16013
Changes from 12 commits
aa2dcb8
aa5acbb
ff17c3a
1593545
558d5e3
9a9d0cd
842a738
3660317
22bfb68
73fcd35
246bef3
a2a2011
ee3b96b
65d8f79
2defa60
d2c6e86
7d44dc5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,8 +262,9 @@ class SparkConf(loadDefaults: Boolean) extends Cloneable with Logging with Seria | |
/** | ||
* Get a time parameter as seconds; throws a NoSuchElementException if it's not set. If no | ||
* suffix is provided then seconds are assumed. | ||
* @throws NoSuchElementException | ||
* @throws java.util.NoSuchElementException | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is interesting. Using
|
||
*/ | ||
@throws(classOf[NoSuchElementException]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, why add this? this changes the API by adding a checked exception |
||
def getTimeAsSeconds(key: String): Long = { | ||
Utils.timeStringAsSeconds(get(key)) | ||
} | ||
|
@@ -279,8 +280,9 @@ class SparkConf(loadDefaults: Boolean) extends Cloneable with Logging with Seria | |
/** | ||
* Get a time parameter as milliseconds; throws a NoSuchElementException if it's not set. If no | ||
* suffix is provided then milliseconds are assumed. | ||
* @throws NoSuchElementException | ||
* @throws java.util.NoSuchElementException | ||
*/ | ||
@throws(classOf[NoSuchElementException]) | ||
def getTimeAsMs(key: String): Long = { | ||
Utils.timeStringAsMs(get(key)) | ||
} | ||
|
@@ -296,8 +298,9 @@ class SparkConf(loadDefaults: Boolean) extends Cloneable with Logging with Seria | |
/** | ||
* Get a size parameter as bytes; throws a NoSuchElementException if it's not set. If no | ||
* suffix is provided then bytes are assumed. | ||
* @throws NoSuchElementException | ||
* @throws java.util.NoSuchElementException | ||
*/ | ||
@throws(classOf[NoSuchElementException]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
def getSizeAsBytes(key: String): Long = { | ||
Utils.byteStringAsBytes(get(key)) | ||
} | ||
|
@@ -320,8 +323,9 @@ class SparkConf(loadDefaults: Boolean) extends Cloneable with Logging with Seria | |
/** | ||
* Get a size parameter as Kibibytes; throws a NoSuchElementException if it's not set. If no | ||
* suffix is provided then Kibibytes are assumed. | ||
* @throws NoSuchElementException | ||
* @throws java.util.NoSuchElementException | ||
*/ | ||
@throws(classOf[NoSuchElementException]) | ||
def getSizeAsKb(key: String): Long = { | ||
Utils.byteStringAsKb(get(key)) | ||
} | ||
|
@@ -337,8 +341,9 @@ class SparkConf(loadDefaults: Boolean) extends Cloneable with Logging with Seria | |
/** | ||
* Get a size parameter as Mebibytes; throws a NoSuchElementException if it's not set. If no | ||
* suffix is provided then Mebibytes are assumed. | ||
* @throws NoSuchElementException | ||
* @throws java.util.NoSuchElementException | ||
*/ | ||
@throws(classOf[NoSuchElementException]) | ||
def getSizeAsMb(key: String): Long = { | ||
Utils.byteStringAsMb(get(key)) | ||
} | ||
|
@@ -354,8 +359,9 @@ class SparkConf(loadDefaults: Boolean) extends Cloneable with Logging with Seria | |
/** | ||
* Get a size parameter as Gibibytes; throws a NoSuchElementException if it's not set. If no | ||
* suffix is provided then Gibibytes are assumed. | ||
* @throws NoSuchElementException | ||
* @throws java.util.NoSuchElementException | ||
*/ | ||
@throws(classOf[NoSuchElementException]) | ||
def getSizeAsGb(key: String): Long = { | ||
Utils.byteStringAsGb(get(key)) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -645,7 +645,7 @@ class SparkContext(config: SparkConf) extends Logging { | |
|
||
/** | ||
* Get a local property set in this thread, or null if it is missing. See | ||
* [[org.apache.spark.SparkContext.setLocalProperty]]. | ||
* `org.apache.spark.SparkContext.setLocalProperty`. | ||
*/ | ||
def getLocalProperty(key: String): String = | ||
Option(localProperties.get).map(_.getProperty(key)).orNull | ||
|
@@ -663,7 +663,7 @@ class SparkContext(config: SparkConf) extends Logging { | |
* Application programmers can use this method to group all those jobs together and give a | ||
* group description. Once set, the Spark web UI will associate such jobs with this group. | ||
* | ||
* The application can also use [[org.apache.spark.SparkContext.cancelJobGroup]] to cancel all | ||
* The application can also use `org.apache.spark.SparkContext.cancelJobGroup` to cancel all | ||
* running jobs in this group. For example, | ||
* {{{ | ||
* // In the main thread: | ||
|
@@ -1384,7 +1384,7 @@ class SparkContext(config: SparkConf) extends Logging { | |
} | ||
|
||
/** | ||
* Create and register a [[CollectionAccumulator]], which starts with empty list and accumulates | ||
* Create and register a `CollectionAccumulator`, which starts with empty list and accumulates | ||
* inputs by adding them into the list. | ||
*/ | ||
def collectionAccumulator[T]: CollectionAccumulator[T] = { | ||
|
@@ -1394,7 +1394,7 @@ class SparkContext(config: SparkConf) extends Logging { | |
} | ||
|
||
/** | ||
* Create and register a [[CollectionAccumulator]], which starts with empty list and accumulates | ||
* Create and register a `CollectionAccumulator`, which starts with empty list and accumulates | ||
* inputs by adding them into the list. | ||
*/ | ||
def collectionAccumulator[T](name: String): CollectionAccumulator[T] = { | ||
|
@@ -2043,7 +2043,7 @@ class SparkContext(config: SparkConf) extends Logging { | |
} | ||
|
||
/** | ||
* Cancel active jobs for the specified group. See [[org.apache.spark.SparkContext.setJobGroup]] | ||
* Cancel active jobs for the specified group. See `org.apache.spark.SparkContext.setJobGroup` | ||
* for more information. | ||
*/ | ||
def cancelJobGroup(groupId: String) { | ||
|
@@ -2063,6 +2063,7 @@ class SparkContext(config: SparkConf) extends Logging { | |
* @param jobId the job ID to cancel | ||
* @throws InterruptedException if the cancel message cannot be sent | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is interesting too. This does not throws an error in javadoc8 unlike https://github.com/apache/spark/pull/16013/files#r89664921 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
*/ | ||
@throws(classOf[InterruptedException]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think these need to be reverted too; we don't want to introduce checked exceptions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, actually this complains as below:
Let me move this to |
||
def cancelJob(jobId: Int) { | ||
dagScheduler.cancelJob(jobId) | ||
} | ||
|
@@ -2073,6 +2074,7 @@ class SparkContext(config: SparkConf) extends Logging { | |
* @param stageId the stage ID to cancel | ||
* @throws InterruptedException if the cancel message cannot be sent | ||
*/ | ||
@throws(classOf[InterruptedException]) | ||
def cancelStage(stageId: Int) { | ||
dagScheduler.cancelStage(stageId) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,8 @@ class JavaRDD[T](val rdd: RDD[T])(implicit val classTag: ClassTag[T]) | |
* @param withReplacement can elements be sampled multiple times (replaced when sampled out) | ||
* @param fraction expected size of the sample as a fraction of this RDD's size | ||
* without replacement: probability that each element is chosen; fraction must be [0, 1] | ||
* with replacement: expected number of times each element is chosen; fraction must be >= 0 | ||
* with replacement: expected number of times each element is chosen; fraction must be greater | ||
* than or equal to 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can work around this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prose is fine too, but, was this an error? is the point that the escape itself gets escaped? I might have missed this is your various comments. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, yes. Exactly. It was not an error but it was printed as they are ( I haven't looked into this super deeper as the output is incorrect anyway but I suspect this replacement in genjavadoc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In short, the only workarounds to print them I found were inlined tags such as |
||
* | ||
* @note This is NOT guaranteed to provide exactly the fraction of the count | ||
* of the given `RDD`. | ||
|
@@ -117,7 +118,8 @@ class JavaRDD[T](val rdd: RDD[T])(implicit val classTag: ClassTag[T]) | |
* @param withReplacement can elements be sampled multiple times (replaced when sampled out) | ||
* @param fraction expected size of the sample as a fraction of this RDD's size | ||
* without replacement: probability that each element is chosen; fraction must be [0, 1] | ||
* with replacement: expected number of times each element is chosen; fraction must be >= 0 | ||
* with replacement: expected number of times each element is chosen; fraction must be greater | ||
* than or equal to 0 | ||
* @param seed seed for the random number generator | ||
* | ||
* @note This is NOT guaranteed to provide exactly the fraction of the count | ||
|
@@ -167,7 +169,7 @@ class JavaRDD[T](val rdd: RDD[T])(implicit val classTag: ClassTag[T]) | |
* Return an RDD with the elements from `this` that are not in `other`. | ||
* | ||
* Uses `this` partitioner/partition size, because even if `other` is huge, the resulting | ||
* RDD will be <= us. | ||
* RDD will be less than or equal to us. | ||
*/ | ||
def subtract(other: JavaRDD[T]): JavaRDD[T] = wrapRDD(rdd.subtract(other)) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,10 +152,12 @@ class DoubleRDDFunctions(self: RDD[Double]) extends Logging with Serializable { | |
|
||
/** | ||
* Compute a histogram using the provided buckets. The buckets are all open | ||
* to the right except for the last which is closed | ||
* to the right except for the last which is closed. | ||
* {{{ | ||
* e.g. for the array | ||
* [1, 10, 20, 50] the buckets are [1, 10) [10, 20) [20, 50] | ||
* e.g 1<=x<10 , 10<=x<20, 20<=x<=50 | ||
* }}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Why put the whole section as code? it's just the portion with several inequalities. Can those be back-tick-escaped? Or is the point that the back-ticks don't work? does BTW, very minor, but the second "e.g" misses a period. "e.g." isn't really great either. You could expand the first to "For example" and the second to "that is", which was really what was meant. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just wanted to avoid to use inlined tags simply because my IDE shows some warnings.. This seems a valid javadoc markdown but it seems any inlined tags are treated as backticts in scaladoc. (I am sorry for messing around with many comments but this is also related with #16013 (comment)) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will try to treat the comments below too but let me maybe try to reduce the usages of the inlined tags where possible. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Yeap. I tested some cases with it (If I remember correctly) and it seems any |
||
* And on the input of 1 and 50 we would have a histogram of 1, 0, 1 | ||
* | ||
* @note If your histogram is evenly spaced (e.g. [0, 10, 20, 30]) this can be switched | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -469,7 +469,8 @@ abstract class RDD[T: ClassTag]( | |
* @param withReplacement can elements be sampled multiple times (replaced when sampled out) | ||
* @param fraction expected size of the sample as a fraction of this RDD's size | ||
* without replacement: probability that each element is chosen; fraction must be [0, 1] | ||
* with replacement: expected number of times each element is chosen; fraction must be >= 0 | ||
* with replacement: expected number of times each element is chosen; fraction must be greater | ||
* than or equal to 0 | ||
* @param seed seed for the random number generator | ||
* | ||
* @note This is NOT guaranteed to provide exactly the fraction of the count | ||
|
@@ -750,8 +751,10 @@ abstract class RDD[T: ClassTag]( | |
* print line function (like out.println()) as the 2nd parameter. | ||
* An example of pipe the RDD data of groupBy() in a streaming way, | ||
* instead of constructing a huge String to concat all the elements: | ||
* def printRDDElement(record:(String, Seq[String]), f:String=>Unit) = | ||
* for (e <- record._2) {f(e)} | ||
* {{{ | ||
* def printRDDElement(record:(String, Seq[String]), f:String=>Unit) = | ||
* for (e <- record._2) {f(e)} | ||
* }}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
* @param separateWorkingDir Use separate working directories for each task. | ||
* @param bufferSize Buffer size for the stdin writer for the piped process. | ||
* @param encoding Char encoding used for interacting (via stdin, stdout and stderr) with | ||
|
@@ -1184,8 +1187,13 @@ abstract class RDD[T: ClassTag]( | |
* | ||
* @note This method should only be used if the resulting map is expected to be small, as | ||
* the whole thing is loaded into the driver's memory. | ||
* To handle very large results, consider using rdd.map(x => (x, 1L)).reduceByKey(_ + _), which | ||
* returns an RDD[T, Long] instead of a map. | ||
* To handle very large results, consider using | ||
* | ||
* {{{ | ||
* rdd.map(x => (x, 1L)).reduceByKey(_ + _) | ||
* }}}, | ||
* | ||
* which returns an RDD[T, Long] instead of a map. | ||
*/ | ||
def countByValue()(implicit ord: Ordering[T] = null): Map[T, Long] = withScope { | ||
map(value => (value, null)).countByKey() | ||
|
@@ -1223,9 +1231,9 @@ abstract class RDD[T: ClassTag]( | |
* Algorithmic Engineering of a State of The Art Cardinality Estimation Algorithm", available | ||
* <a href="http://dx.doi.org/10.1145/2452376.2452456">here</a>. | ||
* | ||
* The relative accuracy is approximately `1.054 / sqrt(2^p)`. Setting a nonzero `sp > p` | ||
* would trigger sparse representation of registers, which may reduce the memory consumption | ||
* and increase accuracy when the cardinality is small. | ||
* The relative accuracy is approximately `1.054 / sqrt(2^p)`. Setting a nonzero (sp is greater | ||
* than p) would trigger sparse representation of registers, which may reduce the memory | ||
* consumption and increase accuracy when the cardinality is small. | ||
* | ||
* @param p The precision value for the normal set. | ||
* `p` must be a value between 4 and `sp` if `sp` is not zero (32 max). | ||
|
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 just decided to keep original format rather than trying to make this pretty.
The original was as below:
Scala
Java
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.
After this PR it still prints the same.
Scala
Java