You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2015/03/20 15:49:48 UTC
[2/2] flink git commit: [FLINK-1760] [maven] Added Scala version
profiles to support building with Scala 2.11
[FLINK-1760] [maven] Added Scala version profiles to support building with Scala 2.11
Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/2cd5e93d
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/2cd5e93d
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/2cd5e93d
Branch: refs/heads/master
Commit: 2cd5e93daa9dc7b1e024ec7c1f1fc665f953510a
Parents: 684ec7e
Author: Alexander Alexandrov <al...@gmail.com>
Authored: Fri Feb 27 22:53:54 2015 +0100
Committer: Stephan Ewen <se...@apache.org>
Committed: Fri Mar 20 15:49:01 2015 +0100
----------------------------------------------------------------------
flink-clients/pom.xml | 2 +-
flink-core/pom.xml | 2 +-
flink-java/pom.xml | 4 +-
.../main/resources/archetype-resources/pom.xml | 18 +++----
.../main/resources/archetype-resources/pom.xml | 18 +++----
flink-runtime/pom.xml | 12 ++---
flink-scala/pom.xml | 25 ++++++---
.../flink/api/scala/codegen/TreeGen.scala | 4 +-
.../flink/api/scala/codegen/TypeAnalyzer.scala | 1 +
flink-staging/flink-expressions/pom.xml | 25 ++++++---
.../codegen/ExpressionCodeGenerator.scala | 55 +++++++++++---------
flink-staging/flink-ml/pom.xml | 2 +-
.../flink-streaming-connectors/pom.xml | 27 ++++------
.../kafka/api/simple/KafkaTopicUtils.java | 2 +-
.../scala/examples/windowing/StockPrices.scala | 2 +-
.../flink-streaming-scala/pom.xml | 6 ---
flink-tests/pom.xml | 4 +-
.../flink/api/scala/io/CsvInputFormatTest.scala | 4 +-
flink-yarn/pom.xml | 6 +--
pom.xml | 43 +++++++++++----
20 files changed, 152 insertions(+), 110 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-clients/pom.xml
----------------------------------------------------------------------
diff --git a/flink-clients/pom.xml b/flink-clients/pom.xml
index 6b6d19d..05d17b7 100644
--- a/flink-clients/pom.xml
+++ b/flink-clients/pom.xml
@@ -106,7 +106,7 @@ under the License.
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.10</artifactId>
+ <artifactId>akka-testkit_${scala.binary.version}</artifactId>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-core/pom.xml
----------------------------------------------------------------------
diff --git a/flink-core/pom.xml b/flink-core/pom.xml
index 294a4fe..5b1c2fa 100644
--- a/flink-core/pom.xml
+++ b/flink-core/pom.xml
@@ -54,7 +54,7 @@ under the License.
<dependency>
<groupId>com.twitter</groupId>
- <artifactId>chill_2.10</artifactId>
+ <artifactId>chill_${scala.binary.version}</artifactId>
<version>${chill.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-java/pom.xml
----------------------------------------------------------------------
diff --git a/flink-java/pom.xml b/flink-java/pom.xml
index 34fcdd2..6196e82 100644
--- a/flink-java/pom.xml
+++ b/flink-java/pom.xml
@@ -66,13 +66,13 @@ under the License.
<dependency>
<groupId>com.twitter</groupId>
- <artifactId>chill_2.10</artifactId>
+ <artifactId>chill_${scala.binary.version}</artifactId>
<version>${chill.version}</version>
</dependency>
<dependency>
<groupId>com.twitter</groupId>
- <artifactId>chill-avro_2.10</artifactId>
+ <artifactId>chill-avro_${scala.binary.version}</artifactId>
<version>${chill.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/pom.xml b/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/pom.xml
index bf44058..e40bd9c 100644
--- a/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/pom.xml
+++ b/flink-quickstart/flink-quickstart-java/src/main/resources/archetype-resources/pom.xml
@@ -125,10 +125,10 @@ under the License.
<exclude>org.scala-lang:scala-library</exclude>
<exclude>com.amazonaws:aws-java-sdk</exclude>
<exclude>io.netty:netty-all</exclude>
- <exclude>com.typesafe.akka:akka-actor_2.10</exclude>
- <exclude>com.typesafe.akka:akka-remote_2.10</exclude>
+ <exclude>com.typesafe.akka:akka-actor_${scala.binary.version}</exclude>
+ <exclude>com.typesafe.akka:akka-remote_${scala.binary.version}</exclude>
<exclude>io.netty:netty</exclude>
- <exclude>com.typesafe.akka:akka-slf4j_2.10</exclude>
+ <exclude>com.typesafe.akka:akka-slf4j_${scala.binary.version}</exclude>
<exclude>org.eclipse.jetty:jetty-server</exclude>
<exclude>org.eclipse.jetty:jetty-continuation</exclude>
<exclude>org.eclipse.jetty:jetty-http</exclude>
@@ -148,12 +148,12 @@ under the License.
<exclude>com.esotericsoftware.kryo:kryo</exclude>
<exclude>com.esotericsoftware.minlog:minlog</exclude>
<exclude>org.objenesis:objenesis</exclude>
- <exclude>com.twitter:chill_2.10</exclude>
+ <exclude>com.twitter:chill_${scala.binary.version}</exclude>
<exclude>com.twitter:chill-java</exclude>
- <exclude>com.twitter:chill-avro_2.10</exclude>
- <exclude>com.twitter:chill-bijection_2.10</exclude>
- <exclude>com.twitter:bijection-core_2.10</exclude>
- <exclude>com.twitter:bijection-avro_2.10</exclude>
+ <exclude>com.twitter:chill-avro_${scala.binary.version}</exclude>
+ <exclude>com.twitter:chill-bijection_${scala.binary.version}</exclude>
+ <exclude>com.twitter:bijection-core_${scala.binary.version}</exclude>
+ <exclude>com.twitter:bijection-avro_${scala.binary.version}</exclude>
<exclude>com.twitter:chill-protobuf</exclude>
<exclude>com.google.protobuf:protobuf-java</exclude>
<exclude>com.twitter:chill-thrift</exclude>
@@ -179,7 +179,7 @@ under the License.
<exclude>stax:stax-api</exclude>
<exclude>com.typesafe:config</exclude>
<exclude>org.uncommons.maths:uncommons-maths</exclude>
- <exclude>com.github.scopt:scopt_2.10</exclude>
+ <exclude>com.github.scopt:scopt_${scala.binary.version}</exclude>
<exclude>org.mortbay.jetty:servlet-api</exclude>
<exclude>commons-io:commons-io</exclude>
<exclude>commons-cli:commons-cli</exclude>
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-quickstart/flink-quickstart-scala/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/flink-quickstart/flink-quickstart-scala/src/main/resources/archetype-resources/pom.xml b/flink-quickstart/flink-quickstart-scala/src/main/resources/archetype-resources/pom.xml
index 1c89170..c092474 100644
--- a/flink-quickstart/flink-quickstart-scala/src/main/resources/archetype-resources/pom.xml
+++ b/flink-quickstart/flink-quickstart-scala/src/main/resources/archetype-resources/pom.xml
@@ -129,10 +129,10 @@ under the License.
<exclude>org.scala-lang:scala-library</exclude>
<exclude>com.amazonaws:aws-java-sdk</exclude>
<exclude>io.netty:netty-all</exclude>
- <exclude>com.typesafe.akka:akka-actor_2.10</exclude>
- <exclude>com.typesafe.akka:akka-remote_2.10</exclude>
+ <exclude>com.typesafe.akka:akka-actor_${scala.binary.version}</exclude>
+ <exclude>com.typesafe.akka:akka-remote_${scala.binary.version}</exclude>
<exclude>io.netty:netty</exclude>
- <exclude>com.typesafe.akka:akka-slf4j_2.10</exclude>
+ <exclude>com.typesafe.akka:akka-slf4j_${scala.binary.version}</exclude>
<exclude>org.eclipse.jetty:jetty-server</exclude>
<exclude>org.eclipse.jetty:jetty-continuation</exclude>
<exclude>org.eclipse.jetty:jetty-http</exclude>
@@ -152,12 +152,12 @@ under the License.
<exclude>com.esotericsoftware.kryo:kryo</exclude>
<exclude>com.esotericsoftware.minlog:minlog</exclude>
<exclude>org.objenesis:objenesis</exclude>
- <exclude>com.twitter:chill_2.10</exclude>
+ <exclude>com.twitter:chill_${scala.binary.version}</exclude>
<exclude>com.twitter:chill-java</exclude>
- <exclude>com.twitter:chill-avro_2.10</exclude>
- <exclude>com.twitter:chill-bijection_2.10</exclude>
- <exclude>com.twitter:bijection-core_2.10</exclude>
- <exclude>com.twitter:bijection-avro_2.10</exclude>
+ <exclude>com.twitter:chill-avro_${scala.binary.version}</exclude>
+ <exclude>com.twitter:chill-bijection_${scala.binary.version}</exclude>
+ <exclude>com.twitter:bijection-core_${scala.binary.version}</exclude>
+ <exclude>com.twitter:bijection-avro_${scala.binary.version}</exclude>
<exclude>com.twitter:chill-protobuf</exclude>
<exclude>com.google.protobuf:protobuf-java</exclude>
<exclude>com.twitter:chill-thrift</exclude>
@@ -183,7 +183,7 @@ under the License.
<exclude>stax:stax-api</exclude>
<exclude>com.typesafe:config</exclude>
<exclude>org.uncommons.maths:uncommons-maths</exclude>
- <exclude>com.github.scopt:scopt_2.10</exclude>
+ <exclude>com.github.scopt:scopt_${scala.binary.version}</exclude>
<exclude>org.mortbay.jetty:servlet-api</exclude>
<exclude>commons-io:commons-io</exclude>
<exclude>commons-cli:commons-cli</exclude>
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-runtime/pom.xml
----------------------------------------------------------------------
diff --git a/flink-runtime/pom.xml b/flink-runtime/pom.xml
index ad570b8..4654c60 100644
--- a/flink-runtime/pom.xml
+++ b/flink-runtime/pom.xml
@@ -112,32 +112,32 @@ under the License.
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.10</artifactId>
+ <artifactId>akka-actor_${scala.binary.version}</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-remote_2.10</artifactId>
+ <artifactId>akka-remote_${scala.binary.version}</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-slf4j_2.10</artifactId>
+ <artifactId>akka-slf4j_${scala.binary.version}</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.10</artifactId>
+ <artifactId>akka-testkit_${scala.binary.version}</artifactId>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
- <artifactId>scalatest_2.10</artifactId>
+ <artifactId>scalatest_${scala.binary.version}</artifactId>
</dependency>
<dependency>
<groupId>com.github.scopt</groupId>
- <artifactId>scopt_2.10</artifactId>
+ <artifactId>scopt_${scala.binary.version}</artifactId>
<exclusions>
<exclusion>
<groupId>org.scala-lang</groupId>
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-scala/pom.xml
----------------------------------------------------------------------
diff --git a/flink-scala/pom.xml b/flink-scala/pom.xml
index f350062..546914e 100644
--- a/flink-scala/pom.xml
+++ b/flink-scala/pom.xml
@@ -67,12 +67,6 @@ under the License.
</dependency>
<dependency>
- <groupId>org.scalamacros</groupId>
- <artifactId>quasiquotes_${scala.binary.version}</artifactId>
- <version>${scala.macros.version}</version>
- </dependency>
-
- <dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>${asm.version}</version>
@@ -235,4 +229,23 @@ under the License.
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>scala-2.10</id>
+ <activation>
+ <property>
+ <!-- this is the default scala profile -->
+ <name>!scala-2.11</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.scalamacros</groupId>
+ <artifactId>quasiquotes_${scala.binary.version}</artifactId>
+ <version>${scala.macros.version}</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
</project>
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TreeGen.scala
----------------------------------------------------------------------
diff --git a/flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TreeGen.scala b/flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TreeGen.scala
index f6358d5..af6b7f4 100644
--- a/flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TreeGen.scala
+++ b/flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TreeGen.scala
@@ -241,7 +241,7 @@ private[flink] trait TreeGen[C <: Context] { this: MacroContextHolder[C] with Ty
case _ =>
c.abort(c.enclosingPosition, "Could not extract user defined function, got: " + show(fun))
}
- val uncheckedUdfBody = c.resetAllAttrs(udfBody)
+ val uncheckedUdfBody = c.resetLocalAttrs(udfBody)
(paramName, uncheckedUdfBody)
}
@@ -252,7 +252,7 @@ private[flink] trait TreeGen[C <: Context] { this: MacroContextHolder[C] with Ty
case _ =>
c.abort(c.enclosingPosition, "Could not extract user defined function, got: " + show(fun))
}
- val uncheckedUdfBody = c.resetAllAttrs(udfBody)
+ val uncheckedUdfBody = c.resetLocalAttrs(udfBody)
(param1Name, param2Name, uncheckedUdfBody)
}
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TypeAnalyzer.scala
----------------------------------------------------------------------
diff --git a/flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TypeAnalyzer.scala b/flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TypeAnalyzer.scala
index 541ba20..bdf1ce9 100644
--- a/flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TypeAnalyzer.scala
+++ b/flink-scala/src/main/scala/org/apache/flink/api/scala/codegen/TypeAnalyzer.scala
@@ -36,6 +36,7 @@ private[flink] trait TypeAnalyzer[C <: Context] { this: MacroContextHolder[C]
with TypeDescriptors[C] =>
import c.universe._
+ import compat._
// This value is controlled by the udtRecycling compiler option
var enableMutableUDTs = false
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-staging/flink-expressions/pom.xml
----------------------------------------------------------------------
diff --git a/flink-staging/flink-expressions/pom.xml b/flink-staging/flink-expressions/pom.xml
index 1707ff4..f26ab03 100644
--- a/flink-staging/flink-expressions/pom.xml
+++ b/flink-staging/flink-expressions/pom.xml
@@ -74,12 +74,6 @@ under the License.
</dependency>
<dependency>
- <groupId>org.scalamacros</groupId>
- <artifactId>quasiquotes_${scala.binary.version}</artifactId>
- <version>${scala.macros.version}</version>
- </dependency>
-
- <dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils</artifactId>
<version>${project.version}</version>
@@ -230,4 +224,23 @@ under the License.
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>scala-2.10</id>
+ <activation>
+ <property>
+ <!-- this is the default scala profile -->
+ <name>!scala-2.11</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.scalamacros</groupId>
+ <artifactId>quasiquotes_${scala.binary.version}</artifactId>
+ <version>${scala.macros.version}</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
</project>
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-staging/flink-expressions/src/main/scala/org/apache/flink/api/expressions/codegen/ExpressionCodeGenerator.scala
----------------------------------------------------------------------
diff --git a/flink-staging/flink-expressions/src/main/scala/org/apache/flink/api/expressions/codegen/ExpressionCodeGenerator.scala b/flink-staging/flink-expressions/src/main/scala/org/apache/flink/api/expressions/codegen/ExpressionCodeGenerator.scala
index 3e1ce0c..cafba57 100644
--- a/flink-staging/flink-expressions/src/main/scala/org/apache/flink/api/expressions/codegen/ExpressionCodeGenerator.scala
+++ b/flink-staging/flink-expressions/src/main/scala/org/apache/flink/api/expressions/codegen/ExpressionCodeGenerator.scala
@@ -43,9 +43,9 @@ import scala.collection.mutable
* as "(IN1, IN2) => OUT".
*/
abstract class ExpressionCodeGenerator[R](
- inputs: Seq[(String, CompositeType[_])],
- val nullCheck: Boolean = false,
- cl: ClassLoader) {
+ inputs: Seq[(String, CompositeType[_])],
+ val nullCheck: Boolean = false,
+ cl: ClassLoader) {
protected val log = LoggerFactory.getLogger(classOf[ExpressionCodeGenerator[_]])
import scala.reflect.runtime.{universe => ru}
@@ -56,6 +56,7 @@ abstract class ExpressionCodeGenerator[R](
}
import scala.tools.reflect.ToolBox
+
protected val (mirror, toolBox) = ReflectionLock.synchronized {
val mirror = runtimeMirror(cl)
(mirror, mirror.mkToolBox())
@@ -75,12 +76,12 @@ abstract class ExpressionCodeGenerator[R](
protected def generateExpression(expr: Expression): GeneratedExpression = {
// doesn't work yet, because we insert the same code twice and reuse variable names
-// cache.getOrElseUpdate(expr, generateExpressionInternal(expr))
+ // cache.getOrElseUpdate(expr, generateExpressionInternal(expr))
generateExpressionInternal(expr)
}
protected def generateExpressionInternal(expr: Expression): GeneratedExpression = {
-// protected def generateExpression(expr: Expression): GeneratedExpression = {
+ // protected def generateExpression(expr: Expression): GeneratedExpression = {
val nullTerm = freshTermName("isNull")
val resultTerm = freshTermName("result")
@@ -95,7 +96,7 @@ abstract class ExpressionCodeGenerator[R](
if (nullCheck) {
leftCode.code ++ rightCode.code ++ q"""
- val $nullTerm = ${leftCode.nullTerm} || ${rightCode.nullTerm}
+ val $nullTerm = ${leftCode.nullTerm}|| ${rightCode.nullTerm}
val $resultTerm = if ($nullTerm) {
${defaultPrimitive(resultType)}
} else {
@@ -123,7 +124,7 @@ abstract class ExpressionCodeGenerator[R](
val resultTerm = null
""".children
} else {
- Seq(q"""
+ Seq( q"""
val resultTerm = null
""")
}
@@ -135,7 +136,7 @@ abstract class ExpressionCodeGenerator[R](
val $resultTerm = $intValue
""".children
} else {
- Seq(q"""
+ Seq( q"""
val $resultTerm = $intValue
""")
}
@@ -147,7 +148,7 @@ abstract class ExpressionCodeGenerator[R](
val $resultTerm = $longValue
""".children
} else {
- Seq(q"""
+ Seq( q"""
val $resultTerm = $longValue
""")
}
@@ -160,7 +161,7 @@ abstract class ExpressionCodeGenerator[R](
val $resultTerm = $doubleValue
""".children
} else {
- Seq(q"""
+ Seq( q"""
val $resultTerm = $doubleValue
""")
}
@@ -172,7 +173,7 @@ abstract class ExpressionCodeGenerator[R](
val $resultTerm = $floatValue
""".children
} else {
- Seq(q"""
+ Seq( q"""
val $resultTerm = $floatValue
""")
}
@@ -184,7 +185,7 @@ abstract class ExpressionCodeGenerator[R](
val $resultTerm = $strValue
""".children
} else {
- Seq(q"""
+ Seq( q"""
val $resultTerm = $strValue
""")
}
@@ -196,7 +197,7 @@ abstract class ExpressionCodeGenerator[R](
val $resultTerm = $boolValue
""".children
} else {
- Seq(q"""
+ Seq( q"""
val $resultTerm = $boolValue
""")
}
@@ -208,7 +209,7 @@ abstract class ExpressionCodeGenerator[R](
if (nullCheck) {
strCode.code ++ beginIndexCode.code ++ endIndexCode.code ++ q"""
val $nullTerm =
- ${strCode.nullTerm} || ${beginIndexCode.nullTerm} || ${endIndexCode.nullTerm}
+ ${strCode.nullTerm}|| ${beginIndexCode.nullTerm}|| ${endIndexCode.nullTerm}
if ($nullTerm) {
${defaultPrimitive(str.typeInfo)}
} else {
@@ -245,7 +246,7 @@ abstract class ExpressionCodeGenerator[R](
}
""".children
} else {
- Seq(q"""
+ Seq( q"""
val $resultTerm = ${childGen.resultTerm}.toString
""")
}
@@ -259,7 +260,7 @@ abstract class ExpressionCodeGenerator[R](
val $resultTerm = ${childGen.resultTerm}.toInt
""".children
} else {
- Seq(q"""
+ Seq( q"""
val $resultTerm = ${childGen.resultTerm}.toInt
""")
}
@@ -273,7 +274,7 @@ abstract class ExpressionCodeGenerator[R](
val $resultTerm = ${childGen.resultTerm}.toLong
""".children
} else {
- Seq(q"""
+ Seq( q"""
val $resultTerm = ${childGen.resultTerm}.toLong
""")
}
@@ -287,7 +288,7 @@ abstract class ExpressionCodeGenerator[R](
val $resultTerm = ${childGen.resultTerm}.toFloat
""".children
} else {
- Seq(q"""
+ Seq( q"""
val $resultTerm = ${childGen.resultTerm}.toFloat
""")
}
@@ -301,14 +302,14 @@ abstract class ExpressionCodeGenerator[R](
val $resultTerm = ${childGen.resultTerm}.toDouble
""".children
} else {
- Seq(q"""
+ Seq( q"""
val $resultTerm = ${childGen.resultTerm}.toDouble
""")
}
childGen.code ++ castCode
case ResolvedFieldReference(fieldName, fieldTpe: TypeInformation[_]) =>
- inputs find { i => i._2.hasField(fieldName) } match {
+ inputs find { i => i._2.hasField(fieldName)} match {
case Some((inputName, inputTpe)) =>
val fieldCode = getField(newTermName(inputName), inputTpe, fieldName, fieldTpe)
if (nullCheck) {
@@ -317,7 +318,7 @@ abstract class ExpressionCodeGenerator[R](
val $nullTerm = $resultTerm == null
""".children
} else {
- Seq(q"""
+ Seq( q"""
val $resultTerm = $fieldCode
""")
}
@@ -526,10 +527,10 @@ abstract class ExpressionCodeGenerator[R](
val freshNameCounter = new AtomicInteger
protected def getField(
- inputTerm: TermName,
- inputType: CompositeType[_],
- fieldName: String,
- fieldType: TypeInformation[_]): Tree = {
+ inputTerm: TermName,
+ inputType: CompositeType[_],
+ fieldName: String,
+ fieldType: TypeInformation[_]): Tree = {
val accessor = fieldAccessorFor(inputType, fieldName)
accessor match {
case ObjectFieldAccessor(fieldName) =>
@@ -549,7 +550,9 @@ abstract class ExpressionCodeGenerator[R](
sealed abstract class FieldAccessor
case class ObjectFieldAccessor(fieldName: String) extends FieldAccessor
+
case class ObjectMethodAccessor(methodName: String) extends FieldAccessor
+
case class ProductAccessor(i: Int) extends FieldAccessor
def fieldAccessorFor(elementType: CompositeType[_], fieldName: String): FieldAccessor = {
@@ -622,6 +625,8 @@ abstract class ExpressionCodeGenerator[R](
throw new RuntimeException("Number of type parameters does not match.")
}
val typeParams = genericTypeInfos.map(typeForTypeInfo)
+ // TODO: remove, added only for migration of the line below, as suggested by the compiler
+ import compat._
TypeRef(prefix, sym, typeParams.toList)
}
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-staging/flink-ml/pom.xml
----------------------------------------------------------------------
diff --git a/flink-staging/flink-ml/pom.xml b/flink-staging/flink-ml/pom.xml
index 24ba591..123770f 100644
--- a/flink-staging/flink-ml/pom.xml
+++ b/flink-staging/flink-ml/pom.xml
@@ -42,7 +42,7 @@
<dependency>
<groupId>org.scalatest</groupId>
- <artifactId>scalatest_2.10</artifactId>
+ <artifactId>scalatest_${scala.binary.version}</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-staging/flink-streaming/flink-streaming-connectors/pom.xml
----------------------------------------------------------------------
diff --git a/flink-staging/flink-streaming/flink-streaming-connectors/pom.xml b/flink-staging/flink-streaming/flink-streaming-connectors/pom.xml
index 06d34c7..4408ba0 100644
--- a/flink-staging/flink-streaming/flink-streaming-connectors/pom.xml
+++ b/flink-staging/flink-streaming/flink-streaming-connectors/pom.xml
@@ -37,7 +37,7 @@ under the License.
<!-- Allow users to pass custom kafka versions -->
<properties>
- <kafka.version>0.8.1</kafka.version>
+ <kafka.version>0.8.2.0</kafka.version>
<rabbitmq.version>3.3.1</rabbitmq.version>
<flume-ng.version>1.5.0</flume-ng.version>
</properties>
@@ -52,7 +52,7 @@ under the License.
<dependency>
<groupId>org.apache.kafka</groupId>
- <artifactId>kafka_2.10</artifactId>
+ <artifactId>kafka_${scala.binary.version}</artifactId>
<version>${kafka.version}</version>
<exclusions>
<exclusion>
@@ -99,6 +99,13 @@ under the License.
</dependency>
<dependency>
+ <groupId>org.apache.curator</groupId>
+ <artifactId>curator-test</artifactId>
+ <version>2.7.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>${rabbitmq.version}</version>
@@ -213,27 +220,13 @@ under the License.
<artifactId>spymemcached</artifactId>
<version>2.8.4</version>
</dependency>
-
+
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.json</artifactId>
<version>2.0.6</version>
</dependency>
- <dependency>
- <groupId>org.apache.flink</groupId>
- <artifactId>flink-streaming-core</artifactId>
- <version>0.9-SNAPSHOT</version>
- </dependency>
-
- <!-- Curator provides a Zookeeper test cluster, needed to test Kafka -->
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-test</artifactId>
- <version>2.5.0</version>
- <scope>test</scope>
- </dependency>
-
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-staging/flink-streaming/flink-streaming-connectors/src/main/java/org/apache/flink/streaming/connectors/kafka/api/simple/KafkaTopicUtils.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-streaming/flink-streaming-connectors/src/main/java/org/apache/flink/streaming/connectors/kafka/api/simple/KafkaTopicUtils.java b/flink-staging/flink-streaming/flink-streaming-connectors/src/main/java/org/apache/flink/streaming/connectors/kafka/api/simple/KafkaTopicUtils.java
index 7f5360b..7a10ed3 100644
--- a/flink-staging/flink-streaming/flink-streaming-connectors/src/main/java/org/apache/flink/streaming/connectors/kafka/api/simple/KafkaTopicUtils.java
+++ b/flink-staging/flink-streaming/flink-streaming-connectors/src/main/java/org/apache/flink/streaming/connectors/kafka/api/simple/KafkaTopicUtils.java
@@ -84,7 +84,7 @@ public class KafkaTopicUtils {
// TODO for Kafka version 8.2.0
// return leader.connectionString();
- return leader.getConnectionString();
+ return leader.connectionString();
}
public TopicMetadata getTopicInfo(String topicName) {
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-staging/flink-streaming/flink-streaming-examples/src/main/scala/org/apache/flink/streaming/scala/examples/windowing/StockPrices.scala
----------------------------------------------------------------------
diff --git a/flink-staging/flink-streaming/flink-streaming-examples/src/main/scala/org/apache/flink/streaming/scala/examples/windowing/StockPrices.scala b/flink-staging/flink-streaming/flink-streaming-examples/src/main/scala/org/apache/flink/streaming/scala/examples/windowing/StockPrices.scala
index 222a0a7..83945a9 100644
--- a/flink-staging/flink-streaming/flink-streaming-examples/src/main/scala/org/apache/flink/streaming/scala/examples/windowing/StockPrices.scala
+++ b/flink-staging/flink-streaming/flink-streaming-examples/src/main/scala/org/apache/flink/streaming/scala/examples/windowing/StockPrices.scala
@@ -184,7 +184,7 @@ object StockPrices {
}
def generateStock(symbol: String)(sigma: Int)(out: Collector[StockPrice]) = {
- var price = 1000.
+ var price = 1000.0
while (true) {
price = price + Random.nextGaussian * sigma
out.collect(StockPrice(symbol, price))
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-staging/flink-streaming/flink-streaming-scala/pom.xml
----------------------------------------------------------------------
diff --git a/flink-staging/flink-streaming/flink-streaming-scala/pom.xml b/flink-staging/flink-streaming/flink-streaming-scala/pom.xml
index 213bdec..25ecb57 100644
--- a/flink-staging/flink-streaming/flink-streaming-scala/pom.xml
+++ b/flink-staging/flink-streaming/flink-streaming-scala/pom.xml
@@ -61,12 +61,6 @@ under the License.
</dependency>
<dependency>
- <groupId>org.scalamacros</groupId>
- <artifactId>quasiquotes_${scala.binary.version}</artifactId>
- <version>${scala.macros.version}</version>
- </dependency>
-
- <dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>${asm.version}</version>
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-tests/pom.xml
----------------------------------------------------------------------
diff --git a/flink-tests/pom.xml b/flink-tests/pom.xml
index 1670d85..9675150 100644
--- a/flink-tests/pom.xml
+++ b/flink-tests/pom.xml
@@ -134,13 +134,13 @@ under the License.
<dependency>
<groupId>org.scalatest</groupId>
- <artifactId>scalatest_2.10</artifactId>
+ <artifactId>scalatest_${scala.binary.version}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.10</artifactId>
+ <artifactId>akka-testkit_${scala.binary.version}</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-tests/src/test/scala/org/apache/flink/api/scala/io/CsvInputFormatTest.scala
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/scala/org/apache/flink/api/scala/io/CsvInputFormatTest.scala b/flink-tests/src/test/scala/org/apache/flink/api/scala/io/CsvInputFormatTest.scala
index 9b60f3f..9964a9d 100644
--- a/flink-tests/src/test/scala/org/apache/flink/api/scala/io/CsvInputFormatTest.scala
+++ b/flink-tests/src/test/scala/org/apache/flink/api/scala/io/CsvInputFormatTest.scala
@@ -265,7 +265,7 @@ class CsvInputFormatTest {
assertEquals(Integer.valueOf(777), result._2)
assertEquals(Integer.valueOf(888), result._3)
assertEquals(Integer.valueOf(999), result._4)
- assertEquals(Integer.valueOf(000), result._5)
+ assertEquals(Integer.valueOf(0), result._5)
result = format.nextRecord(result)
assertNull(result)
assertTrue(format.reachedEnd)
@@ -326,7 +326,7 @@ class CsvInputFormatTest {
assertEquals(Integer.valueOf(888), result._3)
result = format.nextRecord(result)
assertNotNull(result)
- assertEquals(Integer.valueOf(000), result._1)
+ assertEquals(Integer.valueOf(0), result._1)
assertEquals(Integer.valueOf(777), result._2)
assertEquals(Integer.valueOf(333), result._3)
result = format.nextRecord(result)
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/flink-yarn/pom.xml
----------------------------------------------------------------------
diff --git a/flink-yarn/pom.xml b/flink-yarn/pom.xml
index 805543e..4f10f81 100644
--- a/flink-yarn/pom.xml
+++ b/flink-yarn/pom.xml
@@ -58,17 +58,17 @@ under the License.
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.10</artifactId>
+ <artifactId>akka-actor_${scala.binary.version}</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-remote_2.10</artifactId>
+ <artifactId>akka-remote_${scala.binary.version}</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-camel_2.10</artifactId>
+ <artifactId>akka-camel_${scala.binary.version}</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/flink/blob/2cd5e93d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 11cca1b..ffa8120 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,7 +74,6 @@ under the License.
<shading-artifact.name>error</shading-artifact.name>
<hadoop-one.version>1.2.1</hadoop-one.version>
<hadoop-two.version>2.2.0</hadoop-two.version>
- <scala.version>2.10.4</scala.version>
<!-- Need to use a user property here because the surefire/failsafe
forkCount is not exposed as a property. With this we can set
it on the "mvn" commandline in travis. -->
@@ -83,9 +82,7 @@ under the License.
<log4j.configuration>log4j-test.properties</log4j.configuration>
<slf4j.version>1.7.7</slf4j.version>
<guava.version>18.0</guava.version>
- <scala.version>2.10.4</scala.version>
<akka.version>2.3.7</akka.version>
- <scala.binary.version>2.10</scala.binary.version>
<scala.macros.version>2.0.1</scala.macros.version>
<kryoserialization.version>0.3.2</kryoserialization.version>
<protobuf.version>2.5.0</protobuf.version>
@@ -274,45 +271,45 @@ under the License.
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.10</artifactId>
+ <artifactId>akka-actor_${scala.binary.version}</artifactId>
<version>${akka.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-remote_2.10</artifactId>
+ <artifactId>akka-remote_${scala.binary.version}</artifactId>
<version>${akka.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-slf4j_2.10</artifactId>
+ <artifactId>akka-slf4j_${scala.binary.version}</artifactId>
<version>${akka.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-camel_2.10</artifactId>
+ <artifactId>akka-camel_${scala.binary.version}</artifactId>
<version>${akka.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.10</artifactId>
+ <artifactId>akka-testkit_${scala.binary.version}</artifactId>
<version>${akka.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
- <artifactId>scalatest_2.10</artifactId>
+ <artifactId>scalatest_${scala.binary.version}</artifactId>
<version>2.2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.scopt</groupId>
- <artifactId>scopt_2.10</artifactId>
+ <artifactId>scopt_${scala.binary.version}</artifactId>
<version>3.2.0</version>
<exclusions>
<exclusion>
@@ -326,6 +323,32 @@ under the License.
<profiles>
<profile>
+ <id>scala-2.10</id>
+ <activation>
+ <property>
+ <!-- this is the default scala profile -->
+ <name>!scala-2.11</name>
+ </property>
+ </activation>
+ <properties>
+ <scala.version>2.10.4</scala.version>
+ <scala.binary.version>2.10</scala.binary.version>
+ </properties>
+ </profile>
+ <profile>
+ <id>scala-2.11</id>
+ <activation>
+ <property>
+ <name>scala-2.11</name>
+ </property>
+ </activation>
+ <properties>
+ <scala.version>2.11.4</scala.version>
+ <scala.binary.version>2.11</scala.binary.version>
+ </properties>
+ </profile>
+
+ <profile>
<id>hadoop-1</id>
<activation>
<property>