Skip to content
This repository was archived by the owner on Nov 11, 2022. It is now read-only.

Commit f1a1d07

Browse files
authored
Merge pull request #502 from dhalperi/checkstyle-javadoc
checkstyle: improve Javadoc checking
2 parents c737a68 + 66f664c commit f1a1d07

File tree

73 files changed

+181
-157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+181
-157
lines changed

checkstyle.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ page at http://checkstyle.sourceforge.net/config.html -->
180180
<property name="allowUndeclaredRTE" value="true"/>
181181
</module>
182182

183+
<!-- Check that paragraph tags are used correctly in Javadoc. -->
184+
<module name="JavadocParagraph"/>
185+
183186
<module name="JavadocType">
184187
<property name="scope" value="protected"/>
185188
<property name="severity" value="error"/>

contrib/kafka/src/main/java/com/google/cloud/dataflow/contrib/kafka/KafkaIO.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
* <p>Although most applications consumer single topic, the source can be configured to consume
107107
* multiple topics or even a specific set of {@link TopicPartition}s.
108108
*
109-
* <p> To configure a Kafka source, you must specify at the minimum Kafka <tt>bootstrapServers</tt>
109+
* <p>To configure a Kafka source, you must specify at the minimum Kafka <tt>bootstrapServers</tt>
110110
* and one or more topics to consume. The following example illustrates various options for
111111
* configuring the source :
112112
*
@@ -153,7 +153,7 @@
153153
*
154154
* <h3>Writing to Kafka</h3>
155155
*
156-
* KafkaIO sink supports writing key-value pairs to a Kafka topic. Users can also write just the
156+
* <p>KafkaIO sink supports writing key-value pairs to a Kafka topic. Users can also write just the
157157
* values. To configure a Kafka sink, you must specify at the minimum Kafka
158158
* <tt>bootstrapServers</tt> and the topic to write to. The following example illustrates various
159159
* options for configuring the sink:
@@ -175,7 +175,7 @@
175175
* );
176176
* }</pre>
177177
*
178-
* Often you might want to write just values without any keys to Kafka. Use {@code values()} to
178+
* <p>Often you might want to write just values without any keys to Kafka. Use {@code values()} to
179179
* write records with default empty(null) key:
180180
*
181181
* <pre>{@code
@@ -578,7 +578,7 @@ private TypedRead(
578578
}
579579

580580
/**
581-
* Creates an {@link UnboundedSource<KafkaRecord<K, V>, ?>} with the configuration in {@link
581+
* Creates an {@link UnboundedSource} with the configuration in {@link
582582
* TypedRead}. Primary use case is unit tests, should not be used in an application.
583583
*/
584584
@VisibleForTesting
@@ -751,7 +751,7 @@ public int compare(TopicPartition tp1, TopicPartition tp2) {
751751
/**
752752
* Returns one split for each of the Kafka partitions.
753753
*
754-
* <p> It is important to sort the partitions deterministically so that we can support
754+
* <p>It is important to sort the partitions deterministically so that we can support
755755
* resuming a split from last checkpoint. The Kafka partitions are sorted by {@code <topic,
756756
* partition>}.
757757
*/

examples/src/main/java/com/google/cloud/dataflow/examples/cookbook/TriggerExample.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,26 @@
6666
* data into {@link Window windows} to be processed, and demonstrates using various kinds of {@link
6767
* Trigger triggers} to control when the results for each window are emitted.
6868
*
69-
* <p> This example uses a portion of real traffic data from San Diego freeways. It contains
69+
* <p>This example uses a portion of real traffic data from San Diego freeways. It contains
7070
* readings from sensor stations set up along each freeway. Each sensor reading includes a
7171
* calculation of the 'total flow' across all lanes in that freeway direction.
7272
*
73-
* <p> Concepts:
73+
* <p>Concepts:
7474
* <pre>
7575
* 1. The default triggering behavior
7676
* 2. Late data with the default trigger
7777
* 3. How to get speculative estimates
7878
* 4. Combining late data and speculative estimates
7979
* </pre>
8080
*
81-
* <p> Before running this example, it will be useful to familiarize yourself with Dataflow triggers
81+
* <p>Before running this example, it will be useful to familiarize yourself with Dataflow triggers
8282
* and understand the concept of 'late data',
8383
* See: <a href="https://cloud.google.com/dataflow/model/triggers">
8484
* https://cloud.google.com/dataflow/model/triggers </a> and
8585
* <a href="https://cloud.google.com/dataflow/model/windowing#Advanced">
8686
* https://cloud.google.com/dataflow/model/windowing#Advanced </a>
8787
*
88-
* <p> The example pipeline reads data from a Pub/Sub topic. By default, running the example will
88+
* <p>The example pipeline reads data from a Pub/Sub topic. By default, running the example will
8989
* also run an auxiliary pipeline to inject data from the default {@code --input} file to the
9090
* {@code --pubsubTopic}. The auxiliary pipeline puts a timestamp on the injected data so that the
9191
* example pipeline can operate on <i>event time</i> (rather than arrival time). The auxiliary
@@ -94,24 +94,24 @@
9494
* choosing or set {@code --input=""} which will disable the automatic Pub/Sub injection, and allow
9595
* you to use a separate tool to publish to the given topic.
9696
*
97-
* <p> The example is configured to use the default Pub/Sub topic and the default BigQuery table
97+
* <p>The example is configured to use the default Pub/Sub topic and the default BigQuery table
9898
* from the example common package (there are no defaults for a general Dataflow pipeline).
9999
* You can override them by using the {@code --pubsubTopic}, {@code --bigQueryDataset}, and
100100
* {@code --bigQueryTable} options. If the Pub/Sub topic or the BigQuery table do not exist,
101101
* the example will try to create them.
102102
*
103-
* <p> The pipeline outputs its results to a BigQuery table.
103+
* <p>The pipeline outputs its results to a BigQuery table.
104104
* Here are some queries you can use to see interesting results:
105105
* Replace {@code <enter_table_name>} in the query below with the name of the BigQuery table.
106106
* Replace {@code <enter_window_interval>} in the query below with the window interval.
107107
*
108-
* <p> To see the results of the default trigger,
108+
* <p>To see the results of the default trigger,
109109
* Note: When you start up your pipeline, you'll initially see results from 'late' data. Wait after
110110
* the window duration, until the first pane of non-late data has been emitted, to see more
111111
* interesting results.
112112
* {@code SELECT * FROM enter_table_name WHERE trigger_type = "default" ORDER BY window DESC}
113113
*
114-
* <p> To see the late data i.e. dropped by the default trigger,
114+
* <p>To see the late data i.e. dropped by the default trigger,
115115
* {@code SELECT * FROM <enter_table_name> WHERE trigger_type = "withAllowedLateness" and
116116
* (timing = "LATE" or timing = "ON_TIME") and freeway = "5" ORDER BY window DESC, processing_time}
117117
*
@@ -120,23 +120,23 @@
120120
* (trigger_type = "withAllowedLateness" or trigger_type = "sequential") and freeway = "5" ORDER BY
121121
* window DESC, processing_time}
122122
*
123-
* <p> To see speculative results every minute,
123+
* <p>To see speculative results every minute,
124124
* {@code SELECT * FROM <enter_table_name> WHERE trigger_type = "speculative" and freeway = "5"
125125
* ORDER BY window DESC, processing_time}
126126
*
127-
* <p> To see speculative results every five minutes after the end of the window
127+
* <p>To see speculative results every five minutes after the end of the window
128128
* {@code SELECT * FROM <enter_table_name> WHERE trigger_type = "sequential" and timing != "EARLY"
129129
* and freeway = "5" ORDER BY window DESC, processing_time}
130130
*
131-
* <p> To see the first and the last pane for a freeway in a window for all the trigger types,
131+
* <p>To see the first and the last pane for a freeway in a window for all the trigger types,
132132
* {@code SELECT * FROM <enter_table_name> WHERE (isFirst = true or isLast = true) ORDER BY window}
133133
*
134-
* <p> To reduce the number of results for each query we can add additional where clauses.
134+
* <p>To reduce the number of results for each query we can add additional where clauses.
135135
* For examples, To see the results of the default trigger,
136136
* {@code SELECT * FROM <enter_table_name> WHERE trigger_type = "default" AND freeway = "5" AND
137137
* window = "<enter_window_interval>"}
138138
*
139-
* <p> The example will try to cancel the pipelines on the signal to terminate the process (CTRL-C)
139+
* <p>The example will try to cancel the pipelines on the signal to terminate the process (CTRL-C)
140140
* and then exits.
141141
*/
142142

@@ -170,13 +170,13 @@ public class TriggerExample {
170170
* 5 | 60 | 10:27:20 | 10:27:25
171171
* 5 | 60 | 10:29:00 | 11:11:00
172172
*
173-
* <p> Dataflow tracks a watermark which records up to what point in event time the data is
173+
* <p>Dataflow tracks a watermark which records up to what point in event time the data is
174174
* complete. For the purposes of the example, we'll assume the watermark is approximately 15m
175175
* behind the current processing time. In practice, the actual value would vary over time based
176176
* on the systems knowledge of the current PubSub delay and contents of the backlog (data
177177
* that has not yet been processed).
178178
*
179-
* <p> If the watermark is 15m behind, then the window [10:00:00, 10:30:00) (in event time) would
179+
* <p>If the watermark is 15m behind, then the window [10:00:00, 10:30:00) (in event time) would
180180
* close at 10:44:59, when the watermark passes 10:30:00.
181181
*/
182182
static class CalculateTotalFlow

examples/src/main/java8/com/google/cloud/dataflow/examples/complete/game/GameStats.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,21 @@
6565
* New concepts: session windows and finding session duration; use of both
6666
* singleton and non-singleton side inputs.
6767
*
68-
* <p> This pipeline builds on the {@link LeaderBoard} functionality, and adds some "business
68+
* <p>This pipeline builds on the {@link LeaderBoard} functionality, and adds some "business
6969
* intelligence" analysis: abuse detection and usage patterns. The pipeline derives the Mean user
7070
* score sum for a window, and uses that information to identify likely spammers/robots. (The robots
7171
* have a higher click rate than the human users). The 'robot' users are then filtered out when
7272
* calculating the team scores.
7373
*
74-
* <p> Additionally, user sessions are tracked: that is, we find bursts of user activity using
74+
* <p>Additionally, user sessions are tracked: that is, we find bursts of user activity using
7575
* session windows. Then, the mean session duration information is recorded in the context of
7676
* subsequent fixed windowing. (This could be used to tell us what games are giving us greater
7777
* user retention).
7878
*
79-
* <p> Run {@link injector.Injector} to generate pubsub data for this pipeline. The Injector
79+
* <p>Run {@link injector.Injector} to generate pubsub data for this pipeline. The Injector
8080
* documentation provides more detail.
8181
*
82-
* <p> To execute this pipeline using the Dataflow service, specify the pipeline configuration
82+
* <p>To execute this pipeline using the Dataflow service, specify the pipeline configuration
8383
* like this:
8484
* <pre>{@code
8585
* --project=YOUR_PROJECT_ID

examples/src/main/java8/com/google/cloud/dataflow/examples/complete/game/HourlyTeamScore.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
* domain, following {@link UserScore}. In addition to the concepts introduced in {@link UserScore},
4747
* new concepts include: windowing and element timestamps; use of {@code Filter.byPredicate()}.
4848
*
49-
* <p> This pipeline processes data collected from gaming events in batch, building on {@link
49+
* <p>This pipeline processes data collected from gaming events in batch, building on {@link
5050
* UserScore} but using fixed windows. It calculates the sum of scores per team, for each window,
5151
* optionally allowing specification of two timestamps before and after which data is filtered out.
5252
* This allows a model where late data collected after the intended analysis window can be included,
@@ -55,7 +55,7 @@
5555
* {@link UserScore} pipeline. However, our batch processing is high-latency, in that we don't get
5656
* results from plays at the beginning of the batch's time period until the batch is processed.
5757
*
58-
* <p> To execute this pipeline using the Dataflow service, specify the pipeline configuration
58+
* <p>To execute this pipeline using the Dataflow service, specify the pipeline configuration
5959
* like this:
6060
* <pre>{@code
6161
* --project=YOUR_PROJECT_ID
@@ -66,7 +66,7 @@
6666
* </pre>
6767
* where the BigQuery dataset you specify must already exist.
6868
*
69-
* <p> Optionally include {@code --input} to specify the batch input file path.
69+
* <p>Optionally include {@code --input} to specify the batch input file path.
7070
* To indicate a time after which the data should be filtered out, include the
7171
* {@code --stopMin} arg. E.g., {@code --stopMin=2015-10-18-23-59} indicates that any data
7272
* timestamped after 23:59 PST on 2015-10-18 should not be included in the analysis.

examples/src/main/java8/com/google/cloud/dataflow/examples/complete/game/LeaderBoard.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,26 +57,26 @@
5757
* early/speculative results; using .accumulatingFiredPanes() to do cumulative processing of late-
5858
* arriving data.
5959
*
60-
* <p> This pipeline processes an unbounded stream of 'game events'. The calculation of the team
60+
* <p>This pipeline processes an unbounded stream of 'game events'. The calculation of the team
6161
* scores uses fixed windowing based on event time (the time of the game play event), not
6262
* processing time (the time that an event is processed by the pipeline). The pipeline calculates
6363
* the sum of scores per team, for each window. By default, the team scores are calculated using
6464
* one-hour windows.
6565
*
66-
* <p> In contrast-- to demo another windowing option-- the user scores are calculated using a
66+
* <p>In contrast-- to demo another windowing option-- the user scores are calculated using a
6767
* global window, which periodically (every ten minutes) emits cumulative user score sums.
6868
*
69-
* <p> In contrast to the previous pipelines in the series, which used static, finite input data,
69+
* <p>In contrast to the previous pipelines in the series, which used static, finite input data,
7070
* here we're using an unbounded data source, which lets us provide speculative results, and allows
7171
* handling of late data, at much lower latency. We can use the early/speculative results to keep a
7272
* 'leaderboard' updated in near-realtime. Our handling of late data lets us generate correct
7373
* results, e.g. for 'team prizes'. We're now outputting window results as they're
7474
* calculated, giving us much lower latency than with the previous batch examples.
7575
*
76-
* <p> Run {@link injector.Injector} to generate pubsub data for this pipeline. The Injector
76+
* <p>Run {@link injector.Injector} to generate pubsub data for this pipeline. The Injector
7777
* documentation provides more detail on how to do this.
7878
*
79-
* <p> To execute this pipeline using the Dataflow service, specify the pipeline configuration
79+
* <p>To execute this pipeline using the Dataflow service, specify the pipeline configuration
8080
* like this:
8181
* <pre>{@code
8282
* --project=YOUR_PROJECT_ID

examples/src/main/java8/com/google/cloud/dataflow/examples/complete/game/UserScore.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
* BigQuery; using standalone DoFns; use of the sum by key transform; examples of
5050
* Java 8 lambda syntax.
5151
*
52-
* <p> In this gaming scenario, many users play, as members of different teams, over the course of a
52+
* <p>In this gaming scenario, many users play, as members of different teams, over the course of a
5353
* day, and their actions are logged for processing. Some of the logged game events may be late-
5454
* arriving, if users play on mobile devices and go transiently offline for a period.
5555
*
56-
* <p> This pipeline does batch processing of data collected from gaming events. It calculates the
56+
* <p>This pipeline does batch processing of data collected from gaming events. It calculates the
5757
* sum of scores per user, over an entire batch of gaming data (collected, say, for each day). The
5858
* batch processing will not include any late data that arrives after the day's cutoff point.
5959
*
60-
* <p> To execute this pipeline using the Dataflow service and static example input data, specify
60+
* <p>To execute this pipeline using the Dataflow service and static example input data, specify
6161
* the pipeline configuration like this:
6262
* <pre>{@code
6363
* --project=YOUR_PROJECT_ID
@@ -68,7 +68,7 @@
6868
* </pre>
6969
* where the BigQuery dataset you specify must already exist.
7070
*
71-
* <p> Optionally include the --input argument to specify a batch input file.
71+
* <p>Optionally include the --input argument to specify a batch input file.
7272
* See the --input default value for example batch data file, or use {@link injector.Injector} to
7373
* generate your own batch data.
7474
*/

examples/src/main/java8/com/google/cloud/dataflow/examples/complete/game/injector/Injector.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@
4141
* This is a generator that simulates usage data from a mobile game, and either publishes the data
4242
* to a pubsub topic or writes it to a file.
4343
*
44-
* <p> The general model used by the generator is the following. There is a set of teams with team
44+
* <p>The general model used by the generator is the following. There is a set of teams with team
4545
* members. Each member is scoring points for their team. After some period, a team will dissolve
4646
* and a new one will be created in its place. There is also a set of 'Robots', or spammer users.
4747
* They hop from team to team. The robots are set to have a higher 'click rate' (generate more
4848
* events) than the regular team members.
4949
*
50-
* <p> Each generated line of data has the following form:
50+
* <p>Each generated line of data has the following form:
5151
* username,teamname,score,timestamp_in_ms,readable_time
5252
* e.g.:
5353
* user2_AsparagusPig,AsparagusPig,10,1445230923951,2015-11-02 09:09:28.224
5454
*
55-
* <p> The Injector writes either to a PubSub topic, or a file. It will use the PubSub topic if
55+
* <p>The Injector writes either to a PubSub topic, or a file. It will use the PubSub topic if
5656
* specified. It takes the following arguments:
5757
* {@code Injector project-name (topic-name|none) (filename|none)}.
5858
*
59-
* <p> To run the Injector in the mode where it publishes to PubSub, you will need to authenticate
59+
* <p>To run the Injector in the mode where it publishes to PubSub, you will need to authenticate
6060
* locally using project-based service account credentials to avoid running over PubSub
6161
* quota.
6262
* See https://developers.google.com/identity/protocols/application-default-credentials
@@ -75,7 +75,7 @@
7575
* </pre>
7676
* The pubsub topic will be created if it does not exist.
7777
*
78-
* <p> To run the injector in write-to-file-mode, set the topic name to "none" and specify the
78+
* <p>To run the injector in write-to-file-mode, set the topic name to "none" and specify the
7979
* filename:
8080
* <pre>{@code
8181
* Injector <project-name> none <filename>

maven-archetypes/examples/src/main/resources/archetype-resources/src/main/java/DebuggingWordCount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public void processElement(ProcessContext c) {
158158
* <p>Inherits standard configuration options and all options defined in
159159
* {@link WordCount.WordCountOptions}.
160160
*/
161-
public static interface WordCountOptions extends WordCount.WordCountOptions {
161+
public interface WordCountOptions extends WordCount.WordCountOptions {
162162

163163
@Description("Regex filter pattern to use in DebuggingWordCount. "
164164
+ "Only words matching this pattern will be counted.")

maven-archetypes/examples/src/main/resources/archetype-resources/src/main/java/WindowedWordCount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private static TableReference getTableReference(Options options) {
178178
* table and the PubSub topic, as well as the {@link WordCount.WordCountOptions} support for
179179
* specification of the input file.
180180
*/
181-
public static interface Options
181+
public interface Options
182182
extends WordCount.WordCountOptions, DataflowExampleUtils.DataflowExampleUtilsOptions {
183183
@Description("Fixed window duration, in minutes")
184184
@Default.Integer(WINDOW_SIZE)

0 commit comments

Comments
 (0)