You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2018/05/17 13:23:57 UTC

[1/2] flink git commit: [hotfix] [build] Force delete corrupt jar files from cache

Repository: flink
Updated Branches:
  refs/heads/release-1.5 c75c15298 -> 416d924b5


[hotfix] [build] Force delete corrupt jar files from cache


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/416d924b
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/416d924b
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/416d924b

Branch: refs/heads/release-1.5
Commit: 416d924b5c01950a796b6b7ed918062804df5c6e
Parents: 94391d8
Author: Stephan Ewen <se...@apache.org>
Authored: Wed May 16 22:51:02 2018 +0200
Committer: Stephan Ewen <se...@apache.org>
Committed: Thu May 17 15:23:19 2018 +0200

----------------------------------------------------------------------
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/416d924b/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 4acdeb0..cad9c87 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -112,7 +112,7 @@ before_install:
    - "export PATH=$M2_HOME/bin:$PATH"
    - "export MAVEN_OPTS=\"-Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss.SSS\""
 # just in case: clean up the .m2 home and remove invalid jar files
-   - 'test ! -d $HOME/.m2/repository/ || find $HOME/.m2/repository/ -name "*.jar" -exec sh -c ''if ! zip -T {} >/dev/null ; then echo "deleting invalid file: {}"; rm {} ; fi'' \;'
+   - 'test ! -d $HOME/.m2/repository/ || find $HOME/.m2/repository/ -name "*.jar" -exec sh -c ''if ! zip -T {} >/dev/null ; then echo "deleting invalid file: {}"; rm -f {} ; fi'' \;'
 
 # We run mvn and monitor its output. If there is no output for the specified number of seconds, we
 # print the stack traces of all running Java processes.


[2/2] flink git commit: [FLINK-9299] [docs] Fix errors in ProcessWindowFunction documentation Java examples

Posted by se...@apache.org.
[FLINK-9299] [docs] Fix errors in ProcessWindowFunction documentation Java examples

This closes #6001


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/94391d89
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/94391d89
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/94391d89

Branch: refs/heads/release-1.5
Commit: 94391d89a49abda9e1b82cc2bc44daa8159da9e1
Parents: c75c152
Author: yanghua <ya...@gmail.com>
Authored: Sun May 13 16:27:11 2018 +0800
Committer: Stephan Ewen <se...@apache.org>
Committed: Thu May 17 15:23:19 2018 +0200

----------------------------------------------------------------------
 docs/dev/stream/operators/windows.md | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/94391d89/docs/dev/stream/operators/windows.md
----------------------------------------------------------------------
diff --git a/docs/dev/stream/operators/windows.md b/docs/dev/stream/operators/windows.md
index 649bfe8..ad2b516 100644
--- a/docs/dev/stream/operators/windows.md
+++ b/docs/dev/stream/operators/windows.md
@@ -504,7 +504,7 @@ private static class AverageAggregate
 
   @Override
   public Double getResult(Tuple2<Long, Long> accumulator) {
-    return accumulator.f0 / accumulator.f1;
+    return ((double) accumulator.f0) / accumulator.f1;
   }
 
   @Override
@@ -730,7 +730,7 @@ input
 
 /* ... */
 
-public class MyProcessWindowFunction implements ProcessWindowFunction<Tuple<String, Long>, String, String, TimeWindow> {
+public class MyProcessWindowFunction extends ProcessWindowFunction<Tuple<String, Long>, String, String, TimeWindow> {
 
   void process(String key, Context context, Iterable<Tuple<String, Long>> input, Collector<String> out) {
     long count = 0;
@@ -778,7 +778,7 @@ The example shows a `ProcessWindowFunction` that counts the elements in a window
 A `ProcessWindowFunction` can be combined with either a `ReduceFunction`, an `AggregateFunction`, or a `FoldFunction` to
 incrementally aggregate elements as they arrive in the window.
 When the window is closed, the `ProcessWindowFunction` will be provided with the aggregated result.
-This allows to incrementally compute windows while having access to the
+This allows it to incrementally compute windows while having access to the
 additional window meta information of the `ProcessWindowFunction`.
 
 <span class="label label-info">Note</span> You can also the legacy `WindowFunction` instead of
@@ -797,7 +797,7 @@ DataStream<SensorReading> input = ...;
 
 input
   .keyBy(<key selector>)
-  .timeWindow(<window assigner>)
+  .timeWindow(<duration>)
   .reduce(new MyReduceFunction(), new MyProcessWindowFunction());
 
 // Function definitions
@@ -810,7 +810,7 @@ private static class MyReduceFunction implements ReduceFunction<SensorReading> {
 }
 
 private static class MyProcessWindowFunction
-    implements ProcessWindowFunction<SensorReading, Tuple2<Long, SensorReading>, String, TimeWindow> {
+    extends ProcessWindowFunction<SensorReading, Tuple2<Long, SensorReading>, String, TimeWindow> {
 
   public void process(String key,
                     Context context,
@@ -830,7 +830,7 @@ val input: DataStream[SensorReading] = ...
 
 input
   .keyBy(<key selector>)
-  .timeWindow(<window assigner>)
+  .timeWindow(<duration>)
   .reduce(
     (r1: SensorReading, r2: SensorReading) => { if (r1.value > r2.value) r2 else r1 },
     ( key: String,
@@ -856,11 +856,11 @@ the average.
 <div class="codetabs" markdown="1">
 <div data-lang="java" markdown="1">
 {% highlight java %}
-DataStream<Tuple2<String, Long> input = ...;
+DataStream<Tuple2<String, Long>> input = ...;
 
 input
   .keyBy(<key selector>)
-  .timeWindow(<window assigner>)
+  .timeWindow(<duration>)
   .aggregate(new AverageAggregate(), new MyProcessWindowFunction());
 
 // Function definitions
@@ -883,7 +883,7 @@ private static class AverageAggregate
 
   @Override
   public Double getResult(Tuple2<Long, Long> accumulator) {
-    return accumulator.f0 / accumulator.f1;
+    return ((double) accumulator.f0) / accumulator.f1;
   }
 
   @Override
@@ -893,7 +893,7 @@ private static class AverageAggregate
 }
 
 private static class MyProcessWindowFunction
-    implements ProcessWindowFunction<Double, Tuple2<String, Double>, String, TimeWindow> {
+    extends ProcessWindowFunction<Double, Tuple2<String, Double>, String, TimeWindow> {
 
   public void process(String key,
                     Context context,
@@ -913,7 +913,7 @@ val input: DataStream[(String, Long)] = ...
 
 input
   .keyBy(<key selector>)
-  .timeWindow(<window assigner>)
+  .timeWindow(<duration>)
   .aggregate(new AverageAggregate(), new MyProcessWindowFunction())
 
 // Function definitions
@@ -959,7 +959,7 @@ DataStream<SensorReading> input = ...;
 
 input
   .keyBy(<key selector>)
-  .timeWindow(<window assigner>)
+  .timeWindow(<duration>)
   .fold(new Tuple3<String, Long, Integer>("",0L, 0), new MyFoldFunction(), new MyProcessWindowFunction())
 
 // Function definitions
@@ -975,7 +975,7 @@ private static class MyFoldFunction
 }
 
 private static class MyProcessWindowFunction
-    implements ProcessWindowFunction<Tuple3<String, Long, Integer>, Tuple3<String, Long, Integer>, String, TimeWindow> {
+    extends ProcessWindowFunction<Tuple3<String, Long, Integer>, Tuple3<String, Long, Integer>, String, TimeWindow> {
 
   public void process(String key,
                     Context context,
@@ -995,7 +995,7 @@ val input: DataStream[SensorReading] = ...
 
 input
  .keyBy(<key selector>)
- .timeWindow(<window assigner>)
+ .timeWindow(<duration>)
  .fold (
     ("", 0L, 0),
     (acc: (String, Long, Int), r: SensorReading) => { ("", 0L, acc._3 + 1) },