You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by rm...@apache.org on 2016/05/27 15:57:05 UTC

[2/3] flink git commit: [FLINK-3129] Fix breaking changes in flink-core

[FLINK-3129] Fix breaking changes in flink-core


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

Branch: refs/heads/master
Commit: b0acd97935cd21843bac3b9b5afa3662b52bb95d
Parents: 6c07936
Author: Robert Metzger <rm...@apache.org>
Authored: Fri May 27 10:53:35 2016 +0200
Committer: Robert Metzger <rm...@apache.org>
Committed: Fri May 27 17:56:43 2016 +0200

----------------------------------------------------------------------
 flink-core/pom.xml                              | 20 +++++++
 .../flink/api/common/ExecutionConfig.java       |  4 --
 .../api/common/functions/RuntimeContext.java    |  1 +
 .../flink/configuration/ConfigConstants.java    |  6 ++
 .../org/apache/flink/types/DoubleValue.java     |  2 +-
 .../java/org/apache/flink/types/FloatValue.java |  2 +-
 .../main/java/org/apache/flink/types/Key.java   | 59 ++++++++++++++++++++
 .../org/apache/flink/types/NormalizableKey.java |  2 +-
 flink-streaming-scala/pom.xml                   |  1 -
 pom.xml                                         |  1 -
 10 files changed, 89 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/b0acd979/flink-core/pom.xml
----------------------------------------------------------------------
diff --git a/flink-core/pom.xml b/flink-core/pom.xml
index 0e0b54b..b64f94e 100644
--- a/flink-core/pom.xml
+++ b/flink-core/pom.xml
@@ -112,6 +112,26 @@ under the License.
 					</execution>
 				</executions>
 			</plugin>
+			<!-- Exclude removed CONFIG_KEY from ccheck -->
+			<plugin>
+				<groupId>com.github.siom79.japicmp</groupId>
+				<artifactId>japicmp-maven-plugin</artifactId>
+				<configuration>
+					<parameter>
+						<excludes combine.children="append">
+							<exclude>org.apache.flink.api.common.ExecutionConfig#CONFIG_KEY</exclude>
+						</excludes>
+					</parameter>
+				</configuration>
+				<executions>
+					<execution>
+						<phase>verify</phase>
+						<goals>
+							<goal>cmp</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
 		</plugins>
 	</build>
 

http://git-wip-us.apache.org/repos/asf/flink/blob/b0acd979/flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java b/flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java
index 58a943b..86d3be6 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java
@@ -82,10 +82,6 @@ public class ExecutionConfig implements Serializable {
 
 	private static final long DEFAULT_RESTART_DELAY = 10000L;
 
-	// This field was used as a key for storing the EC in the Job Configuration
-	@Deprecated
-	public static final String CONFIG_KEY = "runtime.config";
-
 	// --------------------------------------------------------------------------------------------
 
 	/** Defines how data exchange happens - batch or pipelined */

http://git-wip-us.apache.org/repos/asf/flink/blob/b0acd979/flink-core/src/main/java/org/apache/flink/api/common/functions/RuntimeContext.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/functions/RuntimeContext.java b/flink-core/src/main/java/org/apache/flink/api/common/functions/RuntimeContext.java
index 9a04b24..72e1a4d 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/functions/RuntimeContext.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/functions/RuntimeContext.java
@@ -64,6 +64,7 @@ public interface RuntimeContext {
 	 * 
 	 * @return The metric group for this parallel subtask.
 	 */
+	@PublicEvolving
 	MetricGroup getMetricGroup();
 
 	/**

http://git-wip-us.apache.org/repos/asf/flink/blob/b0acd979/flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java b/flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java
index 6b3974b..b67a11d 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java
@@ -355,6 +355,12 @@ public final class ConfigConstants {
 	@Deprecated
 	public static final String YARN_APPLICATION_MASTER_ENV_PREFIX = "yarn.application-master.env.";
 
+	// these default values are not used anymore, but remain here until Flink 2.0
+	@Deprecated
+	public static final String DEFAULT_YARN_APPLICATION_MASTER_PORT = "deprecated";
+	@Deprecated
+	public static final int DEFAULT_YARN_MIN_HEAP_CUTOFF = -1;
+
 	/**
 	 * Similar to the {@see YARN_APPLICATION_MASTER_ENV_PREFIX}, this configuration prefix allows
 	 * setting custom environment variables.

http://git-wip-us.apache.org/repos/asf/flink/blob/b0acd979/flink-core/src/main/java/org/apache/flink/types/DoubleValue.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/types/DoubleValue.java b/flink-core/src/main/java/org/apache/flink/types/DoubleValue.java
index 7dba25b..67c2b45 100644
--- a/flink-core/src/main/java/org/apache/flink/types/DoubleValue.java
+++ b/flink-core/src/main/java/org/apache/flink/types/DoubleValue.java
@@ -30,7 +30,7 @@ import org.apache.flink.core.memory.DataOutputView;
  * type {@code double}.
  */
 @Public
-public class DoubleValue implements Comparable<DoubleValue>, ResettableValue<DoubleValue>, CopyableValue<DoubleValue> {
+public class DoubleValue implements Comparable<DoubleValue>, ResettableValue<DoubleValue>, CopyableValue<DoubleValue>, Key<DoubleValue> {
 	private static final long serialVersionUID = 1L;
 
 	private double value;

http://git-wip-us.apache.org/repos/asf/flink/blob/b0acd979/flink-core/src/main/java/org/apache/flink/types/FloatValue.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/types/FloatValue.java b/flink-core/src/main/java/org/apache/flink/types/FloatValue.java
index e3e49ce..19fa22d 100644
--- a/flink-core/src/main/java/org/apache/flink/types/FloatValue.java
+++ b/flink-core/src/main/java/org/apache/flink/types/FloatValue.java
@@ -30,7 +30,7 @@ import org.apache.flink.core.memory.DataOutputView;
  * type {@code float}.
  */
 @Public
-public class FloatValue implements Comparable<FloatValue>, ResettableValue<FloatValue>, CopyableValue<FloatValue> {
+public class FloatValue implements Comparable<FloatValue>, ResettableValue<FloatValue>, CopyableValue<FloatValue>, Key<FloatValue> {
 	private static final long serialVersionUID = 1L;
 
 	private float value;

http://git-wip-us.apache.org/repos/asf/flink/blob/b0acd979/flink-core/src/main/java/org/apache/flink/types/Key.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/types/Key.java b/flink-core/src/main/java/org/apache/flink/types/Key.java
new file mode 100644
index 0000000..37a730c
--- /dev/null
+++ b/flink-core/src/main/java/org/apache/flink/types/Key.java
@@ -0,0 +1,59 @@
+/*
+ * 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.types;
+
+import org.apache.flink.annotation.PublicEvolving;
+
+/**
+ * This interface has to be implemented by all data types that act as key. Keys are used to establish
+ * relationships between values. A key must always be {@link java.lang.Comparable} to other keys of
+ * the same type. In addition, keys must implement a correct {@link java.lang.Object#hashCode()} method
+ * and {@link java.lang.Object#equals(Object)} method to ensure that grouping on keys works properly.
+ * <p>
+ * This interface extends {@link org.apache.flink.types.Value} and requires to implement
+ * the serialization of its value.
+ *
+ * @see org.apache.flink.types.Value
+ * @see org.apache.flink.core.io.IOReadableWritable
+ * @see java.lang.Comparable
+ *
+ * @deprecated The Key type is a relict of a deprecated and removed API and will be removed
+ *             in future (2.0) versions as well.
+ */
+@Deprecated
+@PublicEvolving
+public interface Key<T> extends Value, Comparable<T> {
+
+	/**
+	 * All keys must override the hash-code function to generate proper deterministic hash codes,
+	 * based on their contents.
+	 *
+	 * @return The hash code of the key
+	 */
+	public int hashCode();
+
+	/**
+	 * Compares the object on equality with another object.
+	 *
+	 * @param other The other object to compare against.
+	 *
+	 * @return True, iff this object is identical to the other object, false otherwise.
+	 */
+	public boolean equals(Object other);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flink/blob/b0acd979/flink-core/src/main/java/org/apache/flink/types/NormalizableKey.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/types/NormalizableKey.java b/flink-core/src/main/java/org/apache/flink/types/NormalizableKey.java
index e040599..b697e18 100644
--- a/flink-core/src/main/java/org/apache/flink/types/NormalizableKey.java
+++ b/flink-core/src/main/java/org/apache/flink/types/NormalizableKey.java
@@ -36,7 +36,7 @@ import org.apache.flink.core.memory.MemorySegment;
  * key length.
  */
 @Public
-public interface NormalizableKey<T> extends Comparable<T> {
+public interface NormalizableKey<T> extends Comparable<T>, Key<T> {
 
 	/**
 	 * Gets the maximal length of normalized keys that the data type would produce to determine

http://git-wip-us.apache.org/repos/asf/flink/blob/b0acd979/flink-streaming-scala/pom.xml
----------------------------------------------------------------------
diff --git a/flink-streaming-scala/pom.xml b/flink-streaming-scala/pom.xml
index 90922ce..78d5fd3 100644
--- a/flink-streaming-scala/pom.xml
+++ b/flink-streaming-scala/pom.xml
@@ -221,7 +221,6 @@ under the License.
 			<plugin>
 				<groupId>com.github.siom79.japicmp</groupId>
 				<artifactId>japicmp-maven-plugin</artifactId>
-				<version>0.7.0</version>
 				<configuration>
 					<parameter>
 						<excludes>

http://git-wip-us.apache.org/repos/asf/flink/blob/b0acd979/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 082159e..4a3ae67 100644
--- a/pom.xml
+++ b/pom.xml
@@ -744,7 +744,6 @@ under the License.
 
 	<build>
 		<plugins>
-
 			<plugin>
 				<groupId>com.github.siom79.japicmp</groupId>
 				<artifactId>japicmp-maven-plugin</artifactId>