[
https://issues.apache.org/jira/browse/BEAM-6679?focusedWorklogId=199301&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-199301
]
ASF GitHub Bot logged work on BEAM-6679:
----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Feb/19 15:51
Start Date: 15/Feb/19 15:51
Worklog Time Spent: 10m
Work Description: jklukas commented on pull request #7852: [BEAM-6679]
Clean up GroupIntoBatches Javadoc
URL: https://github.com/apache/beam/pull/7852#discussion_r257287421
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/GroupIntoBatches.java
##########
@@ -48,25 +48,24 @@
* are output to the output {@link PCollection}.
*
* <p>Windows are preserved (batches contain elements from the same window).
Batches may contain
- * elements from more than one bundle
+ * elements from more than one bundle.
*
- * <p>Example (batch call a webservice and get return codes)
+ * <p>Example (batch call a webservice and get return codes):
*
* <pre>{@code
- * Pipeline pipeline = Pipeline.create(...);
- * ... // KV collection
- * long batchSize = 100L;
- * pipeline.apply(GroupIntoBatches.<String, String>ofSize(batchSize))
- * .setCoder(KvCoder.of(StringUtf8Coder.of(),
IterableCoder.of(StringUtf8Coder.of())))
- * .apply(ParDo.of(new DoFn<KV<String, Iterable<String>>, KV<String,
String>>() {
- * {@literal @}ProcessElement
- * public void processElement({@literal @}Element KV<String, Iterable<String>>
element,
- * OutputReceiver<KV<String, String>> r) {
- * r.output(KV.of(element.getKey(), callWebService(element.getValue())));
- * }
- * }));
- * pipeline.run();
- * }</pre>
+ * PCollection<KV<String, String>> input = ...;
+ * long batchSize = 100L;
+ * PCollection<KV<String, Iterable<String>>> batched = input
+ * .apply(GroupIntoBatches.<String, String>ofSize(batchSize))
+ * .setCoder(KvCoder.of(StringUtf8Coder.of(),
IterableCoder.of(StringUtf8Coder.of())))
+ * .apply(ParDo.of(new DoFn<KV<String, Iterable<String>>, KV<String,
String>>() }{
+ * {@code @ProcessElement
Review comment:
Note that an alternative to the method I'm using here would be to wrap the
entire example only in `<pre>`, and then apply `{@code}` only to smaller
sections of the example where angle brackets or `@` show up. The complication
there is that `{@code x}` always inserts a space before the text `x`, so
there's fiddling necessary to decide where the tag should start so that there's
a natural space, and to remove a preceeding space so alignment stays correct.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 199301)
Time Spent: 1h 20m (was: 1h 10m)
> Fix javadoc @ litterals
> -----------------------
>
> Key: BEAM-6679
> URL: https://issues.apache.org/jira/browse/BEAM-6679
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Reporter: Jeff Klukas
> Assignee: Jeff Klukas
> Priority: Minor
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> [The current Javadoc for
> GroupIntoBatches|https://beam.apache.org/releases/javadoc/2.10.0/org/apache/beam/sdk/transforms/GroupIntoBatches.html]
> is strangely formatted, making it difficult to understand the code example
> and learn how to use the transform.
> The code example should also follow conventions from classes like MapElements
> where the code example assumes a PCollection of some type and demonstrates
> the output PCollection type after applying the transform.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)