You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by gy...@apache.org on 2015/02/06 12:43:37 UTC

flink git commit: [streaming] Critical bugfix for streaming keyselectors

Repository: flink
Updated Branches:
  refs/heads/master 970b2b7af -> e9c91e14c


[streaming] Critical bugfix for streaming keyselectors


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

Branch: refs/heads/master
Commit: e9c91e14cd6b479535e58017f02fdcd1bd4a03a7
Parents: 970b2b7
Author: Gyula Fora <gy...@apache.org>
Authored: Fri Feb 6 12:30:30 2015 +0100
Committer: Gyula Fora <gy...@apache.org>
Committed: Fri Feb 6 12:31:06 2015 +0100

----------------------------------------------------------------------
 .../apache/flink/streaming/util/keys/KeySelectorUtil.java | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/e9c91e14/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java b/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java
index 73e6360..08afd0d 100644
--- a/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java
+++ b/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java
@@ -82,14 +82,11 @@ public class KeySelectorUtil {
 			this.comparator = comparator;
 			this.keyLength = keyLength;
 			keyArray = new Object[keyLength];
-			try {
-				key = (Tuple) tupleClasses[keyLength - 1].newInstance();
-			} catch (Exception e) {
-			}
 		}
 
 		@Override
 		public Tuple getKey(IN value) throws Exception {
+			key = (Tuple) tupleClasses[keyLength - 1].newInstance();
 			comparator.extractKeys(value, keyArray, 0);
 			for (int i = 0; i < keyLength; i++) {
 				key.setField(keyArray[i], i);
@@ -108,14 +105,11 @@ public class KeySelectorUtil {
 
 		public ArrayKeySelector(int... fields) {
 			this.fields = fields;
-			try {
-				key = (Tuple) tupleClasses[fields.length - 1].newInstance();
-			} catch (Exception e) {
-			}
 		}
 
 		@Override
 		public Tuple getKey(IN value) throws Exception {
+			key = (Tuple) tupleClasses[fields.length - 1].newInstance();
 			for (int i = 0; i < fields.length; i++) {
 				int pos = fields[i];
 				key.setField(Array.get(value, fields[pos]), i);