Skip to content

Commit

Permalink
Add groupName attribute to v2 template where it's needed (part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
akashorabek authored and Amar3tto committed May 17, 2024
1 parent bcf01b8 commit 5a626f3
Show file tree
Hide file tree
Showing 31 changed files with 212 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public interface TransformOptions
@TemplateParameter.BigQueryTable(
order = 1,
description = "BigQuery output table",
groupName = "Target",
helpText =
"BigQuery table location to write the output to. The table's schema must match the "
+ "input JSON objects.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public interface ReadFromPubSubOptions extends PipelineOptions {
@TemplateParameter.PubsubSubscription(
order = 1,
description = "Pub/Sub input subscription",
groupName = "Source",
helpText =
"Pub/Sub subscription to read the input from, in the format of 'projects/your-project-id/subscriptions/your-subscription-name'")
String getInputSubscription();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public interface SinkOptions
@TemplateParameter.BigQueryTable(
order = 1,
optional = true,
groupName = "Target",
description = "BigQuery output table",
helpText =
"BigQuery table location to write the output to. The table's schema must match the "
Expand All @@ -73,6 +74,7 @@ public interface SinkOptions
@TemplateParameter.GcsReadFile(
order = 2,
optional = true,
groupName = "Target",
description = "GCS Path to JSON file containing BigQuery table schema.",
helpText = "sample text")
String getBigQuerySchemaPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class WriteToPubSub implements TemplateTransform<WriteToPubSubOptions> {
public interface WriteToPubSubOptions extends PipelineOptions {
@TemplateParameter.PubsubTopic(
order = 8,
groupName = "Target",
description = "Output Pub/Sub topic",
helpText =
"The name of the topic to which data should published, in the format of 'projects/your-project-id/topics/your-topic-name'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public interface BigQueryDlqOptions extends PipelineOptions {
@TemplateParameter.BigQueryTable(
order = 4,
optional = true,
groupName = "Target",
description =
"Table for messages failed to reach the output table (i.e., Deadletter table)",
helpText =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public interface ReadFromJdbcOptions extends PipelineOptions {
order = 1,
optional = false,
regexes = {"^.+$"},
groupName = "Source",
description = "JDBC driver class name.",
helpText = "JDBC driver class name to use.",
example = "com.mysql.jdbc.Driver")
Expand All @@ -33,6 +34,7 @@ public interface ReadFromJdbcOptions extends PipelineOptions {
@TemplateParameter.Text(
order = 2,
optional = false,
groupName = "Source",
regexes = {
"(^jdbc:[a-zA-Z0-9/:@.?_+!*=&-;]+$)|(^([A-Za-z0-9+/]{4}){1,}([A-Za-z0-9+/]{0,3})={0,3})"
},
Expand All @@ -49,6 +51,7 @@ public interface ReadFromJdbcOptions extends PipelineOptions {
order = 3,
optional = true,
regexes = {"^.+$"},
groupName = "Source",
description = "JDBC connection username.",
helpText =
"User name to be used for the JDBC connection. User name can be passed in as plaintext "
Expand All @@ -61,6 +64,7 @@ public interface ReadFromJdbcOptions extends PipelineOptions {
order = 4,
optional = true,
description = "JDBC connection password.",
groupName = "Source",
helpText =
"Password to be used for the JDBC connection. Password can be passed in as plaintext "
+ "or as a base64 encoded string encrypted by Google Cloud KMS.")
Expand All @@ -73,6 +77,7 @@ public interface ReadFromJdbcOptions extends PipelineOptions {
optional = false,
regexes = {"^.+$"},
description = "Cloud Storage paths for JDBC drivers",
groupName = "Source",
helpText = "Comma separate Cloud Storage paths for JDBC drivers.",
example = "gs://your-bucket/driver_jar1.jar,gs://your-bucket/driver_jar2.jar")
String getDriverJars();
Expand All @@ -84,6 +89,7 @@ public interface ReadFromJdbcOptions extends PipelineOptions {
optional = true,
regexes = {"^[a-zA-Z0-9_;!*&=@#-:\\/]+$"},
description = "JDBC connection property string.",
groupName = "Source",
helpText =
"Properties string to use for the JDBC connection. Format of the string must be [propertyName=property;]*.",
example = "unicode=true;characterEncoding=UTF-8")
Expand All @@ -96,6 +102,7 @@ public interface ReadFromJdbcOptions extends PipelineOptions {
optional = false,
regexes = {"^.+$"},
description = "JDBC source SQL query.",
groupName = "Source",
helpText = "Query to be executed on the source to extract the data.",
example = "select * from sampledb.sample_table")
String getQuery();
Expand All @@ -106,6 +113,7 @@ public interface ReadFromJdbcOptions extends PipelineOptions {
order = 8,
optional = true,
description = "Google Cloud KMS key",
groupName = "Source",
helpText =
"If this parameter is provided, password, user name and connection string should all be passed in encrypted. Encrypt parameters using the KMS API encrypt endpoint. See: https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys/encrypt",
example = "projects/your-project/locations/global/keyRings/your-keyring/cryptoKeys/your-key")
Expand All @@ -116,7 +124,7 @@ public interface ReadFromJdbcOptions extends PipelineOptions {
@TemplateParameter.Text(
order = 9,
optional = true,
groupName = "Source Parameters",
groupName = "Source",
description = "The name of a column of numeric type that will be used for partitioning.",
helpText =
"If this parameter is provided (along with `table`), JdbcIO reads the table in parallel by executing multiple instances of the query on the same table (subquery) using ranges. Currently, only Long partition columns are supported.")
Expand All @@ -127,7 +135,7 @@ public interface ReadFromJdbcOptions extends PipelineOptions {
@TemplateParameter.Text(
order = 10,
optional = true,
groupName = "Source Parameters",
groupName = "Source",
description = "Name of the table in the external database.",
helpText =
"Table to read from using partitions. This parameter also accepts a subquery in parentheses.",
Expand All @@ -139,7 +147,7 @@ public interface ReadFromJdbcOptions extends PipelineOptions {
@TemplateParameter.Integer(
order = 11,
optional = true,
groupName = "Source Parameters",
groupName = "Source",
description = "The number of partitions.",
helpText =
"The number of partitions. This, along with the lower and upper bound, form partitions strides for generated WHERE clause expressions used to split the partition column evenly. When the input is less than 1, the number is set to 1.")
Expand All @@ -150,7 +158,7 @@ public interface ReadFromJdbcOptions extends PipelineOptions {
@TemplateParameter.Long(
order = 12,
optional = true,
groupName = "Source Parameters",
groupName = "Source",
description = "Lower bound of partition column.",
helpText =
"Lower bound used in the partition scheme. If not provided, it is automatically inferred by Beam (for the supported types)")
Expand All @@ -161,7 +169,7 @@ public interface ReadFromJdbcOptions extends PipelineOptions {
@TemplateParameter.Long(
order = 13,
optional = true,
groupName = "Source Parameters",
groupName = "Source",
description = "Upper bound of partition column",
helpText =
"Upper bound used in partition scheme. If not provided, it is automatically inferred by Beam (for the supported types)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public interface PubSubToElasticsearchOptions

@TemplateParameter.PubsubSubscription(
order = 1,
groupName = "Source",
description = "Pub/Sub input subscription",
helpText =
"Pub/Sub subscription to consume the input from. Name should be in the format of 'projects/your-project-id/subscriptions/your-subscription-name'",
Expand All @@ -47,6 +48,7 @@ public interface PubSubToElasticsearchOptions

@TemplateParameter.Text(
order = 2,
groupName = "Source",
optional = true,
description = "Dataset, the type of logs that are sent to Pub/Sub",
helpText =
Expand All @@ -60,6 +62,7 @@ public interface PubSubToElasticsearchOptions
@TemplateParameter.Text(
order = 3,
optional = true,
groupName = "Source",
description = "The namespace for dataset.",
helpText =
"An arbitrary grouping, such as an environment (dev, prod, or qa), a team, or a strategic business unit. Default: 'default'")
Expand All @@ -70,6 +73,7 @@ public interface PubSubToElasticsearchOptions

@TemplateParameter.PubsubTopic(
order = 4,
groupName = "Target",
description = "Output deadletter Pub/Sub topic",
helpText =
"Pub/Sub output topic for publishing failed records in the format of 'projects/your-project-id/topics/your-topic-name'.")
Expand All @@ -80,6 +84,7 @@ public interface PubSubToElasticsearchOptions

@TemplateParameter.Text(
order = 5,
groupName = "Target",
optional = true,
description = "Template Version.",
helpText = "Dataflow Template Version Identifier, usually defined by Google Cloud.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public interface PubsubToJdbcOptions extends CommonTemplateOptions {

@TemplateParameter.PubsubSubscription(
order = 1,
groupName = "Source",
description = "Pub/Sub input subscription",
helpText =
"The Pub/Sub input subscription to read from, in the format of 'projects/<PROJECT_ID>/subscriptions/<SUBSCRIPTION_NAME>'",
Expand All @@ -37,6 +38,7 @@ public interface PubsubToJdbcOptions extends CommonTemplateOptions {

@TemplateParameter.Text(
order = 2,
groupName = "Target",
optional = false,
regexes = {"^.+$"},
description = "JDBC driver class name.",
Expand All @@ -48,6 +50,7 @@ public interface PubsubToJdbcOptions extends CommonTemplateOptions {

@TemplateParameter.Text(
order = 3,
groupName = "Target",
optional = false,
regexes = {
"(^jdbc:[a-zA-Z0-9/:@.?_+!*=&-;]+$)|(^([A-Za-z0-9+/]{4}){1,}([A-Za-z0-9+/]{0,3})={0,3})"
Expand All @@ -64,6 +67,7 @@ public interface PubsubToJdbcOptions extends CommonTemplateOptions {

@TemplateParameter.Text(
order = 4,
groupName = "Target",
optional = true,
regexes = {"^.+$"},
description = "JDBC connection username.",
Expand All @@ -76,6 +80,7 @@ public interface PubsubToJdbcOptions extends CommonTemplateOptions {

@TemplateParameter.Password(
order = 5,
groupName = "Target",
optional = true,
description = "JDBC connection password.",
helpText =
Expand All @@ -87,6 +92,7 @@ public interface PubsubToJdbcOptions extends CommonTemplateOptions {

@TemplateParameter.Text(
order = 6,
groupName = "Target",
optional = false,
regexes = {"^.+$"},
description = "Cloud Storage paths for JDBC drivers",
Expand All @@ -98,6 +104,7 @@ public interface PubsubToJdbcOptions extends CommonTemplateOptions {

@TemplateParameter.Text(
order = 7,
groupName = "Target",
optional = true,
regexes = {"^[a-zA-Z0-9_;!*&=@#-:\\/]+$"},
description = "JDBC connection property string.",
Expand All @@ -111,6 +118,7 @@ public interface PubsubToJdbcOptions extends CommonTemplateOptions {

@TemplateParameter.Text(
order = 8,
groupName = "Target",
optional = false,
regexes = {"^.+$"},
description = "Statement which will be executed against the database.",
Expand All @@ -125,6 +133,7 @@ public interface PubsubToJdbcOptions extends CommonTemplateOptions {

@TemplateParameter.PubsubTopic(
order = 9,
groupName = "Source",
description = "Output deadletter Pub/Sub topic",
helpText = "The Pub/Sub topic to forward undeliverable messages to. ",
example = "projects/<PROJECT_ID>/topics/<TOPIC_NAME>")
Expand Down
Loading

0 comments on commit 5a626f3

Please sign in to comment.