beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhalp...@apache.org
Subject [2/2] incubator-beam git commit: [BEAM-168] Remove uses of deprecated API
Date Fri, 22 Apr 2016 23:44:42 GMT
[BEAM-168] Remove uses of deprecated API


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/97e9f182
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/97e9f182
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/97e9f182

Branch: refs/heads/master
Commit: 97e9f182faacc7bde717149f4daed4508f97969f
Parents: f3e6c53
Author: Dan Halperin <dhalperi@google.com>
Authored: Thu Apr 21 23:50:25 2016 -0700
Committer: Dan Halperin <dhalperi@google.com>
Committed: Fri Apr 22 16:44:30 2016 -0700

----------------------------------------------------------------------
 .../beam/sdk/io/BoundedReadFromUnboundedSource.java       |  2 +-
 .../sdk/util/IntervalBoundedExponentialBackOffTest.java   | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/97e9f182/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BoundedReadFromUnboundedSource.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BoundedReadFromUnboundedSource.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BoundedReadFromUnboundedSource.java
index 2d36dd1..5f1d555 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BoundedReadFromUnboundedSource.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BoundedReadFromUnboundedSource.java
@@ -228,7 +228,7 @@ class BoundedReadFromUnboundedSource<T> extends PTransform<PInput,
PCollection<T
 
       private boolean advanceWithBackoff() throws IOException {
         // Try reading from the source with exponential backoff
-        BackOff backoff = new IntervalBoundedExponentialBackOff(10000, 10);
+        BackOff backoff = new IntervalBoundedExponentialBackOff(10000L, 10L);
         long nextSleep = backoff.nextBackOffMillis();
         while (nextSleep != BackOff.STOP) {
           if (endTime != null && Instant.now().isAfter(endTime)) {

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/97e9f182/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IntervalBoundedExponentialBackOffTest.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IntervalBoundedExponentialBackOffTest.java
b/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IntervalBoundedExponentialBackOffTest.java
index cde0958..8e7878c 100644
--- a/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IntervalBoundedExponentialBackOffTest.java
+++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IntervalBoundedExponentialBackOffTest.java
@@ -41,19 +41,19 @@ public class IntervalBoundedExponentialBackOffTest {
   public void testUsingInvalidInitialInterval() throws Exception {
     exception.expect(IllegalArgumentException.class);
     exception.expectMessage("Initial interval must be greater than zero.");
-    new IntervalBoundedExponentialBackOff(1000, 0L);
+    new IntervalBoundedExponentialBackOff(1000L, 0L);
   }
 
   @Test
   public void testUsingInvalidMaximumInterval() throws Exception {
     exception.expect(IllegalArgumentException.class);
     exception.expectMessage("Maximum interval must be greater than zero.");
-    new IntervalBoundedExponentialBackOff(-1, 10L);
+    new IntervalBoundedExponentialBackOff(-1L, 10L);
   }
 
   @Test
   public void testThatcertainNumberOfAttemptsReachesMaxInterval() throws Exception {
-    IntervalBoundedExponentialBackOff backOff = new IntervalBoundedExponentialBackOff(1000,
500);
+    IntervalBoundedExponentialBackOff backOff = new IntervalBoundedExponentialBackOff(1000L,
500);
     assertThat(backOff.nextBackOffMillis(), allOf(greaterThanOrEqualTo(249L), lessThan(751L)));
     assertThat(backOff.nextBackOffMillis(), allOf(greaterThanOrEqualTo(374L), lessThan(1126L)));
     assertThat(backOff.nextBackOffMillis(), allOf(greaterThanOrEqualTo(500L),
@@ -70,7 +70,7 @@ public class IntervalBoundedExponentialBackOffTest {
 
   @Test
   public void testThatResettingAllowsReuse() throws Exception {
-    IntervalBoundedExponentialBackOff backOff = new IntervalBoundedExponentialBackOff(1000,
500);
+    IntervalBoundedExponentialBackOff backOff = new IntervalBoundedExponentialBackOff(1000L,
500);
     assertThat(backOff.nextBackOffMillis(), allOf(greaterThanOrEqualTo(249L), lessThan(751L)));
     assertThat(backOff.nextBackOffMillis(), allOf(greaterThanOrEqualTo(374L), lessThan(1126L)));
     assertThat(backOff.nextBackOffMillis(), allOf(greaterThanOrEqualTo(500L),
@@ -88,7 +88,7 @@ public class IntervalBoundedExponentialBackOffTest {
 
   @Test
   public void testAtMaxInterval() throws Exception {
-    IntervalBoundedExponentialBackOff backOff = new IntervalBoundedExponentialBackOff(1000,
500);
+    IntervalBoundedExponentialBackOff backOff = new IntervalBoundedExponentialBackOff(1000L,
500);
     assertFalse(backOff.atMaxInterval());
     backOff.nextBackOffMillis();
     assertFalse(backOff.atMaxInterval());


Mime
View raw message