Skip to content

Commit

Permalink
[FLINK-3129] Fix breaking changes in flink-core
Browse files Browse the repository at this point in the history
  • Loading branch information
rmetzger committed May 27, 2016
1 parent 6c07936 commit b0acd97
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 9 deletions.
20 changes: 20 additions & 0 deletions flink-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public interface RuntimeContext {
*
* @return The metric group for this parallel subtask.
*/
@PublicEvolving
MetricGroup getMetricGroup();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* 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;
Expand Down
59 changes: 59 additions & 0 deletions flink-core/src/main/java/org/apache/flink/types/Key.java
Original file line number Diff line number Diff line change
@@ -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:https://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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* 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
Expand Down
1 change: 0 additions & 1 deletion flink-streaming-scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,6 @@ under the License.

<build>
<plugins>

<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
Expand Down

0 comments on commit b0acd97

Please sign in to comment.