Skip to content

Commit c0abd9e

Browse files
authored
Merge pull request #21917 from [cherry-pick][release-2.40.0] Merge pull request #21910: Revert "convert windmill min timestamp to …
[cherry-pick][release-2.40.0] Merge pull request #21910: Revert "convert windmill min timestamp to …
2 parents 3dc8c63 + 424cffe commit c0abd9e

2 files changed

Lines changed: 0 additions & 13 deletions

File tree

runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/WindmillTimeUtils.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ public static Instant windmillToHarnessTimestamp(long timestampUs) {
4545
// Windmill should never send us an unknown timestamp.
4646
Preconditions.checkArgument(timestampUs != Long.MIN_VALUE);
4747
Instant result = new Instant(divideAndRoundDown(timestampUs, 1000));
48-
if (result.isBefore(BoundedWindow.TIMESTAMP_MIN_VALUE)) {
49-
return BoundedWindow.TIMESTAMP_MIN_VALUE;
50-
}
5148
if (result.isAfter(BoundedWindow.TIMESTAMP_MAX_VALUE)) {
5249
// End of time.
5350
return BoundedWindow.TIMESTAMP_MAX_VALUE;

runners/google-cloud-dataflow-java/worker/src/test/java/org/apache/beam/runners/dataflow/worker/WindmillTimeUtilsTest.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import static org.junit.Assert.assertEquals;
2424

2525
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
26-
import org.joda.time.Duration;
2726
import org.joda.time.Instant;
2827
import org.junit.Test;
2928
import org.junit.runner.RunWith;
@@ -57,15 +56,6 @@ public void testWindmillToHarnessTimestamp() {
5756
assertEquals(new Instant(-17), windmillToHarnessTimestamp(-16987));
5857
assertEquals(new Instant(-17), windmillToHarnessTimestamp(-17000));
5958
assertEquals(new Instant(-18), windmillToHarnessTimestamp(-17001));
60-
assertEquals(BoundedWindow.TIMESTAMP_MIN_VALUE, windmillToHarnessTimestamp(Long.MIN_VALUE + 1));
61-
assertEquals(BoundedWindow.TIMESTAMP_MIN_VALUE, windmillToHarnessTimestamp(Long.MIN_VALUE + 2));
62-
// Long.MIN_VALUE = -9223372036854775808, need to add 1808 microseconds to get to next
63-
// millisecond returned by Beam.
64-
assertEquals(
65-
BoundedWindow.TIMESTAMP_MIN_VALUE.plus(Duration.millis(1)),
66-
windmillToHarnessTimestamp(Long.MIN_VALUE + 1808));
67-
assertEquals(
68-
BoundedWindow.TIMESTAMP_MIN_VALUE, windmillToHarnessTimestamp(Long.MIN_VALUE + 1807));
6959
}
7060

7161
@Test

0 commit comments

Comments
 (0)