diff --git a/flink-core/pom.xml b/flink-core/pom.xml
index adc9a9bd98b13..ba1050ca4268b 100644
--- a/flink-core/pom.xml
+++ b/flink-core/pom.xml
@@ -40,12 +40,6 @@ under the License.
flink-annotations
${project.version}
-
-
- org.apache.flink
- ${shading-artifact.name}
- ${project.version}
-
commons-collections
@@ -56,20 +50,61 @@ under the License.
com.esotericsoftware.kryo
kryo
+
+
+
+ org.apache.avro
+ avro
+
+
+
+ org.xerial.snappy
+ snappy-java
+
+
+ org.apache.commons
+ commons-compress
+
+
+
+
+
+
+ org.apache.flink
+ ${shading-artifact.name}
+ ${project.version}
+
+
com.google.guava
guava
${guava.version}
+
+
commons-io
commons-io
test
+
+ joda-time
+ joda-time
+ 2.5
+ test
+
+
+
+ org.joda
+ joda-convert
+ 1.7
+ test
+
+
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/Keys.java b/flink-core/src/main/java/org/apache/flink/api/common/operators/Keys.java
similarity index 81%
rename from flink-java/src/main/java/org/apache/flink/api/java/operators/Keys.java
rename to flink-core/src/main/java/org/apache/flink/api/common/operators/Keys.java
index 5992f0bcc562a..6d681de9a33c0 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/Keys.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/operators/Keys.java
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package org.apache.flink.api.java.operators;
+package org.apache.flink.api.common.operators;
import java.util.ArrayList;
import java.util.List;
@@ -24,22 +24,12 @@
import com.google.common.base.Joiner;
import org.apache.flink.api.common.InvalidProgramException;
-import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.functions.Partitioner;
-import org.apache.flink.api.common.operators.Operator;
-import org.apache.flink.api.common.operators.UnaryOperatorInformation;
-import org.apache.flink.api.common.operators.base.MapOperatorBase;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.common.typeutils.CompositeType;
import org.apache.flink.api.common.typeutils.CompositeType.FlatFieldDescriptor;
import org.apache.flink.api.java.functions.KeySelector;
-import org.apache.flink.api.java.operators.translation.KeyExtractingMapper;
-import org.apache.flink.api.java.operators.translation.KeyRemovingMapper;
-import org.apache.flink.api.java.operators.translation.TwoKeyExtractingMapper;
-import org.apache.flink.api.java.tuple.Tuple2;
-import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.api.java.typeutils.GenericTypeInfo;
-import org.apache.flink.api.java.typeutils.TupleTypeInfo;
import org.apache.flink.api.java.typeutils.TypeExtractor;
import com.google.common.base.Preconditions;
@@ -177,87 +167,6 @@ public void validateCustomPartitioner(Partitioner partitioner, TypeInform
}
}
- @SuppressWarnings("unchecked")
- public static Operator> appendKeyExtractor(
- Operator input,
- SelectorFunctionKeys key)
- {
-
- TypeInformation inputType = key.getInputType();
- TypeInformation> typeInfoWithKey = createTypeWithKey(key);
- KeyExtractingMapper extractor = new KeyExtractingMapper(key.getKeyExtractor());
-
- MapOperatorBase, MapFunction>> mapper =
- new MapOperatorBase, MapFunction>>(
- extractor,
- new UnaryOperatorInformation(inputType, typeInfoWithKey),
- "Key Extractor"
- );
-
- mapper.setInput(input);
- mapper.setParallelism(input.getParallelism());
-
- return mapper;
- }
-
- @SuppressWarnings("unchecked")
- public static Operator> appendKeyExtractor(
- Operator input,
- SelectorFunctionKeys key1,
- SelectorFunctionKeys key2)
- {
-
- TypeInformation inputType = key1.getInputType();
- TypeInformation> typeInfoWithKey = createTypeWithKey(key1, key2);
- TwoKeyExtractingMapper extractor =
- new TwoKeyExtractingMapper<>(key1.getKeyExtractor(), key2.getKeyExtractor());
-
- MapOperatorBase, MapFunction>> mapper =
- new MapOperatorBase, MapFunction>>(
- extractor,
- new UnaryOperatorInformation<>(inputType, typeInfoWithKey),
- "Key Extractor"
- );
-
- mapper.setInput(input);
- mapper.setParallelism(input.getParallelism());
-
- return mapper;
- }
-
- public static org.apache.flink.api.common.operators.SingleInputOperator, T, ?> appendKeyRemover(
- Operator> inputWithKey,
- SelectorFunctionKeys key)
- {
-
- TypeInformation inputType = key.getInputType();
- TypeInformation> typeInfoWithKey = createTypeWithKey(key);
-
- MapOperatorBase, T, MapFunction, T>> mapper =
- new MapOperatorBase, T, MapFunction, T>>(
- new KeyRemovingMapper(),
- new UnaryOperatorInformation<>(typeInfoWithKey, inputType),
- "Key Remover"
- );
- mapper.setInput(inputWithKey);
- mapper.setParallelism(inputWithKey.getParallelism());
-
- return mapper;
- }
-
- public static TypeInformation> createTypeWithKey(
- SelectorFunctionKeys key)
- {
- return new TupleTypeInfo<>(key.getKeyType(), key.getInputType());
- }
-
- public static TypeInformation> createTypeWithKey(
- SelectorFunctionKeys key1,
- SelectorFunctionKeys key2)
- {
- return new TupleTypeInfo<>(key1.getKeyType(), key2.getKeyType(), key1.getInputType());
- }
-
@Override
public String toString() {
return "Key function (Type: " + keyType + ")";
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/functions/KeySelector.java b/flink-core/src/main/java/org/apache/flink/api/java/functions/KeySelector.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/functions/KeySelector.java
rename to flink-core/src/main/java/org/apache/flink/api/java/functions/KeySelector.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/AvroTypeInfo.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/AvroTypeInfo.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/AvroTypeInfo.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/AvroTypeInfo.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/EitherTypeInfo.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/EitherTypeInfo.java
similarity index 98%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/EitherTypeInfo.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/EitherTypeInfo.java
index ec7be972268a9..74d850b03c316 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/EitherTypeInfo.java
+++ b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/EitherTypeInfo.java
@@ -22,6 +22,7 @@
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.common.typeutils.TypeSerializer;
import org.apache.flink.api.java.typeutils.runtime.EitherSerializer;
+import org.apache.flink.types.Either;
/**
* A {@link TypeInformation} for the {@link Either} type of the Java API.
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/EnumTypeInfo.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/EnumTypeInfo.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/EnumTypeInfo.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/EnumTypeInfo.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/GenericTypeInfo.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/GenericTypeInfo.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/GenericTypeInfo.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/GenericTypeInfo.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/InputTypeConfigurable.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/InputTypeConfigurable.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/InputTypeConfigurable.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/InputTypeConfigurable.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/MissingTypeInfo.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/MissingTypeInfo.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/MissingTypeInfo.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/MissingTypeInfo.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/ObjectArrayTypeInfo.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/ObjectArrayTypeInfo.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/ObjectArrayTypeInfo.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/ObjectArrayTypeInfo.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/PojoField.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/PojoField.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/PojoField.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/PojoField.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/PojoTypeInfo.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/PojoTypeInfo.java
similarity index 99%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/PojoTypeInfo.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/PojoTypeInfo.java
index f7e4e42e44492..cc0d2396234d4 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/PojoTypeInfo.java
+++ b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/PojoTypeInfo.java
@@ -28,7 +28,9 @@
import java.util.regex.Pattern;
import com.google.common.base.Preconditions;
+
import org.apache.flink.api.common.ExecutionConfig;
+import org.apache.flink.api.common.operators.Keys.ExpressionKeys;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.common.typeutils.CompositeType;
import org.apache.flink.api.common.typeutils.TypeComparator;
@@ -36,7 +38,6 @@
import org.apache.flink.api.java.typeutils.runtime.AvroSerializer;
import org.apache.flink.api.java.typeutils.runtime.PojoComparator;
import org.apache.flink.api.java.typeutils.runtime.PojoSerializer;
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys;
import com.google.common.base.Joiner;
import org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/ResultTypeQueryable.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/ResultTypeQueryable.java
similarity index 97%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/ResultTypeQueryable.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/ResultTypeQueryable.java
index 22a18f196862b..5e0cbedda01b5 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/ResultTypeQueryable.java
+++ b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/ResultTypeQueryable.java
@@ -24,7 +24,7 @@
* This interface can be implemented by functions and input formats to tell the framework
* about their produced data type. This method acts as an alternative to the reflection analysis
* that is otherwise performed and is useful in situations where the produced data type may vary
- * depending on parameterization.
+ * depending on parametrization.
*/
public interface ResultTypeQueryable {
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfo.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfo.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfo.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfo.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfoBase.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfoBase.java
similarity index 98%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfoBase.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfoBase.java
index 469476f4b6836..753eb66ac12d4 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfoBase.java
+++ b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfoBase.java
@@ -24,9 +24,10 @@
import java.util.regex.Pattern;
import com.google.common.base.Preconditions;
+
+import org.apache.flink.api.common.operators.Keys.ExpressionKeys;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.common.typeutils.CompositeType;
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys;
public abstract class TupleTypeInfoBase extends CompositeType {
@@ -35,7 +36,7 @@ public abstract class TupleTypeInfoBase extends CompositeType {
private final static String REGEX_FIELD = "(f?)([0-9]+)";
private final static String REGEX_NESTED_FIELDS = "("+REGEX_FIELD+")(\\.(.+))?";
private final static String REGEX_NESTED_FIELDS_WILDCARD = REGEX_NESTED_FIELDS
- +"|\\"+ExpressionKeys.SELECT_ALL_CHAR
+ +"|\\"+ ExpressionKeys.SELECT_ALL_CHAR
+"|\\"+ExpressionKeys.SELECT_ALL_CHAR_SCALA;
private static final Pattern PATTERN_FIELD = Pattern.compile(REGEX_FIELD);
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java
similarity index 99%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java
index b8f20755f225d..d4ea24c102e16 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java
+++ b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java
@@ -30,7 +30,9 @@
import java.util.List;
import org.apache.avro.specific.SpecificRecordBase;
+
import org.apache.commons.lang3.ClassUtils;
+
import org.apache.flink.api.common.functions.CoGroupFunction;
import org.apache.flink.api.common.functions.CrossFunction;
import org.apache.flink.api.common.functions.FlatJoinFunction;
@@ -54,9 +56,12 @@
import org.apache.flink.api.java.functions.KeySelector;
import org.apache.flink.api.java.tuple.Tuple;
import org.apache.flink.api.java.tuple.Tuple0;
+import org.apache.flink.types.Either;
import org.apache.flink.types.Value;
import org.apache.flink.util.Collector;
+
import org.apache.hadoop.io.Writable;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/TypeInfoParser.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeInfoParser.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/TypeInfoParser.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeInfoParser.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/ValueTypeInfo.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/ValueTypeInfo.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/ValueTypeInfo.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/ValueTypeInfo.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/WritableTypeInfo.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/WritableTypeInfo.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/WritableTypeInfo.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/WritableTypeInfo.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/AvroSerializer.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/AvroSerializer.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/AvroSerializer.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/AvroSerializer.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/CopyableValueComparator.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/CopyableValueComparator.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/CopyableValueComparator.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/CopyableValueComparator.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/CopyableValueSerializer.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/CopyableValueSerializer.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/CopyableValueSerializer.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/CopyableValueSerializer.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataInputDecoder.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataInputDecoder.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataInputDecoder.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataInputDecoder.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataInputViewStream.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataInputViewStream.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataInputViewStream.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataInputViewStream.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataOutputEncoder.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataOutputEncoder.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataOutputEncoder.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataOutputEncoder.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataOutputViewStream.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataOutputViewStream.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataOutputViewStream.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/DataOutputViewStream.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/EitherSerializer.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/EitherSerializer.java
similarity index 96%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/EitherSerializer.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/EitherSerializer.java
index b4b95f3965d3b..7c9676bcb4b04 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/EitherSerializer.java
+++ b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/EitherSerializer.java
@@ -18,13 +18,13 @@
package org.apache.flink.api.java.typeutils.runtime;
-import static org.apache.flink.api.java.typeutils.Either.Left;
-import static org.apache.flink.api.java.typeutils.Either.Right;
+import static org.apache.flink.types.Either.Left;
+import static org.apache.flink.types.Either.Right;
import java.io.IOException;
import org.apache.flink.api.common.typeutils.TypeSerializer;
-import org.apache.flink.api.java.typeutils.Either;
+import org.apache.flink.types.Either;
import org.apache.flink.core.memory.DataInputView;
import org.apache.flink.core.memory.DataOutputView;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/GenericTypeComparator.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/GenericTypeComparator.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/GenericTypeComparator.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/GenericTypeComparator.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/KryoUtils.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/KryoUtils.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/KryoUtils.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/KryoUtils.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/NoFetchingInput.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/NoFetchingInput.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/NoFetchingInput.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/NoFetchingInput.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoComparator.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoComparator.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoComparator.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoComparator.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimeComparatorFactory.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimeComparatorFactory.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimeComparatorFactory.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimeComparatorFactory.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimePairComparatorFactory.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimePairComparatorFactory.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimePairComparatorFactory.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimePairComparatorFactory.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimeSerializerFactory.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimeSerializerFactory.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimeSerializerFactory.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimeSerializerFactory.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/Tuple0Serializer.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/Tuple0Serializer.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/Tuple0Serializer.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/Tuple0Serializer.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleComparator.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleComparator.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleComparator.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleComparator.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorBase.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorBase.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorBase.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorBase.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializer.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializer.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializer.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializer.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerBase.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerBase.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerBase.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerBase.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/ValueComparator.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/ValueComparator.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/ValueComparator.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/ValueComparator.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/ValueSerializer.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/ValueSerializer.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/ValueSerializer.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/ValueSerializer.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/WritableComparator.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/WritableComparator.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/WritableComparator.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/WritableComparator.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/WritableSerializer.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/WritableSerializer.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/WritableSerializer.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/WritableSerializer.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializer.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializer.java
similarity index 100%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializer.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializer.java
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/Serializers.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/Serializers.java
similarity index 78%
rename from flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/Serializers.java
rename to flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/Serializers.java
index 8bac729cc7ce0..009cb2413bab8 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/Serializers.java
+++ b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/Serializers.java
@@ -23,13 +23,14 @@
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import com.esotericsoftware.kryo.serializers.CollectionSerializer;
+
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericData;
import org.apache.avro.specific.SpecificRecordBase;
+
import org.apache.flink.api.common.ExecutionConfig;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.common.typeutils.CompositeType;
-import org.apache.flink.api.java.Utils;
import org.apache.flink.api.java.typeutils.GenericTypeInfo;
import org.apache.flink.api.java.typeutils.ObjectArrayTypeInfo;
import org.apache.flink.api.java.typeutils.TypeExtractor;
@@ -64,7 +65,7 @@ public static void recursivelyRegisterType(TypeInformation> typeInfo, Executio
}
else if (typeInfo instanceof CompositeType) {
List> genericTypesInComposite = new ArrayList<>();
- Utils.getContainedGenericTypes((CompositeType>)typeInfo, genericTypesInComposite);
+ getContainedGenericTypes((CompositeType>)typeInfo, genericTypesInComposite);
for (GenericTypeInfo> gt : genericTypesInComposite) {
Serializers.recursivelyRegisterType(gt.getTypeClass(), config, alreadySeen);
}
@@ -127,41 +128,38 @@ else if (fieldType instanceof Class) {
}
}
- private static void checkAndAddSerializerForTypeAvro(ExecutionConfig reg, Class> type) {
- if (GenericData.Record.class.isAssignableFrom(type)) {
- registerGenericAvro(reg);
- }
- if (SpecificRecordBase.class.isAssignableFrom(type)) {
- @SuppressWarnings("unchecked")
- Class extends SpecificRecordBase> specRecordClass = (Class extends SpecificRecordBase>) type;
- registerSpecificAvro(reg, specRecordClass);
- }
- }
-
/**
- * Register these serializers for using Avro's {@link GenericData.Record} and classes
- * implementing {@link org.apache.avro.specific.SpecificRecordBase}
+ * Returns all GenericTypeInfos contained in a composite type.
+ *
+ * @param typeInfo {@link CompositeType}
*/
- private static void registerGenericAvro(ExecutionConfig reg) {
- // Avro POJOs contain java.util.List which have GenericData.Array as their runtime type
- // because Kryo is not able to serialize them properly, we use this serializer for them
- reg.registerTypeWithKryoSerializer(GenericData.Array.class, SpecificInstanceCollectionSerializerForArrayList.class);
-
- // We register this serializer for users who want to use untyped Avro records (GenericData.Record).
- // Kryo is able to serialize everything in there, except for the Schema.
- // This serializer is very slow, but using the GenericData.Records of Kryo is in general a bad idea.
- // we add the serializer as a default serializer because Avro is using a private sub-type at runtime.
- reg.addDefaultKryoSerializer(Schema.class, AvroSchemaSerializer.class);
+ private static void getContainedGenericTypes(CompositeType> typeInfo, List> target) {
+ for (int i = 0; i < typeInfo.getArity(); i++) {
+ TypeInformation> type = typeInfo.getTypeAt(i);
+ if (type instanceof CompositeType) {
+ getContainedGenericTypes((CompositeType>) type, target);
+ } else if (type instanceof GenericTypeInfo) {
+ if (!target.contains(type)) {
+ target.add((GenericTypeInfo>) type);
+ }
+ }
+ }
}
+
+ // ------------------------------------------------------------------------
+
+ private static void checkAndAddSerializerForTypeAvro(ExecutionConfig reg, Class> type) {
+ if (GenericData.Record.class.isAssignableFrom(type) || SpecificRecordBase.class.isAssignableFrom(type)) {
+ // Avro POJOs contain java.util.List which have GenericData.Array as their runtime type
+ // because Kryo is not able to serialize them properly, we use this serializer for them
+ reg.registerTypeWithKryoSerializer(GenericData.Array.class, SpecificInstanceCollectionSerializerForArrayList.class);
- private static void registerSpecificAvro(ExecutionConfig reg, Class extends SpecificRecordBase> avroType) {
- registerGenericAvro(reg);
- // This rule only applies if users explicitly use the GenericTypeInformation for the avro types
- // usually, we are able to handle Avro POJOs with the POJO serializer.
- // (However only if the GenericData.Array type is registered!)
-
- // ClassTag tag = scala.reflect.ClassTag$.MODULE$.apply(avroType);
- // reg.registerTypeWithKryoSerializer(avroType, com.twitter.chill.avro.AvroSerializer.SpecificRecordSerializer(tag));
+ // We register this serializer for users who want to use untyped Avro records (GenericData.Record).
+ // Kryo is able to serialize everything in there, except for the Schema.
+ // This serializer is very slow, but using the GenericData.Records of Kryo is in general a bad idea.
+ // we add the serializer as a default serializer because Avro is using a private sub-type at runtime.
+ reg.addDefaultKryoSerializer(Schema.class, AvroSchemaSerializer.class);
+ }
}
// --------------------------------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/operators/ExpressionKeysTest.java b/flink-core/src/test/java/org/apache/flink/api/common/operators/ExpressionKeysTest.java
similarity index 97%
rename from flink-java/src/test/java/org/apache/flink/api/java/operators/ExpressionKeysTest.java
rename to flink-core/src/test/java/org/apache/flink/api/common/operators/ExpressionKeysTest.java
index dd8223417b45a..8e65a79b3e00b 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/operators/ExpressionKeysTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/common/operators/ExpressionKeysTest.java
@@ -15,29 +15,33 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.flink.api.java.operators;
+
+package org.apache.flink.api.common.operators;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import org.apache.commons.lang3.ArrayUtils;
+
import org.apache.flink.api.common.InvalidProgramException;
import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
import org.apache.flink.api.common.typeinfo.TypeInformation;
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys;
+import org.apache.flink.api.common.operators.Keys.ExpressionKeys;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.api.java.tuple.Tuple7;
-import org.apache.flink.api.java.type.extractor.PojoTypeExtractionTest.ComplexNestedClass;
+import org.apache.flink.api.java.typeutils.PojoTypeExtractionTest.ComplexNestedClass;
import org.apache.flink.api.java.typeutils.GenericTypeInfo;
import org.apache.flink.api.java.typeutils.TupleTypeInfo;
import org.apache.flink.api.java.typeutils.TypeExtractor;
-import org.apache.flink.api.java.operators.SelectorFunctionKeysTest.KeySelector1;
-import org.apache.flink.api.java.operators.SelectorFunctionKeysTest.KeySelector3;
+import org.apache.flink.api.common.operators.SelectorFunctionKeysTest.KeySelector1;
+import org.apache.flink.api.common.operators.SelectorFunctionKeysTest.KeySelector3;
+
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
+
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox;
@@ -474,6 +478,4 @@ public int compareTo(GenericNonKeyType o) {
return 0;
}
}
-
-
}
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/operators/SelectorFunctionKeysTest.java b/flink-core/src/test/java/org/apache/flink/api/common/operators/SelectorFunctionKeysTest.java
similarity index 94%
rename from flink-java/src/test/java/org/apache/flink/api/java/operators/SelectorFunctionKeysTest.java
rename to flink-core/src/test/java/org/apache/flink/api/common/operators/SelectorFunctionKeysTest.java
index f59af6e543ae5..ad6fefa2135ec 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/operators/SelectorFunctionKeysTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/common/operators/SelectorFunctionKeysTest.java
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package org.apache.flink.api.java.operators;
+package org.apache.flink.api.common.operators;
import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
import org.apache.flink.api.common.typeinfo.TypeInformation;
@@ -25,9 +25,10 @@
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.api.java.typeutils.TupleTypeInfo;
import org.apache.flink.api.java.typeutils.TypeExtractor;
-import org.apache.flink.api.java.operators.ExpressionKeysTest.PojoWithMultiplePojos;
-import org.apache.flink.api.java.operators.ExpressionKeysTest.Pojo1;
-import org.apache.flink.api.java.operators.ExpressionKeysTest.Pojo2;
+import org.apache.flink.api.common.operators.ExpressionKeysTest.PojoWithMultiplePojos;
+import org.apache.flink.api.common.operators.ExpressionKeysTest.Pojo1;
+import org.apache.flink.api.common.operators.ExpressionKeysTest.Pojo2;
+
import org.junit.Assert;
import org.junit.Test;
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/tuple/Tuple2Test.java b/flink-core/src/test/java/org/apache/flink/api/java/tuple/Tuple2Test.java
similarity index 99%
rename from flink-java/src/test/java/org/apache/flink/api/java/tuple/Tuple2Test.java
rename to flink-core/src/test/java/org/apache/flink/api/java/tuple/Tuple2Test.java
index 0cc5dcfb45e42..b8fe14ccb6303 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/tuple/Tuple2Test.java
+++ b/flink-core/src/test/java/org/apache/flink/api/java/tuple/Tuple2Test.java
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-
package org.apache.flink.api.java.tuple;
import org.apache.flink.types.NullFieldException;
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/CompositeTypeTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/CompositeTypeTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/CompositeTypeTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/CompositeTypeTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/EitherTypeInfoTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/EitherTypeInfoTest.java
similarity index 96%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/EitherTypeInfoTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/EitherTypeInfoTest.java
index caa3402219d57..78c10b1270891 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/EitherTypeInfoTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/EitherTypeInfoTest.java
@@ -23,7 +23,8 @@
import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
import org.apache.flink.api.java.tuple.Tuple2;
-import org.apache.flink.api.java.typeutils.Either.Right;
+import org.apache.flink.types.Either;
+import org.apache.flink.types.Either.Right;
import org.apache.flink.util.TestLogger;
import org.junit.Test;
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/EnumTypeInfoTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/EnumTypeInfoTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/EnumTypeInfoTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/EnumTypeInfoTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/GenericTypeInfoTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/GenericTypeInfoTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/GenericTypeInfoTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/GenericTypeInfoTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/MissingTypeInfoTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/MissingTypeInfoTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/MissingTypeInfoTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/MissingTypeInfoTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/ObjectArrayTypeInfoTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/ObjectArrayTypeInfoTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/ObjectArrayTypeInfoTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/ObjectArrayTypeInfoTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/type/extractor/PojoTypeExtractionTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/PojoTypeExtractionTest.java
similarity index 92%
rename from flink-java/src/test/java/org/apache/flink/api/java/type/extractor/PojoTypeExtractionTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/PojoTypeExtractionTest.java
index 96ba264475466..bc118488e9aab 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/type/extractor/PojoTypeExtractionTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/PojoTypeExtractionTest.java
@@ -15,7 +15,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.flink.api.java.type.extractor;
+
+package org.apache.flink.api.java.typeutils;
import java.util.ArrayList;
import java.util.Arrays;
@@ -28,18 +29,11 @@
import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.common.typeutils.CompositeType.FlatFieldDescriptor;
-import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.tuple.Tuple1;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.tuple.Tuple3;
-import org.apache.flink.api.java.typeutils.GenericTypeInfo;
-import org.apache.flink.api.java.typeutils.PojoField;
-import org.apache.flink.api.java.typeutils.PojoTypeInfo;
-import org.apache.flink.api.java.typeutils.TupleTypeInfo;
-import org.apache.flink.api.java.typeutils.TypeExtractor;
-import org.apache.flink.api.java.typeutils.TypeInfoParser;
import org.apache.flink.api.java.typeutils.TypeInfoParserTest.MyWritable;
-import org.apache.flink.api.java.typeutils.WritableTypeInfo;
+
import org.junit.Assert;
import org.junit.Test;
@@ -559,67 +553,7 @@ public void testPojoWithComplexHierarchy() {
}
}
}
-
-
- public static class Vertex {
-
- private K key1;
- private K key2;
- private V value;
-
- public Vertex() {}
-
- public Vertex(K key, V value) {
- this.key1 = key;
- this.key2 = key;
- this.value = value;
- }
-
- public Vertex(K key1, K key2, V value) {
- this.key1 = key1;
- this.key2 = key2;
- this.value = value;
- }
-
- public void setKey1(K key1) {
- this.key1 = key1;
- }
-
- public void setKey2(K key2) {
- this.key2 = key2;
- }
-
- public K getKey1() {
- return key1;
- }
-
- public K getKey2() {
- return key2;
- }
-
- public void setValue(V value) {
- this.value = value;
- }
-
- public V getValue() {
- return value;
- }
- }
-
- public static class VertexTyped extends Vertex{
- public VertexTyped(Long l, Double d) {
- super(l, d);
- }
- public VertexTyped() {
- }
- }
-
- @Test
- public void testGetterSetterWithVertex() {
- ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
- env.fromElements(new VertexTyped(0L, 3.0), new VertexTyped(1L, 1.0));
- }
-
+
public static class MyMapper implements MapFunction, PojoWithGenerics> {
private static final long serialVersionUID = 1L;
@@ -636,7 +570,8 @@ public void testGenericPojoTypeInference1() {
MapFunction, ?> function = new MyMapper();
TypeInformation> ti = TypeExtractor.getMapReturnTypes(function, (TypeInformation)
- TypeInfoParser.parse("org.apache.flink.api.java.type.extractor.PojoTypeExtractionTest$PojoWithGenerics"));
+ TypeInfoParser.parse("org.apache.flink.api.java.typeutils.PojoTypeExtractionTest$PojoWithGenerics"));
+
Assert.assertTrue(ti instanceof PojoTypeInfo>);
PojoTypeInfo> pti = (PojoTypeInfo>) ti;
for(int i = 0; i < pti.getArity(); i++) {
@@ -710,7 +645,8 @@ public void testGenericPojoTypeInference3() {
MapFunction, ?> function = new MyMapper3();
TypeInformation> ti = TypeExtractor.getMapReturnTypes(function, (TypeInformation)
- TypeInfoParser.parse("org.apache.flink.api.java.type.extractor.PojoTypeExtractionTest$PojoTuple"));
+ TypeInfoParser.parse("org.apache.flink.api.java.typeutils.PojoTypeExtractionTest$PojoTuple"));
+
Assert.assertTrue(ti instanceof TupleTypeInfo>);
TupleTypeInfo> tti = (TupleTypeInfo>) ti;
Assert.assertEquals(BasicTypeInfo.CHAR_TYPE_INFO, tti.getTypeAt(0));
@@ -735,7 +671,7 @@ public void testGenericPojoTypeInference4() {
MapFunction, ?> function = new MyMapper4();
TypeInformation> ti = TypeExtractor.getMapReturnTypes(function, (TypeInformation)
- TypeInfoParser.parse("org.apache.flink.api.java.type.extractor.PojoTypeExtractionTest$PojoWithParameterizedFields1>"));
+ TypeInfoParser.parse("org.apache.flink.api.java.typeutils.PojoTypeExtractionTest$PojoWithParameterizedFields1>"));
Assert.assertEquals(BasicTypeInfo.BYTE_TYPE_INFO, ti);
}
@@ -757,8 +693,8 @@ public void testGenericPojoTypeInference5() {
MapFunction, ?> function = new MyMapper5();
TypeInformation> ti = TypeExtractor.getMapReturnTypes(function, (TypeInformation)
- TypeInfoParser.parse("org.apache.flink.api.java.type.extractor.PojoTypeExtractionTest$PojoWithParameterizedFields2<"
- + "field=org.apache.flink.api.java.type.extractor.PojoTypeExtractionTest$PojoWithGenerics"
+ TypeInfoParser.parse("org.apache.flink.api.java.typeutils.PojoTypeExtractionTest$PojoWithParameterizedFields2<"
+ + "field=org.apache.flink.api.java.typeutils.PojoTypeExtractionTest$PojoWithGenerics"
+ ">"));
Assert.assertEquals(BasicTypeInfo.BYTE_TYPE_INFO, ti);
}
@@ -781,7 +717,7 @@ public void testGenericPojoTypeInference6() {
MapFunction, ?> function = new MyMapper6();
TypeInformation> ti = TypeExtractor.getMapReturnTypes(function, (TypeInformation)
- TypeInfoParser.parse("org.apache.flink.api.java.type.extractor.PojoTypeExtractionTest$PojoWithParameterizedFields3<"
+ TypeInfoParser.parse("org.apache.flink.api.java.typeutils.PojoTypeExtractionTest$PojoWithParameterizedFields3<"
+ "field=int[]"
+ ">"));
Assert.assertEquals(BasicTypeInfo.INT_TYPE_INFO, ti);
@@ -805,7 +741,7 @@ public void testGenericPojoTypeInference7() {
MapFunction, ?> function = new MyMapper7();
TypeInformation> ti = TypeExtractor.getMapReturnTypes(function, (TypeInformation)
- TypeInfoParser.parse("org.apache.flink.api.java.type.extractor.PojoTypeExtractionTest$PojoWithParameterizedFields4<"
+ TypeInfoParser.parse("org.apache.flink.api.java.typeutils.PojoTypeExtractionTest$PojoWithParameterizedFields4<"
+ "field=Tuple1[]"
+ ">"));
Assert.assertEquals(BasicTypeInfo.INT_TYPE_INFO, ti);
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/PojoTypeInfoTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/PojoTypeInfoTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/PojoTypeInfoTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/PojoTypeInfoTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/type/extractor/PojoTypeInformationTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/PojoTypeInformationTest.java
similarity index 98%
rename from flink-java/src/test/java/org/apache/flink/api/java/type/extractor/PojoTypeInformationTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/PojoTypeInformationTest.java
index 7f5ef254cd699..51e481d898e89 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/type/extractor/PojoTypeInformationTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/PojoTypeInformationTest.java
@@ -17,7 +17,7 @@
*/
-package org.apache.flink.api.java.type.extractor;
+package org.apache.flink.api.java.typeutils;
import static org.junit.Assert.assertTrue;
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/TupleTypeInfoTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/TupleTypeInfoTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/TupleTypeInfoTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/TupleTypeInfoTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/type/extractor/TypeExtractorInputFormatsTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/TypeExtractorInputFormatsTest.java
similarity index 96%
rename from flink-java/src/test/java/org/apache/flink/api/java/type/extractor/TypeExtractorInputFormatsTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/TypeExtractorInputFormatsTest.java
index bbf514886f22f..a606896d2363d 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/type/extractor/TypeExtractorInputFormatsTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/TypeExtractorInputFormatsTest.java
@@ -16,10 +16,7 @@
* limitations under the License.
*/
-package org.apache.flink.api.java.type.extractor;
-
-
-import static org.junit.Assert.*;
+package org.apache.flink.api.java.typeutils;
import java.io.IOException;
@@ -30,13 +27,13 @@
import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.tuple.Tuple3;
-import org.apache.flink.api.java.typeutils.ResultTypeQueryable;
-import org.apache.flink.api.java.typeutils.TupleTypeInfo;
-import org.apache.flink.api.java.typeutils.TypeExtractor;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.core.io.InputSplit;
+
import org.junit.Test;
+import static org.junit.Assert.*;
+
@SuppressWarnings("serial")
public class TypeExtractorInputFormatsTest {
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/type/extractor/TypeExtractorTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/TypeExtractorTest.java
similarity index 96%
rename from flink-java/src/test/java/org/apache/flink/api/java/type/extractor/TypeExtractorTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/TypeExtractorTest.java
index 57b32b123c3ef..cdafa6aae31fc 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/type/extractor/TypeExtractorTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/TypeExtractorTest.java
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package org.apache.flink.api.java.type.extractor;
+package org.apache.flink.api.java.typeutils;
import java.io.DataInput;
import java.io.DataOutput;
@@ -38,7 +38,6 @@
import org.apache.flink.api.common.typeinfo.PrimitiveArrayTypeInfo;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.common.typeutils.CompositeType.FlatFieldDescriptor;
-import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.functions.KeySelector;
import org.apache.flink.api.java.tuple.Tuple;
import org.apache.flink.api.java.tuple.Tuple0;
@@ -46,30 +45,20 @@
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.api.java.tuple.Tuple9;
-import org.apache.flink.api.java.typeutils.Either;
-import org.apache.flink.api.java.typeutils.EitherTypeInfo;
-import org.apache.flink.api.java.typeutils.EnumTypeInfo;
-import org.apache.flink.api.java.typeutils.GenericTypeInfo;
-import org.apache.flink.api.java.typeutils.MissingTypeInfo;
-import org.apache.flink.api.java.typeutils.ObjectArrayTypeInfo;
-import org.apache.flink.api.java.typeutils.PojoTypeInfo;
-import org.apache.flink.api.java.typeutils.ResultTypeQueryable;
-import org.apache.flink.api.java.typeutils.TupleTypeInfo;
-import org.apache.flink.api.java.typeutils.TypeExtractor;
-import org.apache.flink.api.java.typeutils.TypeInfoParser;
-import org.apache.flink.api.java.typeutils.ValueTypeInfo;
-import org.apache.flink.api.java.typeutils.WritableTypeInfo;
+import org.apache.flink.types.Either;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.types.DoubleValue;
import org.apache.flink.types.IntValue;
import org.apache.flink.types.StringValue;
import org.apache.flink.types.Value;
import org.apache.flink.util.Collector;
+
import org.apache.hadoop.io.Writable;
+
import org.junit.Assert;
import org.junit.Test;
-
+@SuppressWarnings("serial")
public class TypeExtractorTest {
@@ -97,7 +86,7 @@ public void reduce(Iterable values, Collector out) throws Exce
Assert.assertEquals(ti, TypeExtractor.getForClass(Boolean.class));
// use getForObject()
- Assert.assertEquals(BasicTypeInfo.BOOLEAN_TYPE_INFO, TypeExtractor.getForObject(Boolean.valueOf(true)));
+ Assert.assertEquals(BasicTypeInfo.BOOLEAN_TYPE_INFO, TypeExtractor.getForObject(true));
}
public static class MyWritable implements Writable {
@@ -356,7 +345,9 @@ public CustomType cross(CustomType first, Integer second) throws Exception {
}
};
- TypeInformation> ti = TypeExtractor.getCrossReturnTypes(function, (TypeInformation) TypeInfoParser.parse("org.apache.flink.api.java.type.extractor.TypeExtractorTest$CustomType"), (TypeInformation) TypeInfoParser.parse("Integer"));
+ TypeInformation> ti = TypeExtractor.getCrossReturnTypes(function,
+ (TypeInformation) TypeInfoParser.parse("org.apache.flink.api.java.typeutils.TypeExtractorTest$CustomType"),
+ (TypeInformation) TypeInfoParser.parse("Integer"));
Assert.assertFalse(ti.isBasicType());
Assert.assertFalse(ti.isTupleType());
@@ -408,7 +399,8 @@ public Tuple2 map(Tuple2 value) throws Excep
};
- TypeInformation> ti = TypeExtractor.getMapReturnTypes(function, (TypeInformation) TypeInfoParser.parse("Tuple2"));
+ TypeInformation> ti = TypeExtractor.getMapReturnTypes(function,
+ (TypeInformation) TypeInfoParser.parse("Tuple2"));
Assert.assertTrue(ti.isTupleType());
Assert.assertEquals(2, ti.getArity());
@@ -849,25 +841,6 @@ public String map(Object value) throws Exception {
}
}
- @SuppressWarnings({"unchecked", "rawtypes"})
- @Test
- public void testFunctionWithMissingGenericsAndReturns() {
- RichMapFunction function = new RichMapFunction() {
- private static final long serialVersionUID = 1L;
-
- @Override
- public Object map(Object value) throws Exception {
- return null;
- }
- };
-
- TypeInformation info = ExecutionEnvironment.getExecutionEnvironment()
- .fromElements("arbitrary", "data")
- .map(function).returns("String").getResultType();
-
- Assert.assertEquals(TypeInfoParser.parse("String"), info);
- }
-
@SuppressWarnings({ "rawtypes", "unchecked" })
@Test
public void testFunctionDependingOnInputAsSuperclass() {
@@ -1256,7 +1229,8 @@ public CustomArrayObject[] map(CustomArrayObject[] value) throws Exception {
}
};
- TypeInformation> ti = TypeExtractor.getMapReturnTypes(function, (TypeInformation) TypeInfoParser.parse("org.apache.flink.api.java.type.extractor.TypeExtractorTest$CustomArrayObject[]"));
+ TypeInformation> ti = TypeExtractor.getMapReturnTypes(function,
+ (TypeInformation) TypeInfoParser.parse("org.apache.flink.api.java.typeutils.TypeExtractorTest$CustomArrayObject[]"));
Assert.assertTrue(ti instanceof ObjectArrayTypeInfo, ?>);
Assert.assertEquals(CustomArrayObject.class, ((ObjectArrayTypeInfo, ?>) ti).getComponentInfo().getTypeClass());
@@ -1816,11 +1790,13 @@ public CustomType[][][] map(
return null;
}
};
- ti = TypeExtractor.getMapReturnTypes((MapFunction)function, TypeInfoParser.parse("org.apache.flink.api.java.type.extractor.TypeExtractorTest$CustomType<"
- + "myField1=String,myField2=int"
- + ">[][][]"));
+ ti = TypeExtractor.getMapReturnTypes((MapFunction)function,
+ TypeInfoParser.parse("org.apache.flink.api.java.typeutils.TypeExtractorTest$CustomType<"
+ + "myField1=String,myField2=int"
+ + ">[][][]"));
+
Assert.assertEquals("ObjectArrayTypeInfo"
+ + "PojoType"
+ ">>>", ti.toString());
// generic array
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/TypeInfoParserTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/TypeInfoParserTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/TypeInfoParserTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/TypeInfoParserTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/ValueTypeInfoTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/ValueTypeInfoTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/ValueTypeInfoTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/ValueTypeInfoTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/WritableTypeInfoTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/WritableTypeInfoTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/WritableTypeInfoTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/WritableTypeInfoTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericArraySerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericArraySerializerTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericArraySerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericArraySerializerTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericTypeComparatorTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericTypeComparatorTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericTypeComparatorTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericTypeComparatorTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericTypeSerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericTypeSerializerTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericTypeSerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericTypeSerializerTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroGenericArraySerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroGenericArraySerializerTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroGenericArraySerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroGenericArraySerializerTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroGenericTypeComparatorTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroGenericTypeComparatorTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroGenericTypeComparatorTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroGenericTypeComparatorTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroGenericTypeSerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroGenericTypeSerializerTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroGenericTypeSerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroGenericTypeSerializerTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroSerializerEmptyArrayTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroSerializerEmptyArrayTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroSerializerEmptyArrayTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/AvroSerializerEmptyArrayTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/CopyableValueComparatorTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/CopyableValueComparatorTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/CopyableValueComparatorTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/CopyableValueComparatorTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/EitherSerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/EitherSerializerTest.java
similarity index 95%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/EitherSerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/EitherSerializerTest.java
index e4672cccfea33..d636d5ecfcd40 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/EitherSerializerTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/EitherSerializerTest.java
@@ -20,15 +20,15 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
-import static org.apache.flink.api.java.typeutils.Either.Left;
-import static org.apache.flink.api.java.typeutils.Either.Right;
+import static org.apache.flink.types.Either.Left;
+import static org.apache.flink.types.Either.Right;
import org.apache.flink.api.common.ExecutionConfig;
import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
import org.apache.flink.api.common.typeutils.SerializerTestInstance;
import org.apache.flink.api.common.typeutils.TypeSerializer;
import org.apache.flink.api.java.tuple.Tuple2;
-import org.apache.flink.api.java.typeutils.Either;
+import org.apache.flink.types.Either;
import org.apache.flink.api.java.typeutils.EitherTypeInfo;
import org.apache.flink.api.java.typeutils.TupleTypeInfo;
import org.junit.Test;
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/GenericPairComparatorTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/GenericPairComparatorTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/GenericPairComparatorTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/GenericPairComparatorTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/MultidimensionalArraySerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/MultidimensionalArraySerializerTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/MultidimensionalArraySerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/MultidimensionalArraySerializerTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoComparatorTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoComparatorTest.java
similarity index 97%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoComparatorTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoComparatorTest.java
index 1baf443ef8c30..26b03c6dfeb37 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoComparatorTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoComparatorTest.java
@@ -26,7 +26,7 @@
import org.apache.flink.api.common.typeutils.CompositeType;
import org.apache.flink.api.common.typeutils.TypeComparator;
import org.apache.flink.api.common.typeutils.TypeSerializer;
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys;
+import org.apache.flink.api.common.operators.Keys.ExpressionKeys;
import org.apache.flink.api.java.typeutils.TypeExtractor;
import org.junit.Assert;
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoContainingTuple.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoContainingTuple.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoContainingTuple.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoContainingTuple.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoGenericTypeSerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoGenericTypeSerializerTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoGenericTypeSerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoGenericTypeSerializerTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerTest.java
similarity index 98%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerTest.java
index b1467b931113b..260f7e982bcd5 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerTest.java
@@ -29,8 +29,8 @@
import org.apache.flink.api.common.typeutils.TypeComparator;
import org.apache.flink.api.common.typeutils.TypeSerializer;
import org.apache.flink.api.common.typeutils.CompositeType.FlatFieldDescriptor;
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys;
-import org.apache.flink.api.java.operators.Keys.IncompatibleKeysException;
+import org.apache.flink.api.common.operators.Keys.ExpressionKeys;
+import org.apache.flink.api.common.operators.Keys.IncompatibleKeysException;
import org.apache.flink.api.java.tuple.Tuple1;
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.api.java.typeutils.PojoTypeInfo;
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSubclassComparatorTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSubclassComparatorTest.java
similarity index 97%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSubclassComparatorTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSubclassComparatorTest.java
index 3a03683a98307..40c5c8cc6d008 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSubclassComparatorTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSubclassComparatorTest.java
@@ -24,7 +24,7 @@
import org.apache.flink.api.common.typeutils.CompositeType;
import org.apache.flink.api.common.typeutils.TypeComparator;
import org.apache.flink.api.common.typeutils.TypeSerializer;
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys;
+import org.apache.flink.api.common.operators.Keys.ExpressionKeys;
import org.apache.flink.api.java.typeutils.TypeExtractor;
import org.junit.Assert;
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSubclassSerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSubclassSerializerTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSubclassSerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSubclassSerializerTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/StringArrayWritable.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/StringArrayWritable.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/StringArrayWritable.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/StringArrayWritable.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/SubclassFromInterfaceSerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/SubclassFromInterfaceSerializerTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/SubclassFromInterfaceSerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/SubclassFromInterfaceSerializerTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TestDataOutputSerializer.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TestDataOutputSerializer.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TestDataOutputSerializer.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TestDataOutputSerializer.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILD2Test.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILD2Test.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILD2Test.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILD2Test.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILD3Test.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILD3Test.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILD3Test.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILD3Test.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILDC3Test.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILDC3Test.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILDC3Test.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILDC3Test.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILDX1Test.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILDX1Test.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILDX1Test.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILDX1Test.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILDXC2Test.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILDXC2Test.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILDXC2Test.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorILDXC2Test.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorISD1Test.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorISD1Test.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorISD1Test.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorISD1Test.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorISD2Test.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorISD2Test.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorISD2Test.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorISD2Test.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorISD3Test.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorISD3Test.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorISD3Test.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorISD3Test.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorTTT1Test.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorTTT1Test.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorTTT1Test.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorTTT1Test.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorTTT2Test.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorTTT2Test.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorTTT2Test.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorTTT2Test.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorTTT3Test.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorTTT3Test.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorTTT3Test.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleComparatorTTT3Test.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerTestInstance.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerTestInstance.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerTestInstance.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerTestInstance.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueComparatorTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueComparatorTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueComparatorTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueComparatorTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueComparatorUUIDTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueComparatorUUIDTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueComparatorUUIDTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueComparatorUUIDTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueID.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueID.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueID.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueID.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueSerializerUUIDTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueSerializerUUIDTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueSerializerUUIDTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/ValueSerializerUUIDTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableComparatorTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableComparatorTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableComparatorTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableComparatorTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableComparatorUUIDTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableComparatorUUIDTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableComparatorUUIDTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableComparatorUUIDTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableID.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableID.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableID.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableID.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableSerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableSerializerTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableSerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableSerializerTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableSerializerUUIDTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableSerializerUUIDTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableSerializerUUIDTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/WritableSerializerUUIDTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoClearedBufferTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoClearedBufferTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoClearedBufferTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoClearedBufferTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericArraySerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericArraySerializerTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericArraySerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericArraySerializerTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericTypeComparatorTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericTypeComparatorTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericTypeComparatorTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericTypeComparatorTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericTypeSerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericTypeSerializerTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericTypeSerializerTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericTypeSerializerTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoWithCustomSerializersTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoWithCustomSerializersTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoWithCustomSerializersTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoWithCustomSerializersTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/SerializersTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/SerializersTest.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/SerializersTest.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/SerializersTest.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/tuple/base/TupleComparatorTestBase.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/tuple/base/TupleComparatorTestBase.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/tuple/base/TupleComparatorTestBase.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/tuple/base/TupleComparatorTestBase.java
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/tuple/base/TuplePairComparatorTestBase.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/tuple/base/TuplePairComparatorTestBase.java
similarity index 100%
rename from flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/tuple/base/TuplePairComparatorTestBase.java
rename to flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/tuple/base/TuplePairComparatorTestBase.java
diff --git a/flink-java/pom.xml b/flink-java/pom.xml
index a31e89d010836..3203d752af84e 100644
--- a/flink-java/pom.xml
+++ b/flink-java/pom.xml
@@ -40,22 +40,12 @@ under the License.
flink-core
${project.version}
+
org.apache.flink
${shading-artifact.name}
${project.version}
-
-
- org.apache.avro
- avro
-
-
-
-
- com.esotericsoftware.kryo
- kryo
-
org.ow2.asm
@@ -63,12 +53,6 @@ under the License.
${asm.version}
-
- com.twitter
- chill-java
- ${chill.version}
-
-
com.google.guava
guava
@@ -88,20 +72,6 @@ under the License.
test-jar
test
-
-
- joda-time
- joda-time
- 2.5
- test
-
-
-
- org.joda
- joda-convert
- 1.7
- test
-
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java b/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java
index 6db32c5ad5e4a..6bcdb52d8c074 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java
@@ -63,7 +63,7 @@
import org.apache.flink.api.java.operators.GroupReduceOperator;
import org.apache.flink.api.java.operators.IterativeDataSet;
import org.apache.flink.api.java.operators.JoinOperator.JoinOperatorSets;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.operators.MapOperator;
import org.apache.flink.api.java.operators.MapPartitionOperator;
import org.apache.flink.api.java.operators.PartitionOperator;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/Utils.java b/flink-java/src/main/java/org/apache/flink/api/java/Utils.java
index 2edc53339b81b..80f8199daa6ec 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/Utils.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/Utils.java
@@ -33,7 +33,6 @@
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
-import java.util.List;
import java.util.Random;
import static org.apache.flink.api.java.functions.FunctionAnnotation.SkipCodeAnalysis;
@@ -61,24 +60,6 @@ public static String getCallLocationName(int depth) {
return String.format("%s(%s:%d)", elem.getMethodName(), elem.getFileName(), elem.getLineNumber());
}
- /**
- * Returns all GenericTypeInfos contained in a composite type.
- *
- * @param typeInfo {@link CompositeType}
- */
- public static void getContainedGenericTypes(CompositeType> typeInfo, List> target) {
- for (int i = 0; i < typeInfo.getArity(); i++) {
- TypeInformation> type = typeInfo.getTypeAt(i);
- if (type instanceof CompositeType) {
- getContainedGenericTypes((CompositeType>) type, target);
- } else if (type instanceof GenericTypeInfo) {
- if (!target.contains(type)) {
- target.add((GenericTypeInfo>) type);
- }
- }
- }
- }
-
// --------------------------------------------------------------------------------------------
/**
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/functions/SemanticPropUtil.java b/flink-java/src/main/java/org/apache/flink/api/java/functions/SemanticPropUtil.java
index 761eeb31fe9ce..a75b8e0eb27f0 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/functions/SemanticPropUtil.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/functions/SemanticPropUtil.java
@@ -37,7 +37,7 @@
import org.apache.flink.api.java.functions.FunctionAnnotation.ReadFields;
import org.apache.flink.api.java.functions.FunctionAnnotation.ReadFieldsFirst;
import org.apache.flink.api.java.functions.FunctionAnnotation.ReadFieldsSecond;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.typeutils.TupleTypeInfo;
import java.lang.annotation.Annotation;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/io/SplitDataProperties.java b/flink-java/src/main/java/org/apache/flink/api/java/io/SplitDataProperties.java
index c44929fd71ce0..6763cdfc2ec69 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/io/SplitDataProperties.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/io/SplitDataProperties.java
@@ -25,7 +25,7 @@
import org.apache.flink.api.common.operators.Ordering;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.operators.DataSource;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import java.util.Arrays;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/AggregateOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/AggregateOperator.java
index 00e0d3bbdc269..6485936c9e87d 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/AggregateOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/AggregateOperator.java
@@ -25,6 +25,7 @@
import org.apache.flink.api.common.functions.GroupCombineFunction;
import org.apache.flink.api.common.functions.GroupReduceFunction;
import org.apache.flink.api.common.functions.RichGroupReduceFunction;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.Operator;
import org.apache.flink.api.common.operators.SingleInputSemanticProperties;
import org.apache.flink.api.common.operators.UnaryOperatorInformation;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/CoGroupOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/CoGroupOperator.java
index 845deb4f6fbc5..6c6b051ed277f 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/CoGroupOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/CoGroupOperator.java
@@ -30,6 +30,7 @@
import org.apache.flink.api.common.functions.Partitioner;
import org.apache.flink.api.common.operators.BinaryOperatorInformation;
import org.apache.flink.api.common.operators.DualInputSemanticProperties;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.Operator;
import org.apache.flink.api.common.operators.Order;
import org.apache.flink.api.common.operators.Ordering;
@@ -40,9 +41,9 @@
import org.apache.flink.api.java.functions.SemanticPropUtil;
import org.apache.flink.api.java.operators.DeltaIteration.SolutionSetPlaceHolder;
import org.apache.flink.api.java.functions.KeySelector;
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys;
-import org.apache.flink.api.java.operators.Keys.IncompatibleKeysException;
-import org.apache.flink.api.java.operators.Keys.SelectorFunctionKeys;
+import org.apache.flink.api.common.operators.Keys.ExpressionKeys;
+import org.apache.flink.api.common.operators.Keys.IncompatibleKeysException;
+import org.apache.flink.api.common.operators.Keys.SelectorFunctionKeys;
import org.apache.flink.api.java.operators.translation.PlanBothUnwrappingCoGroupOperator;
import org.apache.flink.api.java.operators.translation.PlanLeftUnwrappingCoGroupOperator;
import org.apache.flink.api.java.operators.translation.PlanRightUnwrappingCoGroupOperator;
@@ -297,11 +298,11 @@ private static PlanBothUnwrappingCoGroupOperator keys2 = (SelectorFunctionKeys) rawKeys2;
- final TypeInformation> typeInfoWithKey1 = SelectorFunctionKeys.createTypeWithKey(keys1);
- final TypeInformation> typeInfoWithKey2 = SelectorFunctionKeys.createTypeWithKey(keys2);
+ final TypeInformation> typeInfoWithKey1 = KeyFunctions.createTypeWithKey(keys1);
+ final TypeInformation> typeInfoWithKey2 = KeyFunctions.createTypeWithKey(keys2);
- final Operator> keyedInput1 = SelectorFunctionKeys.appendKeyExtractor(input1, keys1);
- final Operator> keyedInput2 = SelectorFunctionKeys.appendKeyExtractor(input2, keys2);
+ final Operator> keyedInput1 = KeyFunctions.appendKeyExtractor(input1, keys1);
+ final Operator> keyedInput2 = KeyFunctions.appendKeyExtractor(input2, keys2);
final PlanBothUnwrappingCoGroupOperator cogroup =
new PlanBothUnwrappingCoGroupOperator<>(function, keys1, keys2, name, outputType, typeInfoWithKey1, typeInfoWithKey2);
@@ -324,8 +325,8 @@ private static PlanRightUnwrappingCoGroupOperator keys2 = (SelectorFunctionKeys) rawKeys2;
- final TypeInformation> typeInfoWithKey2 = SelectorFunctionKeys.createTypeWithKey(keys2);
- final Operator> keyedInput2 = SelectorFunctionKeys.appendKeyExtractor(input2, keys2);
+ final TypeInformation> typeInfoWithKey2 = KeyFunctions.createTypeWithKey(keys2);
+ final Operator> keyedInput2 = KeyFunctions.appendKeyExtractor(input2, keys2);
final PlanRightUnwrappingCoGroupOperator cogroup =
new PlanRightUnwrappingCoGroupOperator<>(
@@ -355,8 +356,8 @@ private static PlanLeftUnwrappingCoGroupOperator keys1 = (SelectorFunctionKeys) rawKeys1;
- final TypeInformation> typeInfoWithKey1 = SelectorFunctionKeys.createTypeWithKey(keys1);
- final Operator> keyedInput1 = SelectorFunctionKeys.appendKeyExtractor(input1, keys1);
+ final TypeInformation> typeInfoWithKey1 = KeyFunctions.createTypeWithKey(keys1);
+ final Operator> keyedInput1 = KeyFunctions.appendKeyExtractor(input1, keys1);
final PlanLeftUnwrappingCoGroupOperator cogroup =
new PlanLeftUnwrappingCoGroupOperator<>(
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/CoGroupRawOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/CoGroupRawOperator.java
index 30639c302f084..74f54b8e65919 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/CoGroupRawOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/CoGroupRawOperator.java
@@ -21,11 +21,12 @@
import org.apache.flink.api.common.functions.CoGroupFunction;
import org.apache.flink.api.common.functions.Function;
import org.apache.flink.api.common.operators.BinaryOperatorInformation;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.Operator;
import org.apache.flink.api.common.operators.base.CoGroupRawOperatorBase;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.DataSet;
-import org.apache.flink.api.java.operators.Keys.IncompatibleKeysException;
+import org.apache.flink.api.common.operators.Keys.IncompatibleKeysException;
/**
* A {@link DataSet} that is the result of a CoGroup transformation.
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/DataSink.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/DataSink.java
index 915a05376ccf4..8745271918ca9 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/DataSink.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/DataSink.java
@@ -21,6 +21,7 @@
import org.apache.flink.api.common.InvalidProgramException;
import org.apache.flink.api.common.io.OutputFormat;
import org.apache.flink.api.common.operators.GenericDataSinkBase;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.Operator;
import org.apache.flink.api.common.operators.Order;
import org.apache.flink.api.common.operators.Ordering;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/DeltaIteration.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/DeltaIteration.java
index a302478bc25ff..7b3001f4f0173 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/DeltaIteration.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/DeltaIteration.java
@@ -23,6 +23,7 @@
import org.apache.flink.api.common.InvalidProgramException;
import org.apache.flink.api.common.aggregators.Aggregator;
import org.apache.flink.api.common.aggregators.AggregatorRegistry;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/DeltaIterationResultSet.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/DeltaIterationResultSet.java
index 6717c6d2df058..4af910879b68c 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/DeltaIterationResultSet.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/DeltaIterationResultSet.java
@@ -18,6 +18,7 @@
package org.apache.flink.api.java.operators;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/DistinctOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/DistinctOperator.java
index 5102c801de0fb..9979f59514ad0 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/DistinctOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/DistinctOperator.java
@@ -20,12 +20,13 @@
import org.apache.flink.api.common.functions.GroupCombineFunction;
import org.apache.flink.api.common.functions.GroupReduceFunction;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.Operator;
import org.apache.flink.api.common.operators.SingleInputSemanticProperties;
import org.apache.flink.api.common.operators.UnaryOperatorInformation;
import org.apache.flink.api.common.operators.base.GroupReduceOperatorBase;
import org.apache.flink.api.common.typeinfo.TypeInformation;
-import org.apache.flink.api.java.operators.Keys.SelectorFunctionKeys;
+import org.apache.flink.api.common.operators.Keys.SelectorFunctionKeys;
import org.apache.flink.api.java.operators.translation.PlanUnwrappingReduceGroupOperator;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.util.Collector;
@@ -116,8 +117,8 @@ private static PlanUnwrappingReduceGroupOperator transl
@SuppressWarnings("unchecked")
final SelectorFunctionKeys keys = (SelectorFunctionKeys) rawKeys;
- TypeInformation> typeInfoWithKey = SelectorFunctionKeys.createTypeWithKey(keys);
- Operator> keyedInput = SelectorFunctionKeys.appendKeyExtractor(input, keys);
+ TypeInformation> typeInfoWithKey = KeyFunctions.createTypeWithKey(keys);
+ Operator> keyedInput = KeyFunctions.appendKeyExtractor(input, keys);
PlanUnwrappingReduceGroupOperator reducer =
new PlanUnwrappingReduceGroupOperator<>(function, keys, name, outputType, typeInfoWithKey, true);
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/GroupCombineOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/GroupCombineOperator.java
index ef0c12f74d3b0..a43b8694514a6 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/GroupCombineOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/GroupCombineOperator.java
@@ -19,6 +19,7 @@
package org.apache.flink.api.java.operators;
import org.apache.flink.api.common.functions.GroupCombineFunction;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.Operator;
import org.apache.flink.api.common.operators.Order;
import org.apache.flink.api.common.operators.Ordering;
@@ -30,7 +31,7 @@
import org.apache.flink.api.java.functions.SemanticPropUtil;
import org.apache.flink.api.java.operators.translation.PlanUnwrappingGroupCombineOperator;
import org.apache.flink.api.java.operators.translation.PlanUnwrappingSortedGroupCombineOperator;
-import org.apache.flink.api.java.operators.Keys.SelectorFunctionKeys;
+import org.apache.flink.api.common.operators.Keys.SelectorFunctionKeys;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.tuple.Tuple3;
@@ -195,8 +196,8 @@ private static PlanUnwrappingGroupCombineOperator trans
{
final SelectorFunctionKeys keys = (SelectorFunctionKeys) rawKeys;
- TypeInformation> typeInfoWithKey = SelectorFunctionKeys.createTypeWithKey(keys);
- Operator> keyedInput = SelectorFunctionKeys.appendKeyExtractor(input, keys);
+ TypeInformation> typeInfoWithKey = KeyFunctions.createTypeWithKey(keys);
+ Operator> keyedInput = KeyFunctions.appendKeyExtractor(input, keys);
PlanUnwrappingGroupCombineOperator reducer =
new PlanUnwrappingGroupCombineOperator<>(function, keys, name, outputType, typeInfoWithKey);
@@ -217,9 +218,9 @@ private static PlanUnwrappingSortedGroupCombineOperator groupingKey = (SelectorFunctionKeys) rawGroupingKey;
final SelectorFunctionKeys sortingKey = (SelectorFunctionKeys)rawSortingKeys;
- TypeInformation> typeInfoWithKey = SelectorFunctionKeys.createTypeWithKey(groupingKey, sortingKey);
+ TypeInformation> typeInfoWithKey = KeyFunctions.createTypeWithKey(groupingKey, sortingKey);
- Operator> inputWithKey = SelectorFunctionKeys.appendKeyExtractor(input, groupingKey, sortingKey);
+ Operator> inputWithKey = KeyFunctions.appendKeyExtractor(input, groupingKey, sortingKey);
PlanUnwrappingSortedGroupCombineOperator reducer =
new PlanUnwrappingSortedGroupCombineOperator<>(function, groupingKey, sortingKey, name, outputType, typeInfoWithKey);
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/GroupReduceOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/GroupReduceOperator.java
index b1bf8444a9a35..42553a008da49 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/GroupReduceOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/GroupReduceOperator.java
@@ -20,6 +20,7 @@
import org.apache.flink.api.common.functions.GroupCombineFunction;
import org.apache.flink.api.common.functions.GroupReduceFunction;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.Operator;
import org.apache.flink.api.common.operators.Order;
import org.apache.flink.api.common.operators.Ordering;
@@ -28,7 +29,7 @@
import org.apache.flink.api.common.operators.base.GroupReduceOperatorBase;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.functions.SemanticPropUtil;
-import org.apache.flink.api.java.operators.Keys.SelectorFunctionKeys;
+import org.apache.flink.api.common.operators.Keys.SelectorFunctionKeys;
import org.apache.flink.api.java.operators.translation.PlanUnwrappingReduceGroupOperator;
import org.apache.flink.api.java.operators.translation.PlanUnwrappingSortedReduceGroupOperator;
import org.apache.flink.api.java.tuple.Tuple2;
@@ -281,9 +282,9 @@ private static PlanUnwrappingReduceGroupOperator transl
boolean combinable)
{
SelectorFunctionKeys keys = (SelectorFunctionKeys) rawKeys;
- TypeInformation> typeInfoWithKey = SelectorFunctionKeys.createTypeWithKey(keys);
+ TypeInformation> typeInfoWithKey = KeyFunctions.createTypeWithKey(keys);
- Operator> keyedInput = SelectorFunctionKeys.appendKeyExtractor(input, keys);
+ Operator> keyedInput = KeyFunctions.appendKeyExtractor(input, keys);
PlanUnwrappingReduceGroupOperator reducer =
new PlanUnwrappingReduceGroupOperator(function, keys, name, outputType, typeInfoWithKey, combinable);
@@ -305,9 +306,9 @@ private static PlanUnwrappingSortedReduceGroupOperator groupingKey = (SelectorFunctionKeys) rawGroupingKey;
final SelectorFunctionKeys sortingKey = (SelectorFunctionKeys) rawSortingKey;
- TypeInformation> typeInfoWithKey = SelectorFunctionKeys.createTypeWithKey(groupingKey,sortingKey);
+ TypeInformation> typeInfoWithKey = KeyFunctions.createTypeWithKey(groupingKey,sortingKey);
- Operator> inputWithKey = SelectorFunctionKeys.appendKeyExtractor(input, groupingKey, sortingKey);
+ Operator> inputWithKey = KeyFunctions.appendKeyExtractor(input, groupingKey, sortingKey);
PlanUnwrappingSortedReduceGroupOperator reducer =
new PlanUnwrappingSortedReduceGroupOperator<>(
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/Grouping.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/Grouping.java
index c1174582b923a..823aee4188eb7 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/Grouping.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/Grouping.java
@@ -20,6 +20,7 @@
import org.apache.flink.api.common.InvalidProgramException;
import org.apache.flink.api.common.functions.Partitioner;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.DataSet;
/**
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/JoinOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/JoinOperator.java
index 0c0b7109120a0..c02d365191cc3 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/JoinOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/JoinOperator.java
@@ -29,6 +29,7 @@
import org.apache.flink.api.common.functions.RichFlatJoinFunction;
import org.apache.flink.api.common.operators.BinaryOperatorInformation;
import org.apache.flink.api.common.operators.DualInputSemanticProperties;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.Operator;
import org.apache.flink.api.common.operators.base.JoinOperatorBase;
import org.apache.flink.api.common.operators.base.InnerJoinOperatorBase;
@@ -42,9 +43,9 @@
import org.apache.flink.api.java.functions.KeySelector;
import org.apache.flink.api.java.functions.SemanticPropUtil;
import org.apache.flink.api.java.operators.DeltaIteration.SolutionSetPlaceHolder;
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys;
-import org.apache.flink.api.java.operators.Keys.IncompatibleKeysException;
-import org.apache.flink.api.java.operators.Keys.SelectorFunctionKeys;
+import org.apache.flink.api.common.operators.Keys.ExpressionKeys;
+import org.apache.flink.api.common.operators.Keys.IncompatibleKeysException;
+import org.apache.flink.api.common.operators.Keys.SelectorFunctionKeys;
import org.apache.flink.api.java.operators.join.JoinOperatorSetsBase;
import org.apache.flink.api.java.operators.join.JoinType;
import org.apache.flink.api.java.operators.join.JoinFunctionAssigner;
@@ -394,8 +395,8 @@ public JoinOperatorBaseBuilder withWrappedInput1(
@SuppressWarnings("unchecked")
SelectorFunctionKeys keys1 = (SelectorFunctionKeys)rawKeys1;
- TypeInformation> typeInfoWithKey1 = SelectorFunctionKeys.createTypeWithKey(keys1);
- Operator> keyMapper1 = SelectorFunctionKeys.appendKeyExtractor(input1, keys1);
+ TypeInformation> typeInfoWithKey1 = KeyFunctions.createTypeWithKey(keys1);
+ Operator> keyMapper1 = KeyFunctions.appendKeyExtractor(input1, keys1);
return this.withInput1(keyMapper1, typeInfoWithKey1, rawKeys1);
}
@@ -406,8 +407,8 @@ public JoinOperatorBaseBuilder withWrappedInput2(
@SuppressWarnings("unchecked")
SelectorFunctionKeys keys2 = (SelectorFunctionKeys)rawKeys2;
- TypeInformation> typeInfoWithKey2 = SelectorFunctionKeys.createTypeWithKey(keys2);
- Operator> keyMapper2 = SelectorFunctionKeys.appendKeyExtractor(input2, keys2);
+ TypeInformation> typeInfoWithKey2 = KeyFunctions.createTypeWithKey(keys2);
+ Operator> keyMapper2 = KeyFunctions.appendKeyExtractor(input2, keys2);
return withInput2(keyMapper2, typeInfoWithKey2, rawKeys2);
}
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/KeyFunctions.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/KeyFunctions.java
new file mode 100644
index 0000000000000..49d598afd9bf5
--- /dev/null
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/KeyFunctions.java
@@ -0,0 +1,119 @@
+/*
+ * 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.api.java.operators;
+
+import org.apache.flink.api.common.functions.MapFunction;
+import org.apache.flink.api.common.operators.UnaryOperatorInformation;
+import org.apache.flink.api.common.operators.base.MapOperatorBase;
+import org.apache.flink.api.common.typeinfo.TypeInformation;
+import org.apache.flink.api.common.operators.Keys.SelectorFunctionKeys;
+import org.apache.flink.api.java.operators.translation.KeyExtractingMapper;
+import org.apache.flink.api.java.operators.translation.KeyRemovingMapper;
+import org.apache.flink.api.java.operators.translation.TwoKeyExtractingMapper;
+import org.apache.flink.api.java.tuple.Tuple2;
+import org.apache.flink.api.java.tuple.Tuple3;
+import org.apache.flink.api.java.typeutils.TupleTypeInfo;
+
+/**
+ * This class holds static utilities to append functions that extract and
+ * prune keys.
+ */
+public class KeyFunctions {
+
+ @SuppressWarnings("unchecked")
+ public static org.apache.flink.api.common.operators.Operator> appendKeyExtractor(
+ org.apache.flink.api.common.operators.Operator input,
+ SelectorFunctionKeys key)
+ {
+
+ TypeInformation inputType = key.getInputType();
+ TypeInformation> typeInfoWithKey = createTypeWithKey(key);
+ KeyExtractingMapper extractor = new KeyExtractingMapper(key.getKeyExtractor());
+
+ MapOperatorBase, MapFunction>> mapper =
+ new MapOperatorBase, MapFunction>>(
+ extractor,
+ new UnaryOperatorInformation(inputType, typeInfoWithKey),
+ "Key Extractor"
+ );
+
+ mapper.setInput(input);
+ mapper.setParallelism(input.getParallelism());
+
+ return mapper;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static org.apache.flink.api.common.operators.Operator> appendKeyExtractor(
+ org.apache.flink.api.common.operators.Operator input,
+ SelectorFunctionKeys key1,
+ SelectorFunctionKeys key2)
+ {
+
+ TypeInformation inputType = key1.getInputType();
+ TypeInformation> typeInfoWithKey = createTypeWithKey(key1, key2);
+ TwoKeyExtractingMapper extractor =
+ new TwoKeyExtractingMapper<>(key1.getKeyExtractor(), key2.getKeyExtractor());
+
+ MapOperatorBase, MapFunction>> mapper =
+ new MapOperatorBase, MapFunction>>(
+ extractor,
+ new UnaryOperatorInformation<>(inputType, typeInfoWithKey),
+ "Key Extractor"
+ );
+
+ mapper.setInput(input);
+ mapper.setParallelism(input.getParallelism());
+
+ return mapper;
+ }
+
+ public static org.apache.flink.api.common.operators.SingleInputOperator, T, ?> appendKeyRemover(
+ org.apache.flink.api.common.operators.Operator> inputWithKey,
+ SelectorFunctionKeys key)
+ {
+
+ TypeInformation inputType = key.getInputType();
+ TypeInformation> typeInfoWithKey = createTypeWithKey(key);
+
+ MapOperatorBase, T, MapFunction, T>> mapper =
+ new MapOperatorBase, T, MapFunction, T>>(
+ new KeyRemovingMapper(),
+ new UnaryOperatorInformation<>(typeInfoWithKey, inputType),
+ "Key Remover"
+ );
+ mapper.setInput(inputWithKey);
+ mapper.setParallelism(inputWithKey.getParallelism());
+
+ return mapper;
+ }
+
+ public static TypeInformation> createTypeWithKey(
+ SelectorFunctionKeys key)
+ {
+ return new TupleTypeInfo<>(key.getKeyType(), key.getInputType());
+ }
+
+ public static TypeInformation> createTypeWithKey(
+ SelectorFunctionKeys key1,
+ SelectorFunctionKeys key2)
+ {
+ return new TupleTypeInfo<>(key1.getKeyType(), key2.getKeyType(), key1.getInputType());
+ }
+}
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/PartitionOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/PartitionOperator.java
index 1384ca2f15790..96931b0bdfb0b 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/PartitionOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/PartitionOperator.java
@@ -21,13 +21,14 @@
import com.google.common.base.Preconditions;
import org.apache.flink.api.common.functions.Partitioner;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.Operator;
import org.apache.flink.api.common.operators.UnaryOperatorInformation;
import org.apache.flink.api.common.operators.base.PartitionOperatorBase;
import org.apache.flink.api.common.operators.base.PartitionOperatorBase.PartitionMethod;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.DataSet;
-import org.apache.flink.api.java.operators.Keys.SelectorFunctionKeys;
+import org.apache.flink.api.common.operators.Keys.SelectorFunctionKeys;
import org.apache.flink.api.java.tuple.Tuple2;
/**
@@ -150,9 +151,9 @@ else if (pKeys instanceof Keys.SelectorFunctionKeys) {
Partitioner> customPartitioner)
{
final SelectorFunctionKeys keys = (SelectorFunctionKeys) rawKeys;
- TypeInformation> typeInfoWithKey = SelectorFunctionKeys.createTypeWithKey(keys);
+ TypeInformation> typeInfoWithKey = KeyFunctions.createTypeWithKey(keys);
- Operator> keyedInput = SelectorFunctionKeys.appendKeyExtractor(input, keys);
+ Operator> keyedInput = KeyFunctions.appendKeyExtractor(input, keys);
PartitionOperatorBase> keyedPartitionedInput =
new PartitionOperatorBase<>(new UnaryOperatorInformation<>(typeInfoWithKey, typeInfoWithKey), pMethod, new int[]{0}, name);
@@ -160,7 +161,7 @@ else if (pKeys instanceof Keys.SelectorFunctionKeys) {
keyedPartitionedInput.setCustomPartitioner(customPartitioner);
keyedPartitionedInput.setParallelism(partitionDop);
- return SelectorFunctionKeys.appendKeyRemover(keyedPartitionedInput, keys);
+ return KeyFunctions.appendKeyRemover(keyedPartitionedInput, keys);
}
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/ReduceOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/ReduceOperator.java
index 6f8877f1fae9f..a22a262ea82bb 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/ReduceOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/ReduceOperator.java
@@ -19,13 +19,14 @@
package org.apache.flink.api.java.operators;
import org.apache.flink.api.common.functions.ReduceFunction;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.Operator;
import org.apache.flink.api.common.operators.SingleInputSemanticProperties;
import org.apache.flink.api.common.operators.UnaryOperatorInformation;
import org.apache.flink.api.common.operators.base.ReduceOperatorBase;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.functions.SemanticPropUtil;
-import org.apache.flink.api.java.operators.Keys.SelectorFunctionKeys;
+import org.apache.flink.api.common.operators.Keys.SelectorFunctionKeys;
import org.apache.flink.api.java.operators.translation.PlanUnwrappingReduceOperator;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.DataSet;
@@ -161,13 +162,13 @@ else if (grouper.getKeys() instanceof Keys.ExpressionKeys) {
@SuppressWarnings("unchecked")
final SelectorFunctionKeys keys = (SelectorFunctionKeys) rawKeys;
- TypeInformation> typeInfoWithKey = SelectorFunctionKeys.createTypeWithKey(keys);
- Operator> keyedInput = SelectorFunctionKeys.appendKeyExtractor(input, keys);
+ TypeInformation> typeInfoWithKey = KeyFunctions.createTypeWithKey(keys);
+ Operator> keyedInput = KeyFunctions.appendKeyExtractor(input, keys);
PlanUnwrappingReduceOperator reducer = new PlanUnwrappingReduceOperator<>(function, keys, name, inputType, typeInfoWithKey);
reducer.setInput(keyedInput);
reducer.setParallelism(parallelism);
- return SelectorFunctionKeys.appendKeyRemover(reducer, keys);
+ return KeyFunctions.appendKeyRemover(reducer, keys);
}
}
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/SortPartitionOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/SortPartitionOperator.java
index d65bc685218f4..c8a8684d6df62 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/SortPartitionOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/SortPartitionOperator.java
@@ -19,6 +19,7 @@
package org.apache.flink.api.java.operators;
import org.apache.flink.api.common.InvalidProgramException;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.Operator;
import org.apache.flink.api.common.operators.Order;
import org.apache.flink.api.common.operators.Ordering;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/SortedGrouping.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/SortedGrouping.java
index 07d0b9a824cee..2453f1b667790 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/SortedGrouping.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/SortedGrouping.java
@@ -19,6 +19,7 @@
package org.apache.flink.api.java.operators;
import org.apache.flink.api.common.functions.GroupCombineFunction;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.Ordering;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.Utils;
@@ -31,7 +32,7 @@
import org.apache.flink.api.common.functions.Partitioner;
import org.apache.flink.api.common.operators.Order;
import org.apache.flink.api.java.DataSet;
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys;
+import org.apache.flink.api.common.operators.Keys.ExpressionKeys;
import org.apache.flink.api.java.typeutils.TypeExtractor;
import com.google.common.base.Preconditions;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/UdfOperatorUtils.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/UdfOperatorUtils.java
index c55d91994c527..6144975c11004 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/UdfOperatorUtils.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/UdfOperatorUtils.java
@@ -22,6 +22,7 @@
import org.apache.flink.api.common.functions.Function;
import org.apache.flink.api.common.functions.InvalidTypesException;
import org.apache.flink.api.common.operators.DualInputSemanticProperties;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.SingleInputSemanticProperties;
import org.apache.flink.api.java.functions.FunctionAnnotation;
import org.apache.flink.api.java.sca.CodeAnalyzerException;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/UnsortedGrouping.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/UnsortedGrouping.java
index 5b0a36805a484..4e6f6ffd81e83 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/UnsortedGrouping.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/UnsortedGrouping.java
@@ -23,6 +23,7 @@
import org.apache.flink.api.common.functions.GroupReduceFunction;
import org.apache.flink.api.common.functions.Partitioner;
import org.apache.flink.api.common.functions.ReduceFunction;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.common.operators.Order;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.DataSet;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/join/JoinOperatorSetsBase.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/join/JoinOperatorSetsBase.java
index e14e06d8ff540..734456cdc6303 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/join/JoinOperatorSetsBase.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/join/JoinOperatorSetsBase.java
@@ -28,7 +28,7 @@
import org.apache.flink.api.java.functions.KeySelector;
import org.apache.flink.api.java.operators.JoinOperator.DefaultJoin;
import org.apache.flink.api.java.operators.JoinOperator.EquiJoin;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.tuple.Tuple;
import org.apache.flink.api.java.typeutils.TypeExtractor;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanBothUnwrappingCoGroupOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanBothUnwrappingCoGroupOperator.java
index fb74d1eadd52b..f620e11da98e4 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanBothUnwrappingCoGroupOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanBothUnwrappingCoGroupOperator.java
@@ -22,7 +22,7 @@
import org.apache.flink.api.common.operators.BinaryOperatorInformation;
import org.apache.flink.api.common.operators.base.CoGroupOperatorBase;
import org.apache.flink.api.common.typeinfo.TypeInformation;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.util.Collector;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanLeftUnwrappingCoGroupOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanLeftUnwrappingCoGroupOperator.java
index 2c6273296deb2..2307c0ce3bec9 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanLeftUnwrappingCoGroupOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanLeftUnwrappingCoGroupOperator.java
@@ -22,7 +22,7 @@
import org.apache.flink.api.common.operators.BinaryOperatorInformation;
import org.apache.flink.api.common.operators.base.CoGroupOperatorBase;
import org.apache.flink.api.common.typeinfo.TypeInformation;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.util.Collector;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanRightUnwrappingCoGroupOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanRightUnwrappingCoGroupOperator.java
index 56f34cc15461f..30e28ebf6fee9 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanRightUnwrappingCoGroupOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanRightUnwrappingCoGroupOperator.java
@@ -22,7 +22,7 @@
import org.apache.flink.api.common.operators.BinaryOperatorInformation;
import org.apache.flink.api.common.operators.base.CoGroupOperatorBase;
import org.apache.flink.api.common.typeinfo.TypeInformation;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.util.Collector;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingGroupCombineOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingGroupCombineOperator.java
index c8e40ceb53d26..95b58408d379b 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingGroupCombineOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingGroupCombineOperator.java
@@ -22,7 +22,7 @@
import org.apache.flink.api.common.operators.UnaryOperatorInformation;
import org.apache.flink.api.common.operators.base.GroupCombineOperatorBase;
import org.apache.flink.api.common.typeinfo.TypeInformation;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.util.Collector;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingReduceGroupOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingReduceGroupOperator.java
index 72b79a44789bf..21f15d4970a58 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingReduceGroupOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingReduceGroupOperator.java
@@ -23,7 +23,7 @@
import org.apache.flink.api.common.operators.UnaryOperatorInformation;
import org.apache.flink.api.common.operators.base.GroupReduceOperatorBase;
import org.apache.flink.api.common.typeinfo.TypeInformation;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.util.Collector;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingReduceOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingReduceOperator.java
index 2aa8d5463b7b5..e85bb79758cff 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingReduceOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingReduceOperator.java
@@ -22,7 +22,7 @@
import org.apache.flink.api.common.operators.UnaryOperatorInformation;
import org.apache.flink.api.common.operators.base.ReduceOperatorBase;
import org.apache.flink.api.common.typeinfo.TypeInformation;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.tuple.Tuple2;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingSortedGroupCombineOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingSortedGroupCombineOperator.java
index e52a5c42bbc1a..46773fa5f614e 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingSortedGroupCombineOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingSortedGroupCombineOperator.java
@@ -22,7 +22,7 @@
import org.apache.flink.api.common.operators.UnaryOperatorInformation;
import org.apache.flink.api.common.operators.base.GroupCombineOperatorBase;
import org.apache.flink.api.common.typeinfo.TypeInformation;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.util.Collector;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingSortedReduceGroupOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingSortedReduceGroupOperator.java
index 278d706659ceb..f0e8055bd8f2e 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingSortedReduceGroupOperator.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanUnwrappingSortedReduceGroupOperator.java
@@ -23,7 +23,7 @@
import org.apache.flink.api.common.operators.UnaryOperatorInformation;
import org.apache.flink.api.common.operators.base.GroupReduceOperatorBase;
import org.apache.flink.api.common.typeinfo.TypeInformation;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.util.Collector;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzer.java b/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzer.java
index 1f4b44a2f830a..93cba33f631b3 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzer.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzer.java
@@ -32,8 +32,8 @@
import org.apache.flink.api.common.operators.SingleInputSemanticProperties;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.functions.SemanticPropUtil;
-import org.apache.flink.api.java.operators.Keys;
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys;
+import org.apache.flink.api.common.operators.Keys;
+import org.apache.flink.api.common.operators.Keys.ExpressionKeys;
import org.apache.flink.api.java.sca.TaggedValue.Input;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.MethodNode;
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/Either.java b/flink-java/src/main/java/org/apache/flink/api/java/typeutils/Either.java
deleted file mode 100644
index 83828318dd94a..0000000000000
--- a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/Either.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * 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.api.java.typeutils;
-
-/**
- * This type represents a value of one two possible types, Left or Right (a
- * disjoint union), inspired by Scala's Either type.
- *
- * @param
- * the type of Left
- * @param
- * the type of Right
- */
-public abstract class Either {
-
- /**
- * Create a Left value of Either
- */
- public static Either Left(L value) {
- return new Left(value);
- }
-
- /**
- * Create a Right value of Either
- */
- public static Either Right(R value) {
- return new Right(value);
- }
-
- /**
- * Retrieve the Left value of Either.
- *
- * @return the Left value
- * @throws IllegalStateException
- * if called on a Right
- */
- public abstract L left() throws IllegalStateException;
-
- /**
- * Retrieve the Right value of Either.
- *
- * @return the Right value
- * @throws IllegalStateException
- * if called on a Left
- */
- public abstract R right() throws IllegalStateException;
-
- /**
- *
- * @return true if this is a Left value, false if this is a Right value
- */
- public final boolean isLeft() {
- return getClass() == Left.class;
- }
-
- /**
- *
- * @return true if this is a Right value, false if this is a Left value
- */
- public final boolean isRight() {
- return getClass() == Right.class;
- }
-
- /**
- * A left value of {@link Either}
- *
- * @param
- * the type of Left
- * @param
- * the type of Right
- */
- public static class Left extends Either {
- private final L value;
-
- public Left(L value) {
- this.value = java.util.Objects.requireNonNull(value);
- }
-
- @Override
- public L left() {
- return value;
- }
-
- @Override
- public R right() {
- throw new IllegalStateException("Cannot retrieve Right value on a Left");
- }
-
- @Override
- public boolean equals(Object object) {
- if (object instanceof Left, ?>) {
- final Left, ?> other = (Left, ?>) object;
- return value.equals(other.value);
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return value.hashCode();
- }
-
- @Override
- public String toString() {
- return "Left(" + value.toString() + ")";
- }
-
- /**
- * Creates a left value of {@link Either}
- *
- */
- public static Left of(L left) {
- return new Left(left);
- }
- }
-
- /**
- * A right value of {@link Either}
- *
- * @param
- * the type of Left
- * @param
- * the type of Right
- */
- public static class Right extends Either {
- private final R value;
-
- public Right(R value) {
- this.value = java.util.Objects.requireNonNull(value);
- }
-
- @Override
- public L left() {
- throw new IllegalStateException("Cannot retrieve Left value on a Right");
- }
-
- @Override
- public R right() {
- return value;
- }
-
- @Override
- public boolean equals(Object object) {
- if (object instanceof Right, ?>) {
- final Right, ?> other = (Right, ?>) object;
- return value.equals(other.value);
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return value.hashCode();
- }
-
- @Override
- public String toString() {
- return "Right(" + value.toString() + ")";
- }
-
- /**
- * Creates a right value of {@link Either}
- *
- */
- public static Right of(R right) {
- return new Right(right);
- }
- }
-}
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/TypeExtractionTest.java b/flink-java/src/test/java/org/apache/flink/api/java/TypeExtractionTest.java
new file mode 100644
index 0000000000000..fb20d7808b20c
--- /dev/null
+++ b/flink-java/src/test/java/org/apache/flink/api/java/TypeExtractionTest.java
@@ -0,0 +1,117 @@
+/*
+ * 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.api.java;
+
+import org.apache.flink.api.common.functions.RichMapFunction;
+import org.apache.flink.api.common.typeinfo.TypeInformation;
+import org.apache.flink.api.java.typeutils.TypeInfoParser;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests concerning type extraction by ExecutionEnvironment methods.
+ */
+@SuppressWarnings("serial")
+public class TypeExtractionTest {
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Test
+ public void testFunctionWithMissingGenericsAndReturns() {
+
+ RichMapFunction function = new RichMapFunction() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public Object map(Object value) throws Exception {
+ return null;
+ }
+ };
+
+ TypeInformation> info = ExecutionEnvironment.getExecutionEnvironment()
+ .fromElements("arbitrary", "data")
+ .map(function).returns("String").getResultType();
+
+ assertEquals(TypeInfoParser.parse("String"), info);
+ }
+
+ @Test
+ public void testGetterSetterWithVertex() {
+ ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
+ env.fromElements(new VertexTyped(0L, 3.0), new VertexTyped(1L, 1.0));
+ }
+
+ // ------------------------------------------------------------------------
+ // Test types
+ // ------------------------------------------------------------------------
+
+ public static class Vertex {
+
+ private K key1;
+ private K key2;
+ private V value;
+
+ public Vertex() {}
+
+ public Vertex(K key, V value) {
+ this.key1 = key;
+ this.key2 = key;
+ this.value = value;
+ }
+
+ public Vertex(K key1, K key2, V value) {
+ this.key1 = key1;
+ this.key2 = key2;
+ this.value = value;
+ }
+
+ public void setKey1(K key1) {
+ this.key1 = key1;
+ }
+
+ public void setKey2(K key2) {
+ this.key2 = key2;
+ }
+
+ public K getKey1() {
+ return key1;
+ }
+
+ public K getKey2() {
+ return key2;
+ }
+
+ public void setValue(V value) {
+ this.value = value;
+ }
+
+ public V getValue() {
+ return value;
+ }
+ }
+
+ public static class VertexTyped extends Vertex{
+ public VertexTyped(Long l, Double d) {
+ super(l, d);
+ }
+ public VertexTyped() {
+ }
+ }
+}
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/operators/NamesTest.java b/flink-java/src/test/java/org/apache/flink/api/java/operators/NamesTest.java
index 5c2c7e9afc839..09a705c38d16f 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/operators/NamesTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/operators/NamesTest.java
@@ -48,7 +48,7 @@ public class NamesTest implements Serializable {
public void testDefaultName() {
ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
- DataSet strs = env.fromCollection(Arrays.asList( new String[] {"a", "b"}));
+ DataSet strs = env.fromCollection(Arrays.asList("a", "b"));
// WARNING: The test will fail if this line is being moved down in the file (the line-number is hard-coded)
@@ -68,7 +68,7 @@ public boolean filter(String value) throws Exception {
public void testGivenName() {
ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
- DataSet strs = env.fromCollection(Arrays.asList( new String[] {"a", "b"}));
+ DataSet strs = env.fromCollection(Arrays.asList("a", "b"));
strs.filter(new FilterFunction() {
private static final long serialVersionUID = 1L;
@Override
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerTest.java b/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerTest.java
index 8d8f801638ea6..a1ccfe4794686 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerTest.java
@@ -35,7 +35,7 @@
import org.apache.flink.api.java.functions.FunctionAnnotation.ForwardedFieldsFirst;
import org.apache.flink.api.java.functions.FunctionAnnotation.ForwardedFieldsSecond;
import org.apache.flink.api.java.functions.SemanticPropUtil;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.tuple.Tuple1;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.tuple.Tuple3;
diff --git a/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/PythonPlanBinder.java b/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/PythonPlanBinder.java
index 1534ebf10b23c..0479c0be76097 100644
--- a/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/PythonPlanBinder.java
+++ b/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/PythonPlanBinder.java
@@ -29,7 +29,7 @@
import org.apache.flink.api.java.operators.CoGroupRawOperator;
import org.apache.flink.api.java.operators.CrossOperator.DefaultCross;
import org.apache.flink.api.java.operators.Grouping;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.operators.SortedGrouping;
import org.apache.flink.api.java.operators.UdfOperator;
import org.apache.flink.api.java.operators.UnsortedGrouping;
diff --git a/flink-libraries/flink-table/src/main/scala/org/apache/flink/api/java/table/JavaBatchTranslator.scala b/flink-libraries/flink-table/src/main/scala/org/apache/flink/api/java/table/JavaBatchTranslator.scala
index d25fa9d851f0d..22be45aab1980 100644
--- a/flink-libraries/flink-table/src/main/scala/org/apache/flink/api/java/table/JavaBatchTranslator.scala
+++ b/flink-libraries/flink-table/src/main/scala/org/apache/flink/api/java/table/JavaBatchTranslator.scala
@@ -20,13 +20,14 @@ package org.apache.flink.api.java.table
import java.lang.reflect.Modifier
+import org.apache.flink.api.common.operators.Keys
import org.apache.flink.api.common.operators.base.JoinOperatorBase.JoinHint
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.flink.api.common.typeutils.CompositeType
import org.apache.flink.api.java.aggregation.AggregationFunction
import org.apache.flink.api.java.operators.JoinOperator.EquiJoin
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys
-import org.apache.flink.api.java.operators.{GroupReduceOperator, Keys, MapOperator, UnsortedGrouping}
+import Keys.ExpressionKeys
+import org.apache.flink.api.java.operators.{GroupReduceOperator, MapOperator, UnsortedGrouping}
import org.apache.flink.api.java.{DataSet => JavaDataSet}
import org.apache.flink.api.table.expressions.analysis.ExtractEquiJoinFields
import org.apache.flink.api.table.plan._
diff --git a/flink-scala/src/main/java/org/apache/flink/api/scala/operators/ScalaAggregateOperator.java b/flink-scala/src/main/java/org/apache/flink/api/scala/operators/ScalaAggregateOperator.java
index a79c8431c50ea..1e0a2b3450d1f 100644
--- a/flink-scala/src/main/java/org/apache/flink/api/scala/operators/ScalaAggregateOperator.java
+++ b/flink-scala/src/main/java/org/apache/flink/api/scala/operators/ScalaAggregateOperator.java
@@ -34,7 +34,7 @@
import org.apache.flink.api.java.aggregation.AggregationFunctionFactory;
import org.apache.flink.api.java.aggregation.Aggregations;
import org.apache.flink.api.java.operators.Grouping;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.operators.SingleInputOperator;
import org.apache.flink.api.java.typeutils.TupleTypeInfoBase;
import org.apache.flink.api.java.typeutils.runtime.TupleSerializerBase;
diff --git a/flink-scala/src/main/scala/org/apache/flink/api/scala/CoGroupDataSet.scala b/flink-scala/src/main/scala/org/apache/flink/api/scala/CoGroupDataSet.scala
index 3eb6472be9ae2..a6cce43f84fab 100644
--- a/flink-scala/src/main/scala/org/apache/flink/api/scala/CoGroupDataSet.scala
+++ b/flink-scala/src/main/scala/org/apache/flink/api/scala/CoGroupDataSet.scala
@@ -21,10 +21,10 @@ package org.apache.flink.api.scala
import org.apache.commons.lang3.tuple.{ImmutablePair, Pair}
import org.apache.flink.api.common.InvalidProgramException
import org.apache.flink.api.common.functions.{CoGroupFunction, Partitioner, RichCoGroupFunction}
-import org.apache.flink.api.common.operators.Order
+import org.apache.flink.api.common.operators.{Keys, Order}
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.flink.api.common.typeutils.CompositeType
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys
+import Keys.ExpressionKeys
import org.apache.flink.api.java.operators._
import org.apache.flink.util.Collector
diff --git a/flink-scala/src/main/scala/org/apache/flink/api/scala/DataSet.scala b/flink-scala/src/main/scala/org/apache/flink/api/scala/DataSet.scala
index 35f0faf267a5e..151e6b30b6923 100644
--- a/flink-scala/src/main/scala/org/apache/flink/api/scala/DataSet.scala
+++ b/flink-scala/src/main/scala/org/apache/flink/api/scala/DataSet.scala
@@ -22,7 +22,7 @@ import org.apache.flink.api.common.accumulators.SerializedListAccumulator
import org.apache.flink.api.common.aggregators.Aggregator
import org.apache.flink.api.common.functions._
import org.apache.flink.api.common.io.{FileOutputFormat, OutputFormat}
-import org.apache.flink.api.common.operators.Order
+import org.apache.flink.api.common.operators.{Keys, Order}
import org.apache.flink.api.common.operators.base.JoinOperatorBase.JoinHint
import org.apache.flink.api.common.operators.base.CrossOperatorBase.CrossHint
import org.apache.flink.api.common.operators.base.PartitionOperatorBase.PartitionMethod
@@ -31,7 +31,7 @@ import org.apache.flink.api.java.Utils.CountHelper
import org.apache.flink.api.java.aggregation.Aggregations
import org.apache.flink.api.java.functions.{FirstReducer, KeySelector}
import org.apache.flink.api.java.io.{PrintingOutputFormat, TextOutputFormat}
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys
+import Keys.ExpressionKeys
import org.apache.flink.api.java.operators._
import org.apache.flink.api.java.operators.join.JoinType
import org.apache.flink.api.java.{DataSet => JavaDataSet, Utils}
@@ -93,6 +93,7 @@ class DataSet[T: ClassTag](set: JavaDataSet[T]) {
/**
* Returns the execution environment associated with the current DataSet.
+ *
* @return associated execution environment
*/
def getExecutionEnvironment: ExecutionEnvironment =
@@ -515,7 +516,6 @@ class DataSet[T: ClassTag](set: JavaDataSet[T]) {
* Convenience method to get the count (number of elements) of a DataSet
*
* @return A long integer that represents the number of elements in the set
- *
* @see org.apache.flink.api.java.Utils.CountHelper
*/
@throws(classOf[Exception])
@@ -531,7 +531,6 @@ class DataSet[T: ClassTag](set: JavaDataSet[T]) {
* As DataSet can contain a lot of data, this method should be used with caution.
*
* @return A Seq containing the elements of the DataSet
- *
* @see org.apache.flink.api.java.Utils.CollectHelper
*/
@throws(classOf[Exception])
@@ -1369,7 +1368,7 @@ class DataSet[T: ClassTag](set: JavaDataSet[T]) {
/**
* Range-partitions a DataSet on the specified fields.
*
- '''important:''' This operation requires an extra pass over the DataSet to compute the range
+ *'''important:''' This operation requires an extra pass over the DataSet to compute the range
* boundaries and shuffles the whole DataSet over the network.
* This can take significant amount of time.
*/
@@ -1385,7 +1384,7 @@ class DataSet[T: ClassTag](set: JavaDataSet[T]) {
/**
* Range-partitions a DataSet using the specified key selector function.
*
- '''important:''' This operation requires an extra pass over the DataSet to compute the range
+ *'''important:''' This operation requires an extra pass over the DataSet to compute the range
* boundaries and shuffles the whole DataSet over the network.
* This can take significant amount of time.
*/
@@ -1516,6 +1515,7 @@ class DataSet[T: ClassTag](set: JavaDataSet[T]) {
/**
* Writes `this` DataSet to the specified location. This uses [[AnyRef.toString]] on
* each element.
+ *
* @see org.apache.flink.api.java.DataSet#writeAsText(String)
*/
def writeAsText(
@@ -1532,6 +1532,7 @@ class DataSet[T: ClassTag](set: JavaDataSet[T]) {
* Writes `this` DataSet to the specified location as CSV file(s).
*
* This only works on Tuple DataSets. For individual tuple fields [[AnyRef.toString]] is used.
+ *
* @see org.apache.flink.api.java.DataSet#writeAsText(String)
*/
def writeAsCsv(
@@ -1623,8 +1624,8 @@ class DataSet[T: ClassTag](set: JavaDataSet[T]) {
* *
* Writes a DataSet to the standard output stream (stdout) with a sink identifier prefixed.
* This uses [[AnyRef.toString]] on each element.
- * @param sinkIdentifier The string to prefix the output with.
- *
+ *
+ * @param sinkIdentifier The string to prefix the output with.
* @deprecated Use [[printOnTaskManager(String)]] instead.
*/
@Deprecated
@@ -1636,8 +1637,8 @@ class DataSet[T: ClassTag](set: JavaDataSet[T]) {
/**
* Writes a DataSet to the standard error stream (stderr) with a sink identifier prefixed.
* This uses [[AnyRef.toString]] on each element.
- * @param sinkIdentifier The string to prefix the output with.
- *
+ *
+ * @param sinkIdentifier The string to prefix the output with.
* @deprecated Use [[printOnTaskManager(String)]] instead.
*/
@Deprecated
diff --git a/flink-scala/src/main/scala/org/apache/flink/api/scala/GroupedDataSet.scala b/flink-scala/src/main/scala/org/apache/flink/api/scala/GroupedDataSet.scala
index 7d5419b64ec44..bb8287a909f90 100644
--- a/flink-scala/src/main/scala/org/apache/flink/api/scala/GroupedDataSet.scala
+++ b/flink-scala/src/main/scala/org/apache/flink/api/scala/GroupedDataSet.scala
@@ -19,11 +19,11 @@ package org.apache.flink.api.scala
import org.apache.flink.api.common.InvalidProgramException
import org.apache.flink.api.common.functions.{GroupCombineFunction, GroupReduceFunction, Partitioner, ReduceFunction}
-import org.apache.flink.api.common.operators.Order
+import org.apache.flink.api.common.operators.{Keys, Order}
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.flink.api.java.aggregation.Aggregations
import org.apache.flink.api.java.functions.{FirstReducer, KeySelector}
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys
+import Keys.ExpressionKeys
import org.apache.flink.api.java.operators._
import org.apache.flink.api.scala.operators.ScalaAggregateOperator
import org.apache.flink.util.Collector
diff --git a/flink-scala/src/main/scala/org/apache/flink/api/scala/UnfinishedCoGroupOperation.scala b/flink-scala/src/main/scala/org/apache/flink/api/scala/UnfinishedCoGroupOperation.scala
index 91f8c85e01e6d..ace0790dab88b 100644
--- a/flink-scala/src/main/scala/org/apache/flink/api/scala/UnfinishedCoGroupOperation.scala
+++ b/flink-scala/src/main/scala/org/apache/flink/api/scala/UnfinishedCoGroupOperation.scala
@@ -19,6 +19,7 @@
package org.apache.flink.api.scala
import org.apache.flink.api.common.functions.CoGroupFunction
+import org.apache.flink.api.common.operators.Keys
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.flink.api.java.operators._
import org.apache.flink.api.java.typeutils.ObjectArrayTypeInfo
@@ -36,6 +37,7 @@ import scala.reflect.ClassTag
* val right = ...
* val coGroupResult = left.coGroup(right).where(...).isEqualTo(...)
* }}}
+ *
* @tparam L The type of the left input of the coGroup.
* @tparam R The type of the right input of the coGroup.
*/
diff --git a/flink-scala/src/main/scala/org/apache/flink/api/scala/joinDataSet.scala b/flink-scala/src/main/scala/org/apache/flink/api/scala/joinDataSet.scala
index 49b270134049c..71f2bfbd4ebe8 100644
--- a/flink-scala/src/main/scala/org/apache/flink/api/scala/joinDataSet.scala
+++ b/flink-scala/src/main/scala/org/apache/flink/api/scala/joinDataSet.scala
@@ -18,6 +18,7 @@
package org.apache.flink.api.scala
import org.apache.flink.api.common.functions.{FlatJoinFunction, JoinFunction, Partitioner, RichFlatJoinFunction}
+import org.apache.flink.api.common.operators.Keys
import org.apache.flink.api.common.operators.base.JoinOperatorBase.JoinHint
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.flink.api.java.operators.JoinOperator.DefaultJoin.WrappingFlatJoinFunction
@@ -256,6 +257,7 @@ private[flink] abstract class UnfinishedJoinOperationBase[L, R, O <: JoinFunctio
* val right = ...
* val joinResult = left.join(right).where(...).equalTo(...)
* }}}
+ *
* @tparam L The type of the left input of the join.
* @tparam R The type of the right input of the join.
*/
@@ -287,6 +289,7 @@ class UnfinishedJoinOperation[L, R](
* (first, second) => ...
* }
* }}}
+ *
* @tparam L The type of the left input of the join.
* @tparam R The type of the right input of the join.
*/
diff --git a/flink-scala/src/main/scala/org/apache/flink/api/scala/typeutils/CaseClassTypeInfo.scala b/flink-scala/src/main/scala/org/apache/flink/api/scala/typeutils/CaseClassTypeInfo.scala
index 5db7a91a60379..e8bc3a4929bd0 100644
--- a/flink-scala/src/main/scala/org/apache/flink/api/scala/typeutils/CaseClassTypeInfo.scala
+++ b/flink-scala/src/main/scala/org/apache/flink/api/scala/typeutils/CaseClassTypeInfo.scala
@@ -22,11 +22,12 @@ import java.util
import java.util.regex.{Pattern, Matcher}
import org.apache.flink.api.common.ExecutionConfig
+import org.apache.flink.api.common.operators.Keys
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.flink.api.common.typeutils.CompositeType.{TypeComparatorBuilder,
InvalidFieldReferenceException, FlatFieldDescriptor}
import org.apache.flink.api.common.typeutils._
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys
+import Keys.ExpressionKeys
import org.apache.flink.api.java.typeutils.TupleTypeInfoBase
import scala.collection.JavaConverters._
diff --git a/flink-scala/src/main/scala/org/apache/flink/api/scala/unfinishedKeyPairOperation.scala b/flink-scala/src/main/scala/org/apache/flink/api/scala/unfinishedKeyPairOperation.scala
index 08d0242417718..ddb45a4b499c2 100644
--- a/flink-scala/src/main/scala/org/apache/flink/api/scala/unfinishedKeyPairOperation.scala
+++ b/flink-scala/src/main/scala/org/apache/flink/api/scala/unfinishedKeyPairOperation.scala
@@ -19,10 +19,10 @@
package org.apache.flink.api.scala
import org.apache.flink.api.common.InvalidProgramException
+import org.apache.flink.api.common.operators.Keys
import org.apache.flink.api.java.functions.KeySelector
-import org.apache.flink.api.java.operators.Keys
-import org.apache.flink.api.java.operators.Keys.ExpressionKeys
+import Keys.ExpressionKeys
import org.apache.flink.api.common.typeinfo.TypeInformation
/**
diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java
index 254af195d51e4..f4b6e7f198662 100644
--- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java
+++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java
@@ -37,7 +37,7 @@
import org.apache.flink.api.java.functions.KeySelector;
import org.apache.flink.api.java.io.CsvOutputFormat;
import org.apache.flink.api.java.io.TextOutputFormat;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.tuple.Tuple;
import org.apache.flink.api.java.typeutils.InputTypeConfigurable;
import org.apache.flink.api.java.typeutils.TypeExtractor;
diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java b/flink-streaming-java/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java
index afbd8ab0a10ee..cf40a3b421389 100644
--- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java
+++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java
@@ -29,7 +29,7 @@
import org.apache.flink.api.common.typeutils.CompositeType;
import org.apache.flink.api.common.typeutils.TypeComparator;
import org.apache.flink.api.java.functions.KeySelector;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.tuple.Tuple;
import org.apache.flink.api.java.typeutils.ResultTypeQueryable;
import org.apache.flink.api.java.typeutils.TupleTypeInfo;
diff --git a/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/AggregationFunctionTest.java b/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/AggregationFunctionTest.java
index dd8dec95b5a21..d0617d084077c 100644
--- a/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/AggregationFunctionTest.java
+++ b/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/AggregationFunctionTest.java
@@ -29,7 +29,7 @@
import org.apache.flink.api.common.functions.ReduceFunction;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.functions.KeySelector;
-import org.apache.flink.api.java.operators.Keys;
+import org.apache.flink.api.common.operators.Keys;
import org.apache.flink.api.java.tuple.Tuple;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.tuple.Tuple3;
diff --git a/flink-tests/src/test/scala/org/apache/flink/api/scala/operators/CoGroupOperatorTest.scala b/flink-tests/src/test/scala/org/apache/flink/api/scala/operators/CoGroupOperatorTest.scala
index 46059a6c10b24..ab5ebf58948f5 100644
--- a/flink-tests/src/test/scala/org/apache/flink/api/scala/operators/CoGroupOperatorTest.scala
+++ b/flink-tests/src/test/scala/org/apache/flink/api/scala/operators/CoGroupOperatorTest.scala
@@ -20,7 +20,8 @@ package org.apache.flink.api.scala.operators
import java.util
import org.apache.flink.api.common.InvalidProgramException
-import org.apache.flink.api.java.operators.Keys.IncompatibleKeysException
+import org.apache.flink.api.common.operators.Keys
+import Keys.IncompatibleKeysException
import org.junit.Assert
import org.junit.Test
import org.apache.flink.api.scala._
diff --git a/flink-tests/src/test/scala/org/apache/flink/api/scala/operators/GroupCombineITCase.scala b/flink-tests/src/test/scala/org/apache/flink/api/scala/operators/GroupCombineITCase.scala
index 576ecdfc0655e..2dabb567c1f83 100644
--- a/flink-tests/src/test/scala/org/apache/flink/api/scala/operators/GroupCombineITCase.scala
+++ b/flink-tests/src/test/scala/org/apache/flink/api/scala/operators/GroupCombineITCase.scala
@@ -19,9 +19,9 @@ package org.apache.flink.api.scala.operators
import org.apache.flink.api.common.operators.Order
import org.apache.flink.api.java.io.DiscardingOutputFormat
-import org.apache.flink.api.scala.{ExecutionEnvironment, _}
+import org.apache.flink.api.scala._
import org.apache.flink.api.scala.util.CollectionDataSets
-import org.apache.flink.test.javaApiOperators.GroupCombineITCase
+import org.apache.flink.test.javaApiOperators.GroupCombineITCase.ScalaGroupCombineFunctionExample
import org.apache.flink.test.util.MultipleProgramsTestBase.TestExecutionMode
import org.apache.flink.test.util.MultipleProgramsTestBase
import org.apache.flink.util.Collector
@@ -43,7 +43,7 @@ class GroupCombineITCase(mode: TestExecutionMode) extends MultipleProgramsTestBa
.map(str => Tuple1(str))
// all methods on DataSet
- ds.combineGroup(new GroupCombineITCase.ScalaGroupCombineFunctionExample())
+ ds.combineGroup(new ScalaGroupCombineFunctionExample())
.output(new DiscardingOutputFormat[Tuple1[String]])
ds.combineGroup((in, out: Collector[Tuple1[String]]) => in.toSet foreach (out.collect))
@@ -51,7 +51,7 @@ class GroupCombineITCase(mode: TestExecutionMode) extends MultipleProgramsTestBa
// all methods on UnsortedGrouping
ds.groupBy(0)
- .combineGroup(new GroupCombineITCase.ScalaGroupCombineFunctionExample())
+ .combineGroup(new ScalaGroupCombineFunctionExample())
.output(new DiscardingOutputFormat[Tuple1[String]])
ds.groupBy(0)
@@ -60,7 +60,7 @@ class GroupCombineITCase(mode: TestExecutionMode) extends MultipleProgramsTestBa
// all methods on SortedGrouping
ds.groupBy(0).sortGroup(0, Order.ASCENDING)
- .combineGroup(new GroupCombineITCase.ScalaGroupCombineFunctionExample())
+ .combineGroup(new ScalaGroupCombineFunctionExample())
.output(new DiscardingOutputFormat[Tuple1[String]])
ds.groupBy(0).sortGroup(0, Order.ASCENDING)
diff --git a/flink-tests/src/test/scala/org/apache/flink/api/scala/operators/JoinOperatorTest.scala b/flink-tests/src/test/scala/org/apache/flink/api/scala/operators/JoinOperatorTest.scala
index 0d9ea9e1f3d39..81a7d7e574f6e 100644
--- a/flink-tests/src/test/scala/org/apache/flink/api/scala/operators/JoinOperatorTest.scala
+++ b/flink-tests/src/test/scala/org/apache/flink/api/scala/operators/JoinOperatorTest.scala
@@ -20,7 +20,8 @@ package org.apache.flink.api.scala.operators
import java.util
import org.apache.flink.api.common.InvalidProgramException
-import org.apache.flink.api.java.operators.Keys.IncompatibleKeysException
+import org.apache.flink.api.common.operators.Keys
+import Keys.IncompatibleKeysException
import org.apache.flink.api.scala._
import org.apache.flink.api.scala.util.CollectionDataSets.CustomType
import org.junit.{Assert, Test}
diff --git a/flink-tests/src/test/scala/org/apache/flink/api/scala/types/TypeInformationGenTest.scala b/flink-tests/src/test/scala/org/apache/flink/api/scala/types/TypeInformationGenTest.scala
index 70276cb52dd8d..46495d0974029 100644
--- a/flink-tests/src/test/scala/org/apache/flink/api/scala/types/TypeInformationGenTest.scala
+++ b/flink-tests/src/test/scala/org/apache/flink/api/scala/types/TypeInformationGenTest.scala
@@ -19,7 +19,7 @@ package org.apache.flink.api.scala.types
import java.io.{DataInput, DataOutput}
-import org.apache.flink.api.java.`type`.extractor.TypeExtractorTest.CustomTuple
+import org.apache.flink.api.java.typeutils.TypeExtractorTest.CustomTuple
import org.apache.flink.api.java.io.CollectionInputFormat
import org.apache.hadoop.io.Writable
import org.junit.{Assert, Test}
@@ -602,7 +602,7 @@ class TypeInformationGenTest {
// This checks the condition in checkCollection. If this fails with IllegalArgumentException,
// then things like "env.fromElements((),(),())" won't work.
import scala.collection.JavaConversions._
- CollectionInputFormat.checkCollection(Seq((),(),()), (new UnitTypeInfo).getTypeClass)
+ CollectionInputFormat.checkCollection(Seq((),(),()), (new UnitTypeInfo).getTypeClass())
}
}