You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2017/05/20 15:54:42 UTC

[1/3] flink git commit: [FLINK-6644] Don't register HUP signal handler on Windows

Repository: flink
Updated Branches:
  refs/heads/master 040356391 -> 654d0ede9


[FLINK-6644] Don't register HUP signal handler on Windows

This closes #3955.


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

Branch: refs/heads/master
Commit: 654d0ede97c4368b8323c6cc7dd382e1860df55e
Parents: 0a5b98e
Author: zentol <ch...@apache.org>
Authored: Fri May 19 17:34:47 2017 +0200
Committer: zentol <ch...@apache.org>
Committed: Sat May 20 16:05:03 2017 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/flink/runtime/util/SignalHandler.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/654d0ede/flink-runtime/src/main/java/org/apache/flink/runtime/util/SignalHandler.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/util/SignalHandler.java b/flink-runtime/src/main/java/org/apache/flink/runtime/util/SignalHandler.java
index cff8ba1..cedbcb6 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/util/SignalHandler.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/util/SignalHandler.java
@@ -18,6 +18,7 @@
 
 package org.apache.flink.runtime.util;
 
+import org.apache.flink.util.OperatingSystem;
 import org.slf4j.Logger;
 import sun.misc.Signal;
 
@@ -67,7 +68,9 @@ public class SignalHandler {
 			}
 			registered = true;
 
-			final String[] SIGNALS = { "TERM", "HUP", "INT" };
+			final String[] SIGNALS = OperatingSystem.isWindows()
+				? new String[]{ "TERM", "INT"}
+				: new String[]{ "TERM", "HUP", "INT" };
 			
 			StringBuilder bld = new StringBuilder();
 			bld.append("Registered UNIX signal handlers for [");


[3/3] flink git commit: [FLINK-6551] Reject empty OutputTag names

Posted by ch...@apache.org.
[FLINK-6551] Reject empty OutputTag names

This closes #3953.


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

Branch: refs/heads/master
Commit: b9e75ff0efeb0fe604f7e55b48291de1e9f6a752
Parents: 0403563
Author: zentol <ch...@apache.org>
Authored: Fri May 19 16:20:05 2017 +0200
Committer: zentol <ch...@apache.org>
Committed: Sat May 20 16:05:03 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/flink/util/OutputTag.java   |  8 +++-
 .../org/apache/flink/util/OutputTagTest.java    | 44 ++++++++++++++++++++
 2 files changed, 50 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/b9e75ff0/flink-core/src/main/java/org/apache/flink/util/OutputTag.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/util/OutputTag.java b/flink-core/src/main/java/org/apache/flink/util/OutputTag.java
index 785855f..800c0b5 100644
--- a/flink-core/src/main/java/org/apache/flink/util/OutputTag.java
+++ b/flink-core/src/main/java/org/apache/flink/util/OutputTag.java
@@ -56,7 +56,9 @@ public class OutputTag<T> implements Serializable {
 	 * @param id The id of the created {@code OutputTag}.
      */
 	public OutputTag(String id) {
-		this.id = Preconditions.checkNotNull(id, "OutputTag id cannot be null.");
+		Preconditions.checkNotNull(id, "OutputTag id cannot be null.");
+		Preconditions.checkArgument(!id.isEmpty(), "OutputTag id must not be empty.");
+		this.id = id;
 
 		try {
 			TypeHint<T> typeHint = new TypeHint<T>(OutputTag.class, this, 0) {};
@@ -74,7 +76,9 @@ public class OutputTag<T> implements Serializable {
 	 * @param typeInfo The {@code TypeInformation} for the side output.
 	 */
 	public OutputTag(String id, TypeInformation<T> typeInfo) {
-		this.id = Preconditions.checkNotNull(id, "OutputTag id cannot be null.");
+		Preconditions.checkNotNull(id, "OutputTag id cannot be null.");
+		Preconditions.checkArgument(!id.isEmpty(), "OutputTag id must not be empty.");
+		this.id = id;
 		this.typeInfo = Preconditions.checkNotNull(typeInfo, "TypeInformation cannot be null.");
 	}
 

http://git-wip-us.apache.org/repos/asf/flink/blob/b9e75ff0/flink-core/src/test/java/org/apache/flink/util/OutputTagTest.java
----------------------------------------------------------------------
diff --git a/flink-core/src/test/java/org/apache/flink/util/OutputTagTest.java b/flink-core/src/test/java/org/apache/flink/util/OutputTagTest.java
new file mode 100644
index 0000000..1caa5b2
--- /dev/null
+++ b/flink-core/src/test/java/org/apache/flink/util/OutputTagTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.util;
+
+import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
+import org.junit.Test;
+
+public class OutputTagTest {
+
+	@Test(expected = NullPointerException.class)
+	public void testNullRejected() {
+		new OutputTag<Integer>(null);
+	}
+
+	@Test(expected = NullPointerException.class)
+	public void testNullRejectedWithTypeInfo() {
+		new OutputTag<>(null, BasicTypeInfo.INT_TYPE_INFO);
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void testEmptyStringRejected() {
+		new OutputTag<Integer>("");
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void testEmptyStringRejectedWithTypeInfo() {
+		new OutputTag<>("", BasicTypeInfo.INT_TYPE_INFO);
+	}
+}


[2/3] flink git commit: [FLINK-6628] Fix start scripts on Windows

Posted by ch...@apache.org.
[FLINK-6628] Fix start scripts on Windows

This closes #3954.


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

Branch: refs/heads/master
Commit: 0a5b98e34b73c5766a6a9d2b49f2eda70624cf26
Parents: b9e75ff
Author: zentol <ch...@apache.org>
Authored: Fri May 19 16:50:37 2017 +0200
Committer: zentol <ch...@apache.org>
Committed: Sat May 20 16:05:03 2017 +0200

----------------------------------------------------------------------
 flink-dist/src/main/flink-bin/bin/config.sh       | 2 +-
 flink-dist/src/main/flink-bin/bin/flink-daemon.sh | 2 +-
 flink-dist/src/main/flink-bin/bin/taskmanager.sh  | 6 ++----
 3 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/0a5b98e3/flink-dist/src/main/flink-bin/bin/config.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/config.sh b/flink-dist/src/main/flink-bin/bin/config.sh
index d73b220..66f0d5b 100755
--- a/flink-dist/src/main/flink-bin/bin/config.sh
+++ b/flink-dist/src/main/flink-bin/bin/config.sh
@@ -391,7 +391,7 @@ rotateLogFilesWithPrefix() {
     dir=$1
     prefix=$2
     while read -r log ; do
-        rotateLogFile $log
+        rotateLogFile "$log"
     # find distinct set of log file names, ignoring the rotation number (trailing dot and digit)
     done < <(find "$dir" ! -type d -path "${prefix}*" | sed -E s/\.[0-9]+$// | sort | uniq)
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/0a5b98e3/flink-dist/src/main/flink-bin/bin/flink-daemon.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/flink-daemon.sh b/flink-dist/src/main/flink-bin/bin/flink-daemon.sh
index 8bb6f0b..e897a49 100644
--- a/flink-dist/src/main/flink-bin/bin/flink-daemon.sh
+++ b/flink-dist/src/main/flink-bin/bin/flink-daemon.sh
@@ -97,7 +97,7 @@ case $STARTSTOP in
 
     (start)
         # Rotate log files
-        rotateLogFilesWithPrefix $FLINK_LOG_DIR $FLINK_LOG_PREFIX
+        rotateLogFilesWithPrefix "$FLINK_LOG_DIR" "$FLINK_LOG_PREFIX"
 
         # Print a warning if daemons are already running on host
         if [ -f $pid ]; then

http://git-wip-us.apache.org/repos/asf/flink/blob/0a5b98e3/flink-dist/src/main/flink-bin/bin/taskmanager.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/taskmanager.sh b/flink-dist/src/main/flink-bin/bin/taskmanager.sh
index b16abc9..ba4fe1d 100755
--- a/flink-dist/src/main/flink-bin/bin/taskmanager.sh
+++ b/flink-dist/src/main/flink-bin/bin/taskmanager.sh
@@ -75,11 +75,9 @@ fi
 if [[ $STARTSTOP == "start-foreground" ]]; then
     exec "${FLINK_BIN_DIR}"/flink-console.sh taskmanager "${args[@]}"
 else
-    TM_COMMAND="${FLINK_BIN_DIR}/flink-daemon.sh $STARTSTOP taskmanager ${args[@]}"
-    
     if [[ $FLINK_TM_COMPUTE_NUMA == "false" ]]; then
         # Start a single TaskManager
-        $TM_COMMAND
+        "${FLINK_BIN_DIR}"/flink-daemon.sh $STARTSTOP taskmanager "${args[@]}"
     else
         # Example output from `numactl --show` on an AWS c4.8xlarge:
         # policy: default
@@ -91,7 +89,7 @@ else
         read -ra NODE_LIST <<< $(numactl --show | grep "^nodebind: ")
         for NODE_ID in "${NODE_LIST[@]:1}"; do
             # Start a TaskManager for each NUMA node
-            numactl --membind=$NODE_ID --cpunodebind=$NODE_ID -- $TM_COMMAND
+            numactl --membind=$NODE_ID --cpunodebind=$NODE_ID -- "${FLINK_BIN_DIR}"/flink-daemon.sh $STARTSTOP taskmanager "${args[@]}"
         done
     fi
 fi