You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by jk...@apache.org on 2017/03/31 18:20:42 UTC

[3/6] beam git commit: Fixes a few warnings in Window

Fixes a few warnings in Window


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

Branch: refs/heads/master
Commit: 3563c4b9db8411b52b95c3997bc510ecc4cc8983
Parents: a092f6a
Author: Eugene Kirpichov <ki...@google.com>
Authored: Tue Mar 28 18:04:37 2017 -0700
Committer: Eugene Kirpichov <ki...@google.com>
Committed: Fri Mar 31 10:59:37 2017 -0700

----------------------------------------------------------------------
 .../beam/sdk/transforms/windowing/Window.java   | 27 ++++++++++----------
 1 file changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/3563c4b9/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/Window.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/Window.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/Window.java
index a10f112..5f5295d 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/Window.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/Window.java
@@ -169,7 +169,7 @@ public class Window {
    * properties can be set on it first.
    */
   public static <T> Bound<T> into(WindowFn<? super T, ?> fn) {
-    return new Bound().into(fn);
+    return new Bound<T>().into(fn);
   }
 
   /**
@@ -182,7 +182,7 @@ public class Window {
    */
   @Experimental(Kind.TRIGGER)
   public static <T> Bound<T> triggering(Trigger trigger) {
-    return new Bound().triggering(trigger);
+    return new Bound<T>().triggering(trigger);
   }
 
   /**
@@ -194,7 +194,7 @@ public class Window {
    */
   @Experimental(Kind.TRIGGER)
   public static <T> Bound<T> discardingFiredPanes() {
-    return new Bound().discardingFiredPanes();
+    return new Bound<T>().discardingFiredPanes();
   }
 
   /**
@@ -206,7 +206,7 @@ public class Window {
    */
   @Experimental(Kind.TRIGGER)
   public static <T> Bound<T> accumulatingFiredPanes() {
-    return new Bound().accumulatingFiredPanes();
+    return new Bound<T>().accumulatingFiredPanes();
   }
 
   /**
@@ -222,7 +222,7 @@ public class Window {
    */
   @Experimental(Kind.TRIGGER)
   public static <T> Bound<T> withAllowedLateness(Duration allowedLateness) {
-    return new Bound().withAllowedLateness(allowedLateness);
+    return new Bound<T>().withAllowedLateness(allowedLateness);
   }
 
   /**
@@ -231,7 +231,7 @@ public class Window {
    */
   @Experimental(Kind.OUTPUT_TIME)
   public static <T> Bound<T> withOutputTimeFn(OutputTimeFn<?> outputTimeFn) {
-    return new Bound().withOutputTimeFn(outputTimeFn);
+    return new Bound<T>().withOutputTimeFn(outputTimeFn);
   }
 
   /**
@@ -300,7 +300,7 @@ public class Window {
      */
     @Experimental(Kind.TRIGGER)
     public Bound<T> triggering(Trigger trigger) {
-      return new Bound<T>(
+      return new Bound<>(
           windowFn,
           trigger,
           mode,
@@ -318,7 +318,7 @@ public class Window {
     */
     @Experimental(Kind.TRIGGER)
    public Bound<T> discardingFiredPanes() {
-     return new Bound<T>(
+     return new Bound<>(
          windowFn,
          trigger,
          AccumulationMode.DISCARDING_FIRED_PANES,
@@ -336,7 +336,7 @@ public class Window {
     */
    @Experimental(Kind.TRIGGER)
    public Bound<T> accumulatingFiredPanes() {
-     return new Bound<T>(
+     return new Bound<>(
          windowFn,
          trigger,
          AccumulationMode.ACCUMULATING_FIRED_PANES,
@@ -360,7 +360,7 @@ public class Window {
      */
     @Experimental(Kind.TRIGGER)
     public Bound<T> withAllowedLateness(Duration allowedLateness) {
-      return new Bound<T>(
+      return new Bound<>(
           windowFn, trigger, mode, allowedLateness, closingBehavior, outputTimeFn);
     }
 
@@ -370,7 +370,7 @@ public class Window {
      */
     @Experimental(Kind.OUTPUT_TIME)
     public Bound<T> withOutputTimeFn(OutputTimeFn<?> outputTimeFn) {
-      return new Bound<T>(
+      return new Bound<>(
           windowFn, trigger, mode, allowedLateness, closingBehavior, outputTimeFn);
     }
 
@@ -386,7 +386,7 @@ public class Window {
      */
     @Experimental(Kind.TRIGGER)
     public Bound<T> withAllowedLateness(Duration allowedLateness, ClosingBehavior behavior) {
-      return new Bound<T>(windowFn, trigger, mode, allowedLateness, behavior, outputTimeFn);
+      return new Bound<>(windowFn, trigger, mode, allowedLateness, behavior, outputTimeFn);
     }
 
     /**
@@ -422,6 +422,7 @@ public class Window {
     /**
      * Get the {@link WindowFn} of this {@link Window.Bound Window PTransform}.
      */
+    @Nullable
     public WindowFn<? super T, ?> getWindowFn() {
       return windowFn;
     }
@@ -568,7 +569,7 @@ public class Window {
    * {@link org.apache.beam.sdk.transforms.GroupByKey}.
    */
   public static <T> Remerge<T> remerge() {
-    return new Remerge<T>();
+    return new Remerge<>();
   }
 
   /**