Skip to content

Commit 591f216

Browse files
committed
review
1 parent 25381cd commit 591f216

17 files changed

Lines changed: 41 additions & 25 deletions

File tree

it/google-cloud-platform/src/main/java/org/apache/beam/it/gcp/artifacts/utils/ArtifactUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package org.apache.beam.it.gcp.artifacts.utils;
1919

20+
import java.time.ZoneOffset;
2021
import static java.util.Arrays.stream;
2122
import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkArgument;
2223

@@ -37,7 +38,7 @@ private ArtifactUtils() {}
3738
public static String createRunId() {
3839
return String.format(
3940
"%s-%s",
40-
DateTimeFormatter.ofPattern("yyyyMMdd").withZone(ZoneId.of("UTC")).format(Instant.now()),
41+
DateTimeFormatter.ofPattern("yyyyMMdd").withZone(ZoneOffset.UTC).format(Instant.now()),
4142
// by default some templates replace "dd" in the output paths with a day of the month, since
4243
// this id is used as a part of output paths replace "dd" with an arbitrary number to avoid
4344
// confusion and potential flaky tests

it/google-cloud-platform/src/main/java/org/apache/beam/it/gcp/datastore/DatastoreUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import java.time.Instant;
2121
import java.time.ZoneId;
22+
import java.time.ZoneOffset;
2223
import java.time.format.DateTimeFormatter;
2324
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.CaseFormat;
2425

@@ -44,7 +45,7 @@ static String createTestId(String prefix) {
4445
CaseFormat.UPPER_CAMEL.converterTo(CaseFormat.LOWER_HYPHEN).convert(prefix);
4546
String formattedTimestamp =
4647
DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS")
47-
.withZone(ZoneId.of("UTC"))
48+
.withZone(ZoneOffset.UTC)
4849
.format(Instant.now());
4950
return String.format("%s-%s", convertedPrefix, formattedTimestamp);
5051
}

it/google-cloud-platform/src/main/java/org/apache/beam/it/gcp/pubsub/PubsubUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package org.apache.beam.it.gcp.pubsub;
1919

20+
import java.time.ZoneOffset;
2021
import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkArgument;
2122

2223
import com.google.pubsub.v1.Subscription;
@@ -108,7 +109,7 @@ static String createTestId(String prefix) {
108109
CaseFormat.UPPER_CAMEL.converterTo(CaseFormat.LOWER_HYPHEN).convert(prefix);
109110
String formattedTimestamp =
110111
DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS")
111-
.withZone(ZoneId.of("UTC"))
112+
.withZone(ZoneOffset.UTC)
112113
.format(Instant.now());
113114
return String.format("%s-%s", convertedPrefix, formattedTimestamp);
114115
}

it/google-cloud-platform/src/test/java/org/apache/beam/it/gcp/bigquery/BigQueryIOLT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package org.apache.beam.it.gcp.bigquery;
1919

20+
import java.time.ZoneOffset;
2021
import static org.apache.beam.it.truthmatchers.PipelineAsserts.assertThatResult;
2122
import static org.junit.Assert.assertEquals;
2223
import static org.junit.Assert.assertNotEquals;
@@ -126,7 +127,7 @@ public void setup() {
126127
String tableName =
127128
"io-bq-table-"
128129
+ DateTimeFormatter.ofPattern("MMddHHmmssSSS")
129-
.withZone(ZoneId.of("UTC"))
130+
.withZone(ZoneOffset.UTC)
130131
.format(java.time.Instant.now())
131132
+ UUID.randomUUID().toString().substring(0, 10);
132133
tableQualifier = String.format("%s:%s.%s", project, resourceManager.getDatasetId(), tableName);

it/google-cloud-platform/src/test/java/org/apache/beam/it/gcp/bigquery/BigQueryIOST.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package org.apache.beam.it.gcp.bigquery;
1919

20+
import java.time.ZoneOffset;
2021
import static org.junit.Assert.assertNotEquals;
2122
import static org.junit.Assert.assertTrue;
2223

@@ -112,7 +113,7 @@ public void setup() {
112113
tableName =
113114
"io-bq-source-table-"
114115
+ DateTimeFormatter.ofPattern("MMddHHmmssSSS")
115-
.withZone(ZoneId.of("UTC"))
116+
.withZone(ZoneOffset.UTC)
116117
.format(java.time.Instant.now())
117118
+ UUID.randomUUID().toString().substring(0, 10);
118119
tableQualifier = String.format("%s:%s.%s", project, resourceManager.getDatasetId(), tableName);

it/google-cloud-platform/src/test/java/org/apache/beam/it/gcp/spanner/SpannerIOLT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package org.apache.beam.it.gcp.spanner;
1919

20+
import java.time.ZoneOffset;
2021
import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkArgument;
2122
import static org.junit.Assert.assertEquals;
2223
import static org.junit.Assert.assertNotEquals;
@@ -76,7 +77,7 @@ public void setup() throws IOException {
7677
tableName =
7778
"io_spanner_"
7879
+ DateTimeFormatter.ofPattern("MMddHHmmssSSS")
79-
.withZone(ZoneId.of("UTC"))
80+
.withZone(ZoneOffset.UTC)
8081
.format(java.time.Instant.now())
8182
+ UUID.randomUUID().toString().replace("-", "").substring(0, 10);
8283

it/google-cloud-platform/src/test/java/org/apache/beam/it/gcp/spanner/SpannerIOST.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package org.apache.beam.it.gcp.spanner;
1919

20+
import java.time.ZoneOffset;
2021
import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkArgument;
2122
import static org.junit.Assert.assertNotEquals;
2223
import static org.junit.Assert.assertTrue;
@@ -89,7 +90,7 @@ public void setup() throws IOException {
8990
tableName =
9091
"io_spanner_"
9192
+ DateTimeFormatter.ofPattern("MMddHHmmssSSS")
92-
.withZone(ZoneId.of("UTC"))
93+
.withZone(ZoneOffset.UTC)
9394
.format(java.time.Instant.now())
9495
+ UUID.randomUUID().toString().replace("-", "").substring(0, 10);
9596

it/google-cloud-platform/src/test/java/org/apache/beam/it/gcp/storage/FileBasedIOLT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package org.apache.beam.it.gcp.storage;
1919

20+
import java.time.ZoneOffset;
2021
import static org.apache.beam.it.truthmatchers.PipelineAsserts.assertThatResult;
2122
import static org.junit.Assert.assertEquals;
2223

@@ -151,7 +152,7 @@ public void setup() {
151152
String tempDirName =
152153
"textiolt-"
153154
+ DateTimeFormatter.ofPattern("MMddHHmmssSSS")
154-
.withZone(ZoneId.of("UTC"))
155+
.withZone(ZoneOffset.UTC)
155156
.format(java.time.Instant.now())
156157
+ UUID.randomUUID().toString().substring(0, 10);
157158
resourceManager.registerTempDir(tempDirName);

it/kafka/src/test/java/org/apache/beam/it/kafka/KafkaIOLT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package org.apache.beam.it.kafka;
1919

20+
import java.time.ZoneOffset;
2021
import static org.junit.Assert.assertEquals;
2122
import static org.junit.Assert.assertNotEquals;
2223

@@ -78,7 +79,7 @@ public void setup() throws IOException {
7879
kafkaTopic =
7980
"io-kafka-"
8081
+ DateTimeFormatter.ofPattern("MMddHHmmssSSS")
81-
.withZone(ZoneId.of("UTC"))
82+
.withZone(ZoneOffset.UTC)
8283
.format(java.time.Instant.now())
8384
+ UUID.randomUUID().toString().substring(0, 10);
8485

it/kafka/src/test/java/org/apache/beam/it/kafka/KafkaIOST.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package org.apache.beam.it.kafka;
1919

20+
import java.time.ZoneOffset;
2021
import static org.junit.Assert.assertNotEquals;
2122
import static org.junit.Assert.assertTrue;
2223

@@ -116,7 +117,7 @@ public void setup() {
116117
kafkaTopic =
117118
"io-kafka-"
118119
+ DateTimeFormatter.ofPattern("MMddHHmmssSSS")
119-
.withZone(ZoneId.of("UTC"))
120+
.withZone(ZoneOffset.UTC)
120121
.format(java.time.Instant.now())
121122
+ UUID.randomUUID().toString().substring(0, 10);
122123
adminClient.createTopics(Collections.singletonList(new NewTopic(kafkaTopic, 1, (short) 3)));

0 commit comments

Comments
 (0)