kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject [2/3] kafka git commit: fixed checkstyle simplified boundary check
Date Thu, 30 Jun 2016 18:07:30 GMT
fixed checkstyle
simplified boundary check


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/6ba0aaae
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/6ba0aaae
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/6ba0aaae

Branch: refs/heads/0.10.0
Commit: 6ba0aaaedfe39069ecd8826b73c5a530a529faeb
Parents: 9dc5dc4
Author: Matthias J. Sax <matthias@confluent.io>
Authored: Thu Jun 30 14:59:11 2016 +0200
Committer: Matthias J. Sax <matthias@confluent.io>
Committed: Thu Jun 30 15:29:53 2016 +0200

----------------------------------------------------------------------
 .../org/apache/kafka/streams/kstream/JoinWindows.java  | 13 ++-----------
 .../apache/kafka/streams/kstream/JoinWindowsTest.java  |  4 ++--
 2 files changed, 4 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/6ba0aaae/streams/src/main/java/org/apache/kafka/streams/kstream/JoinWindows.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/kstream/JoinWindows.java b/streams/src/main/java/org/apache/kafka/streams/kstream/JoinWindows.java
index 936bcd2..309a9e6 100644
--- a/streams/src/main/java/org/apache/kafka/streams/kstream/JoinWindows.java
+++ b/streams/src/main/java/org/apache/kafka/streams/kstream/JoinWindows.java
@@ -55,17 +55,8 @@ public class JoinWindows extends Windows<TimeWindow> {
     private JoinWindows(String name, long before, long after) {
         super(name);
 
-        if (before < 0) { // shift lower bound to right
-            if (after < -before) {
-                throw new IllegalArgumentException("Upper interval bound smaller than lower
interval bound."
-                                                   + " <after> must be at least " +
(-before));
-            }
-        }
-        if (after < 0) { // shift upper bound to left
-            if (before < -after) {
-                throw new IllegalArgumentException("Lower interval bound greater than upper
interval bound."
-                        + " <before> must be at least " + (-after));
-            }
+        if (before + after < 0) {
+            throw new IllegalArgumentException("Window interval (ie, before+after) must not
be negative");
         }
 
         this.after = after;

http://git-wip-us.apache.org/repos/asf/kafka/blob/6ba0aaae/streams/src/test/java/org/apache/kafka/streams/kstream/JoinWindowsTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/kstream/JoinWindowsTest.java b/streams/src/test/java/org/apache/kafka/streams/kstream/JoinWindowsTest.java
index d80342a..20efd45 100644
--- a/streams/src/test/java/org/apache/kafka/streams/kstream/JoinWindowsTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/kstream/JoinWindowsTest.java
@@ -98,12 +98,12 @@ public class JoinWindowsTest {
 
     @Test(expected = IllegalArgumentException.class)
     public void afterBelowLower() {
-        JoinWindows.of(anyName, anySize).after(-anySize-1);
+        JoinWindows.of(anyName, anySize).after(-anySize - 1);
     }
 
     @Test(expected = IllegalArgumentException.class)
     public void beforeOverUpper() {
-        JoinWindows.of(anyName, anySize).before(-anySize-1);
+        JoinWindows.of(anyName, anySize).before(-anySize - 1);
     }
 
 }
\ No newline at end of file


Mime
View raw message