GeezerVison is showing github.com — checkstyle: improve Javadoc checking · aosterloh/DataflowJavaSDK@7053cf5
File treeExpand file treeCollapse file tree Open diff view settings java8/com/google/cloud/dataflow/examples/complete/game java/com/google/cloud/dataflow/examples/cookbook
maven-archetypes/examples/src/main/resources/archetype-resources/src/main/java main/java/com/google/cloud/dataflow/sdk test/java/com/google/cloud/dataflow/sdk/testing
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: checkstyle.xml +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -180,6 +180,9 @@ page at http://checkstyle.sourceforge.net/config.html --> | 180 | 180 | <property name="allowUndeclaredRTE" value="true"/> | 181 | 181 | </module> | 182 | 182 |
| | 183 | + <!-- Check that paragraph tags are used correctly in Javadoc. --> | | 184 | + <module name="JavadocParagraph"/> | | 185 | + | 183 | 186 | <module name="JavadocType"> | 184 | 187 | <property name="scope" value="protected"/> | 185 | 188 | <property name="severity" value="error"/> | |
Collapse file Copy file name to clipboardExpand all lines: examples/src/main/java/com/google/cloud/dataflow/examples/cookbook/TriggerExample.java +15-15Lines changed: 15 additions & 15 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 66 | 66 | * data into {@link Window windows} to be processed, and demonstrates using various kinds of {@link | 67 | 67 | * Trigger triggers} to control when the results for each window are emitted. | 68 | 68 | * | 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 | 70 | 70 | * readings from sensor stations set up along each freeway. Each sensor reading includes a | 71 | 71 | * calculation of the 'total flow' across all lanes in that freeway direction. | 72 | 72 | * | 73 | | - * <p> Concepts: | | 73 | + * <p>Concepts: | 74 | 74 | * <pre> | 75 | 75 | * 1. The default triggering behavior | 76 | 76 | * 2. Late data with the default trigger | 77 | 77 | * 3. How to get speculative estimates | 78 | 78 | * 4. Combining late data and speculative estimates | 79 | 79 | * </pre> | 80 | 80 | * | 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 | 82 | 82 | * and understand the concept of 'late data', | 83 | 83 | * See: <a href="https://cloud.google.com/dataflow/model/triggers"> | 84 | 84 | * https://cloud.google.com/dataflow/model/triggers </a> and | 85 | 85 | * <a href="https://cloud.google.com/dataflow/model/windowing#Advanced"> | 86 | 86 | * https://cloud.google.com/dataflow/model/windowing#Advanced </a> | 87 | 87 | * | 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 | 89 | 89 | * also run an auxiliary pipeline to inject data from the default {@code --input} file to the | 90 | 90 | * {@code --pubsubTopic}. The auxiliary pipeline puts a timestamp on the injected data so that the | 91 | 91 | * example pipeline can operate on <i>event time</i> (rather than arrival time). The auxiliary | | 94 | 94 | * choosing or set {@code --input=""} which will disable the automatic Pub/Sub injection, and allow | 95 | 95 | * you to use a separate tool to publish to the given topic. | 96 | 96 | * | 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 | 98 | 98 | * from the example common package (there are no defaults for a general Dataflow pipeline). | 99 | 99 | * You can override them by using the {@code --pubsubTopic}, {@code --bigQueryDataset}, and | 100 | 100 | * {@code --bigQueryTable} options. If the Pub/Sub topic or the BigQuery table do not exist, | 101 | 101 | * the example will try to create them. | 102 | 102 | * | 103 | | - * <p> The pipeline outputs its results to a BigQuery table. | | 103 | + * <p>The pipeline outputs its results to a BigQuery table. | 104 | 104 | * Here are some queries you can use to see interesting results: | 105 | 105 | * Replace {@code <enter_table_name>} in the query below with the name of the BigQuery table. | 106 | 106 | * Replace {@code <enter_window_interval>} in the query below with the window interval. | 107 | 107 | * | 108 | | - * <p> To see the results of the default trigger, | | 108 | + * <p>To see the results of the default trigger, | 109 | 109 | * Note: When you start up your pipeline, you'll initially see results from 'late' data. Wait after | 110 | 110 | * the window duration, until the first pane of non-late data has been emitted, to see more | 111 | 111 | * interesting results. | 112 | 112 | * {@code SELECT * FROM enter_table_name WHERE trigger_type = "default" ORDER BY window DESC} | 113 | 113 | * | 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, | 115 | 115 | * {@code SELECT * FROM <enter_table_name> WHERE trigger_type = "withAllowedLateness" and | 116 | 116 | * (timing = "LATE" or timing = "ON_TIME") and freeway = "5" ORDER BY window DESC, processing_time} | 117 | 117 | * | | 120 | 120 | * (trigger_type = "withAllowedLateness" or trigger_type = "sequential") and freeway = "5" ORDER BY | 121 | 121 | * window DESC, processing_time} | 122 | 122 | * | 123 | | - * <p> To see speculative results every minute, | | 123 | + * <p>To see speculative results every minute, | 124 | 124 | * {@code SELECT * FROM <enter_table_name> WHERE trigger_type = "speculative" and freeway = "5" | 125 | 125 | * ORDER BY window DESC, processing_time} | 126 | 126 | * | 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 | 128 | 128 | * {@code SELECT * FROM <enter_table_name> WHERE trigger_type = "sequential" and timing != "EARLY" | 129 | 129 | * and freeway = "5" ORDER BY window DESC, processing_time} | 130 | 130 | * | 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, | 132 | 132 | * {@code SELECT * FROM <enter_table_name> WHERE (isFirst = true or isLast = true) ORDER BY window} | 133 | 133 | * | 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. | 135 | 135 | * For examples, To see the results of the default trigger, | 136 | 136 | * {@code SELECT * FROM <enter_table_name> WHERE trigger_type = "default" AND freeway = "5" AND | 137 | 137 | * window = "<enter_window_interval>"} | 138 | 138 | * | 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) | 140 | 140 | * and then exits. | 141 | 141 | */ | 142 | 142 |
| @@ -170,13 +170,13 @@ public class TriggerExample { | 170 | 170 | * 5 | 60 | 10:27:20 | 10:27:25 | 171 | 171 | * 5 | 60 | 10:29:00 | 11:11:00 | 172 | 172 | * | 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 | 174 | 174 | * complete. For the purposes of the example, we'll assume the watermark is approximately 15m | 175 | 175 | * behind the current processing time. In practice, the actual value would vary over time based | 176 | 176 | * on the systems knowledge of the current PubSub delay and contents of the backlog (data | 177 | 177 | * that has not yet been processed). | 178 | 178 | * | 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 | 180 | 180 | * close at 10:44:59, when the watermark passes 10:30:00. | 181 | 181 | */ | 182 | 182 | static class CalculateTotalFlow | |
Collapse file Copy file name to clipboardExpand all lines: examples/src/main/java8/com/google/cloud/dataflow/examples/complete/game/GameStats.java +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 65 | 65 | * New concepts: session windows and finding session duration; use of both | 66 | 66 | * singleton and non-singleton side inputs. | 67 | 67 | * | 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 | 69 | 69 | * intelligence" analysis: abuse detection and usage patterns. The pipeline derives the Mean user | 70 | 70 | * score sum for a window, and uses that information to identify likely spammers/robots. (The robots | 71 | 71 | * have a higher click rate than the human users). The 'robot' users are then filtered out when | 72 | 72 | * calculating the team scores. | 73 | 73 | * | 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 | 75 | 75 | * session windows. Then, the mean session duration information is recorded in the context of | 76 | 76 | * subsequent fixed windowing. (This could be used to tell us what games are giving us greater | 77 | 77 | * user retention). | 78 | 78 | * | 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 | 80 | 80 | * documentation provides more detail. | 81 | 81 | * | 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 | 83 | 83 | * like this: | 84 | 84 | * <pre>{@code | 85 | 85 | * --project=YOUR_PROJECT_ID | |
Collapse file Copy file name to clipboardExpand all lines: examples/src/main/java8/com/google/cloud/dataflow/examples/complete/game/HourlyTeamScore.java +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 46 | 46 | * domain, following {@link UserScore}. In addition to the concepts introduced in {@link UserScore}, | 47 | 47 | * new concepts include: windowing and element timestamps; use of {@code Filter.byPredicate()}. | 48 | 48 | * | 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 | 50 | 50 | * UserScore} but using fixed windows. It calculates the sum of scores per team, for each window, | 51 | 51 | * optionally allowing specification of two timestamps before and after which data is filtered out. | 52 | 52 | * This allows a model where late data collected after the intended analysis window can be included, | | 55 | 55 | * {@link UserScore} pipeline. However, our batch processing is high-latency, in that we don't get | 56 | 56 | * results from plays at the beginning of the batch's time period until the batch is processed. | 57 | 57 | * | 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 | 59 | 59 | * like this: | 60 | 60 | * <pre>{@code | 61 | 61 | * --project=YOUR_PROJECT_ID | | 66 | 66 | * </pre> | 67 | 67 | * where the BigQuery dataset you specify must already exist. | 68 | 68 | * | 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. | 70 | 70 | * To indicate a time after which the data should be filtered out, include the | 71 | 71 | * {@code --stopMin} arg. E.g., {@code --stopMin=2015-10-18-23-59} indicates that any data | 72 | 72 | * timestamped after 23:59 PST on 2015-10-18 should not be included in the analysis. | |
Collapse file Copy file name to clipboardExpand all lines: examples/src/main/java8/com/google/cloud/dataflow/examples/complete/game/LeaderBoard.java +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 57 | 57 | * early/speculative results; using .accumulatingFiredPanes() to do cumulative processing of late- | 58 | 58 | * arriving data. | 59 | 59 | * | 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 | 61 | 61 | * scores uses fixed windowing based on event time (the time of the game play event), not | 62 | 62 | * processing time (the time that an event is processed by the pipeline). The pipeline calculates | 63 | 63 | * the sum of scores per team, for each window. By default, the team scores are calculated using | 64 | 64 | * one-hour windows. | 65 | 65 | * | 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 | 67 | 67 | * global window, which periodically (every ten minutes) emits cumulative user score sums. | 68 | 68 | * | 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, | 70 | 70 | * here we're using an unbounded data source, which lets us provide speculative results, and allows | 71 | 71 | * handling of late data, at much lower latency. We can use the early/speculative results to keep a | 72 | 72 | * 'leaderboard' updated in near-realtime. Our handling of late data lets us generate correct | 73 | 73 | * results, e.g. for 'team prizes'. We're now outputting window results as they're | 74 | 74 | * calculated, giving us much lower latency than with the previous batch examples. | 75 | 75 | * | 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 | 77 | 77 | * documentation provides more detail on how to do this. | 78 | 78 | * | 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 | 80 | 80 | * like this: | 81 | 81 | * <pre>{@code | 82 | 82 | * --project=YOUR_PROJECT_ID | |
Collapse file Copy file name to clipboardExpand all lines: examples/src/main/java8/com/google/cloud/dataflow/examples/complete/game/UserScore.java +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 49 | 49 | * BigQuery; using standalone DoFns; use of the sum by key transform; examples of | 50 | 50 | * Java 8 lambda syntax. | 51 | 51 | * | 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 | 53 | 53 | * day, and their actions are logged for processing. Some of the logged game events may be late- | 54 | 54 | * arriving, if users play on mobile devices and go transiently offline for a period. | 55 | 55 | * | 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 | 57 | 57 | * sum of scores per user, over an entire batch of gaming data (collected, say, for each day). The | 58 | 58 | * batch processing will not include any late data that arrives after the day's cutoff point. | 59 | 59 | * | 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 | 61 | 61 | * the pipeline configuration like this: | 62 | 62 | * <pre>{@code | 63 | 63 | * --project=YOUR_PROJECT_ID | | 68 | 68 | * </pre> | 69 | 69 | * where the BigQuery dataset you specify must already exist. | 70 | 70 | * | 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. | 72 | 72 | * See the --input default value for example batch data file, or use {@link injector.Injector} to | 73 | 73 | * generate your own batch data. | 74 | 74 | */ | |
Collapse file Copy file name to clipboardExpand all lines: examples/src/main/java8/com/google/cloud/dataflow/examples/complete/game/injector/Injector.java +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 41 | 41 | * This is a generator that simulates usage data from a mobile game, and either publishes the data | 42 | 42 | * to a pubsub topic or writes it to a file. | 43 | 43 | * | 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 | 45 | 45 | * members. Each member is scoring points for their team. After some period, a team will dissolve | 46 | 46 | * and a new one will be created in its place. There is also a set of 'Robots', or spammer users. | 47 | 47 | * They hop from team to team. The robots are set to have a higher 'click rate' (generate more | 48 | 48 | * events) than the regular team members. | 49 | 49 | * | 50 | | - * <p> Each generated line of data has the following form: | | 50 | + * <p>Each generated line of data has the following form: | 51 | 51 | * username,teamname,score,timestamp_in_ms,readable_time | 52 | 52 | * e.g.: | 53 | 53 | * user2_AsparagusPig,AsparagusPig,10,1445230923951,2015-11-02 09:09:28.224 | 54 | 54 | * | 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 | 56 | 56 | * specified. It takes the following arguments: | 57 | 57 | * {@code Injector project-name (topic-name|none) (filename|none)}. | 58 | 58 | * | 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 | 60 | 60 | * locally using project-based service account credentials to avoid running over PubSub | 61 | 61 | * quota. | 62 | 62 | * See https://developers.google.com/identity/protocols/application-default-credentials | | 75 | 75 | * </pre> | 76 | 76 | * The pubsub topic will be created if it does not exist. | 77 | 77 | * | 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 | 79 | 79 | * filename: | 80 | 80 | * <pre>{@code | 81 | 81 | * Injector <project-name> none <filename> | |
Collapse file Copy file name to clipboardExpand all lines: maven-archetypes/examples/src/main/resources/archetype-resources/src/main/java/DebuggingWordCount.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -158,7 +158,7 @@ public void processElement(ProcessContext c) { | 158 | 158 | * <p>Inherits standard configuration options and all options defined in | 159 | 159 | * {@link WordCount.WordCountOptions}. | 160 | 160 | */ | 161 | | - public static interface WordCountOptions extends WordCount.WordCountOptions { | | 161 | + public interface WordCountOptions extends WordCount.WordCountOptions { | 162 | 162 |
| 163 | 163 | @Description("Regex filter pattern to use in DebuggingWordCount. " | 164 | 164 | + "Only words matching this pattern will be counted.") | |
Collapse file Copy file name to clipboardExpand all lines: maven-archetypes/examples/src/main/resources/archetype-resources/src/main/java/WindowedWordCount.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -178,7 +178,7 @@ private static TableReference getTableReference(Options options) { | 178 | 178 | * table and the PubSub topic, as well as the {@link WordCount.WordCountOptions} support for | 179 | 179 | * specification of the input file. | 180 | 180 | */ | 181 | | - public static interface Options | | 181 | + public interface Options | 182 | 182 | extends WordCount.WordCountOptions, DataflowExampleUtils.DataflowExampleUtilsOptions { | 183 | 183 | @Description("Fixed window duration, in minutes") | 184 | 184 | @Default.Integer(WINDOW_SIZE) | |
Collapse file Copy file name to clipboardExpand all lines: maven-archetypes/examples/src/main/resources/archetype-resources/src/main/java/WordCount.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -158,7 +158,7 @@ public PCollection<KV<String, Long>> apply(PCollection<String> lines) { | 158 | 158 | * | 159 | 159 | * <p>Inherits standard configuration options. | 160 | 160 | */ | 161 | | - public static interface WordCountOptions extends PipelineOptions { | | 161 | + public interface WordCountOptions extends PipelineOptions { | 162 | 162 | @Description("Path of the file to read from") | 163 | 163 | @Default.String("gs://dataflow-samples/shakespeare/kinglear.txt") | 164 | 164 | String getInputFile(); | @@ -172,7 +172,7 @@ public static interface WordCountOptions extends PipelineOptions { | 172 | 172 | /** | 173 | 173 | * Returns "gs://${YOUR_STAGING_DIRECTORY}/counts.txt" as the default destination. | 174 | 174 | */ | 175 | | - public static class OutputFactory implements DefaultValueFactory<String> { | | 175 | + class OutputFactory implements DefaultValueFactory<String> { | 176 | 176 | @Override | 177 | 177 | public String create(PipelineOptions options) { | 178 | 178 | DataflowPipelineOptions dataflowOptions = options.as(DataflowPipelineOptions.class); | |
|