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 2017/10/14 23:30:58 UTC

[3/8] flink git commit: [FLINK-7809] Remove support for Scala 2.10

[FLINK-7809] Remove support for Scala 2.10


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

Branch: refs/heads/master
Commit: a6039cab509b619efe0739d5f7d5e6099f954cb8
Parents: 76e9b09
Author: Aljoscha Krettek <al...@gmail.com>
Authored: Fri Oct 6 11:42:00 2017 +0200
Committer: Stephan Ewen <se...@apache.org>
Committed: Sat Oct 14 17:16:31 2017 +0200

----------------------------------------------------------------------
 .travis.yml                                     | 10 +++---
 docs/start/building.md                          | 13 -------
 .../flink/table/api/TableEnvironment.scala      |  2 +-
 flink-scala-shell/pom.xml                       | 25 -------------
 .../apache/flink/api/scala/ILoopCompat.scala    | 31 ----------------
 .../apache/flink/api/scala/ILoopCompat.scala    | 37 --------------------
 .../org/apache/flink/api/scala/FlinkILoop.scala | 16 ++++-----
 flink-scala/pom.xml                             | 20 -----------
 pom.xml                                         | 14 --------
 tools/create_release_files.sh                   | 13 +------
 tools/deploy_to_maven.sh                        |  9 ++---
 tools/releasing/create_binary_release.sh        |  6 ----
 tools/releasing/deploy_staging_jars.sh          |  6 ----
 13 files changed, 16 insertions(+), 186 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/a6039cab/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 72dcfac..44028a7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -64,27 +64,27 @@ matrix:
     - jdk: "openjdk8"
       env:
         - TEST="core"
-        - PROFILE="-Dhadoop.version=2.4.1 -Dscala-2.10"
+        - PROFILE="-Dhadoop.version=2.4.1"
         - CACHE_NAME=JDK8_H241_CO
     - jdk: "openjdk8"
       env:
         - TEST="libraries"
-        - PROFILE="-Dhadoop.version=2.4.1 -Dscala-2.10"
+        - PROFILE="-Dhadoop.version=2.4.1"
         - CACHE_NAME=JDK8_H241_L
     - jdk: "openjdk8"
       env:
         - TEST="connectors"
-        - PROFILE="-Dhadoop.version=2.4.1 -Dscala-2.10 -Pinclude-kinesis"
+        - PROFILE="-Dhadoop.version=2.4.1 -Pinclude-kinesis"
         - CACHE_NAME=JDK8_H241_CN
     - jdk: "openjdk8"
       env:
         - TEST="tests"
-        - PROFILE="-Dhadoop.version=2.4.1 -Dscala-2.10"
+        - PROFILE="-Dhadoop.version=2.4.1"
         - CACHE_NAME=JDK8_H241_T
     - jdk: "openjdk8"
       env:
         - TEST="misc"
-        - PROFILE="-Dhadoop.version=2.4.1 -Dscala-2.10"
+        - PROFILE="-Dhadoop.version=2.4.1"
         - CACHE_NAME=JDK8_H241_M
 
 git:

http://git-wip-us.apache.org/repos/asf/flink/blob/a6039cab/docs/start/building.md
----------------------------------------------------------------------
diff --git a/docs/start/building.md b/docs/start/building.md
index 01dc4ed..1478dfd 100644
--- a/docs/start/building.md
+++ b/docs/start/building.md
@@ -115,19 +115,6 @@ The `-Pvendor-repos` activates a Maven [build profile](http://maven.apache.org/g
 
 Flink has APIs, libraries, and runtime modules written in [Scala](http://scala-lang.org). Users of the Scala API and libraries may have to match the Scala version of Flink with the Scala version of their projects (because Scala is not strictly backwards compatible).
 
-**By default, Flink is built with the Scala 2.11**. To build Flink with Scala *2.10*, you can change the default Scala *binary version* by using *scala-2.10* build profile:
-
-~~~bash
-# Build with Scala version 2.10
-mvn clean install -DskipTests -Pscala-2.10
-~~~
-
-To build against custom Scala versions, you need to define new custom build profile that will override *scala.version* and *scala.binary.version* values.
-
-Flink is developed against Scala *2.11* and tested additionally against Scala *2.10*. These two versions are known to be compatible. Earlier versions (like Scala *2.9*) are *not* compatible.
-
-Newer versions may be compatible, depending on breaking changes in the language features used by Flink, and the availability of Flink's dependencies in those Scala versions. The dependencies written in Scala include for example *Kafka*, *Akka*, *Scalatest*, and *scopt*.
-
 {% top %}
 
 ## Encrypted File Systems

http://git-wip-us.apache.org/repos/asf/flink/blob/a6039cab/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
index 54877ba..7e360f9 100644
--- a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
+++ b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
@@ -892,7 +892,7 @@ abstract class TableEnvironment(val config: TableConfig) {
       throw new TableException("Field name can not be '*'.")
     }
 
-    (fieldNames.toArray, fieldIndexes.toArray) // build fails in Scala 2.10 if not converted
+    (fieldNames, fieldIndexes)
   }
 
   protected def generateRowConverterFunction[OUT](

http://git-wip-us.apache.org/repos/asf/flink/blob/a6039cab/flink-scala-shell/pom.xml
----------------------------------------------------------------------
diff --git a/flink-scala-shell/pom.xml b/flink-scala-shell/pom.xml
index 0d925ed..15f10c7 100644
--- a/flink-scala-shell/pom.xml
+++ b/flink-scala-shell/pom.xml
@@ -209,29 +209,4 @@ under the License.
 		</plugins>
 	</build>
 
-	<profiles>
-		<profile>
-			<id>scala-2.10</id>
-			<activation>
-				<property>
-					<name>scala-2.10</name>
-				</property>
-			</activation>
-			<!-- only required for Scala 2.10 -->
-			<dependencies>
-				<dependency>
-					<groupId>org.scalamacros</groupId>
-					<artifactId>quasiquotes_2.10</artifactId>
-					<version>${scala.macros.version}</version>
-				</dependency>
-
-				<dependency>
-					<groupId>org.scala-lang</groupId>
-					<artifactId>jline</artifactId>
-					<version>2.10.4</version>
-				</dependency>
-			</dependencies>
-		</profile>
-	</profiles>
-
 </project>

http://git-wip-us.apache.org/repos/asf/flink/blob/a6039cab/flink-scala-shell/src/main/scala-2.10/org/apache/flink/api/scala/ILoopCompat.scala
----------------------------------------------------------------------
diff --git a/flink-scala-shell/src/main/scala-2.10/org/apache/flink/api/scala/ILoopCompat.scala b/flink-scala-shell/src/main/scala-2.10/org/apache/flink/api/scala/ILoopCompat.scala
deleted file mode 100644
index 7751751..0000000
--- a/flink-scala-shell/src/main/scala-2.10/org/apache/flink/api/scala/ILoopCompat.scala
+++ /dev/null
@@ -1,31 +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.scala
-
-import java.io.BufferedReader
-
-import _root_.scala.tools.nsc.interpreter._
-
-class ILoopCompat(
-    in0: Option[BufferedReader],
-    out0: JPrintWriter)
-    extends ILoop(in0, out0) {
-
-  override def prompt = "Scala-Flink> "
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/a6039cab/flink-scala-shell/src/main/scala-2.11/org/apache/flink/api/scala/ILoopCompat.scala
----------------------------------------------------------------------
diff --git a/flink-scala-shell/src/main/scala-2.11/org/apache/flink/api/scala/ILoopCompat.scala b/flink-scala-shell/src/main/scala-2.11/org/apache/flink/api/scala/ILoopCompat.scala
deleted file mode 100644
index 1c395bb..0000000
--- a/flink-scala-shell/src/main/scala-2.11/org/apache/flink/api/scala/ILoopCompat.scala
+++ /dev/null
@@ -1,37 +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.scala
-
-import java.io.BufferedReader
-
-import _root_.scala.tools.nsc.interpreter._
-import _root_.scala.io.AnsiColor.{MAGENTA, RESET}
-
-class ILoopCompat(
-    in0: Option[BufferedReader],
-    out0: JPrintWriter)
-    extends ILoop(in0, out0) {
-
-  override def prompt = {
-    val promptStr = "Scala-Flink> "
-    s"$MAGENTA$promptStr$RESET"
-  }
-
-  protected def addThunk(f: => Unit): Unit = f
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/a6039cab/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
----------------------------------------------------------------------
diff --git a/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala b/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
index e02c2b0..4b6e886 100644
--- a/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
+++ b/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
@@ -35,7 +35,7 @@ class FlinkILoop(
     val externalJars: Option[Array[String]],
     in0: Option[BufferedReader],
     out0: JPrintWriter)
-  extends ILoopCompat(in0, out0) {
+  extends ILoop(in0, out0) {
 
   def this(
     host: String,
@@ -145,15 +145,13 @@ class FlinkILoop(
   override def createInterpreter(): Unit = {
     super.createInterpreter()
 
-    addThunk {
-      intp.beQuietDuring {
-        // import dependencies
-        intp.interpret("import " + packageImports.mkString(", "))
+    intp.beQuietDuring {
+      // import dependencies
+      intp.interpret("import " + packageImports.mkString(", "))
 
-        // set execution environment
-        intp.bind("benv", this.scalaBenv)
-        intp.bind("senv", this.scalaSenv)
-      }
+      // set execution environment
+      intp.bind("benv", this.scalaBenv)
+      intp.bind("senv", this.scalaSenv)
     }
   }
 

http://git-wip-us.apache.org/repos/asf/flink/blob/a6039cab/flink-scala/pom.xml
----------------------------------------------------------------------
diff --git a/flink-scala/pom.xml b/flink-scala/pom.xml
index 93152df..f132145 100644
--- a/flink-scala/pom.xml
+++ b/flink-scala/pom.xml
@@ -256,24 +256,4 @@ under the License.
 
 		</plugins>
 	</build>
-
-	<profiles>
-		<profile>
-			<id>scala-2.10</id>
-			<activation>
-				<property>
-					<name>scala-2.10</name>
-				</property>
-			</activation>
-			<!-- only required for Scala 2.10 -->
-			<dependencies>
-				<dependency>
-					<groupId>org.scalamacros</groupId>
-					<artifactId>quasiquotes_2.10</artifactId>
-					<version>${scala.macros.version}</version>
-				</dependency>
-			</dependencies>
-		</profile>
-	</profiles>
-
 </project>

http://git-wip-us.apache.org/repos/asf/flink/blob/a6039cab/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0e53b7c..b85189f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -528,20 +528,6 @@ under the License.
 	</dependencyManagement>
 
 	<profiles>
-		
-		<!-- Profile to switch to Scala Version 2.10 -->
-		<profile>
-			<id>scala-2.10</id>
-			<activation>
-				<property>
-					<name>scala-2.10</name>
-				</property>
-			</activation>
-			<properties>
-				<scala.version>2.10.6</scala.version>
-				<scala.binary.version>2.10</scala.binary.version>
-			</properties>
-		</profile>
 
 		<profile>
 			<id>spotbugs</id>

http://git-wip-us.apache.org/repos/asf/flink/blob/a6039cab/tools/create_release_files.sh
----------------------------------------------------------------------
diff --git a/tools/create_release_files.sh b/tools/create_release_files.sh
index 48641c0..5d134e8 100755
--- a/tools/create_release_files.sh
+++ b/tools/create_release_files.sh
@@ -241,14 +241,9 @@ deploy_to_maven() {
 
   cd flink
   cp ../../deploysettings.xml .
-  
+
   echo "Deploying Scala 2.11 version"
   $MVN clean deploy -Prelease,docs-and-source,scala-2.11 --settings deploysettings.xml -DskipTests -Dgpg.executable=$GPG -Dgpg.keyname=$GPG_KEY -Dgpg.passphrase=$GPG_PASSPHRASE -DretryFailedDeploymentCount=10
-  
-  # It is important to first deploy scala 2.11 and then scala 2.10 so that the quickstarts (which are independent of the scala version)
-  # are depending on scala 2.10.
-  echo "Deploying Scala 2.10 version"
-  $MVN clean deploy -Prelease,docs-and-source,scala-2.10 --settings deploysettings.xml -DskipTests -Dgpg.executable=$GPG -Dgpg.keyname=$GPG_KEY -Dgpg.passphrase=$GPG_PASSPHRASE -DretryFailedDeploymentCount=10
 }
 
 copy_data() {
@@ -273,18 +268,12 @@ make_source_release
 
 # build dist by input parameter of "--scala-vervion xxx --hadoop-version xxx"
 if [ "$SCALA_VERSION" == "none" ] && [ "$HADOOP_VERSION" == "none" ]; then
-  make_binary_release "hadoop2" "" "2.10"
-  make_binary_release "hadoop26" "-Dhadoop.version=2.6.5" "2.10"
-  make_binary_release "hadoop27" "-Dhadoop.version=2.7.3" "2.10"
-  make_binary_release "hadoop28" "-Dhadoop.version=2.8.0" "2.10"
-
   make_binary_release "hadoop2" "" "2.11"
   make_binary_release "hadoop26" "-Dhadoop.version=2.6.5" "2.11"
   make_binary_release "hadoop27" "-Dhadoop.version=2.7.3" "2.11"
   make_binary_release "hadoop28" "-Dhadoop.version=2.8.0" "2.11"
 elif [ "$SCALA_VERSION" == none ] && [ "$HADOOP_VERSION" != "none" ]
 then
-  make_binary_release "hadoop2" "-Dhadoop.version=$HADOOP_VERSION" "2.10"
   make_binary_release "hadoop2" "-Dhadoop.version=$HADOOP_VERSION" "2.11"
 elif [ "$SCALA_VERSION" != none ] && [ "$HADOOP_VERSION" == "none" ]
 then

http://git-wip-us.apache.org/repos/asf/flink/blob/a6039cab/tools/deploy_to_maven.sh
----------------------------------------------------------------------
diff --git a/tools/deploy_to_maven.sh b/tools/deploy_to_maven.sh
index 2397bd3..aef140d 100755
--- a/tools/deploy_to_maven.sh
+++ b/tools/deploy_to_maven.sh
@@ -87,15 +87,10 @@ if [[ $CURRENT_FLINK_VERSION == *SNAPSHOT* ]] ; then
     MVN_SNAPSHOT_OPTS="-B -Pdocs-and-source -DskipTests -Drat.skip=true -Drat.ignoreErrors=true \
         -DretryFailedDeploymentCount=10 --settings deploysettings.xml clean deploy"
 
-    # hadoop2 scala 2.10
-    echo "deploy standard version (hadoop2) for scala 2.10"
-    mvn ${MVN_SNAPSHOT_OPTS} -Pscala-2.10
-    deploy_to_s3 $CURRENT_FLINK_VERSION "hadoop2"
-
     # hadoop2 scala 2.11
-    echo "deploy hadoop2 version (standard) for scala 2.11"
+    echo "deploy standard version (hadoop2) for scala 2.11"
     mvn ${MVN_SNAPSHOT_OPTS} -Pscala-2.11
-    deploy_to_s3 $CURRENT_FLINK_VERSION "hadoop2_2.11"
+    deploy_to_s3 $CURRENT_FLINK_VERSION "hadoop2"
 
     exit 0
 else

http://git-wip-us.apache.org/repos/asf/flink/blob/a6039cab/tools/releasing/create_binary_release.sh
----------------------------------------------------------------------
diff --git a/tools/releasing/create_binary_release.sh b/tools/releasing/create_binary_release.sh
index 0defd1b..42b5a8e 100755
--- a/tools/releasing/create_binary_release.sh
+++ b/tools/releasing/create_binary_release.sh
@@ -78,18 +78,12 @@ cd ..
 
 
 if [ "$SCALA_VERSION" == "none" ] && [ "$HADOOP_VERSION" == "none" ]; then
-  make_binary_release "hadoop2" "" "2.10"
-  make_binary_release "hadoop26" "-Dhadoop.version=2.6.5" "2.10"
-  make_binary_release "hadoop27" "-Dhadoop.version=2.7.3" "2.10"
-  make_binary_release "hadoop28" "-Dhadoop.version=2.8.0" "2.10"
-
   make_binary_release "hadoop2" "" "2.11"
   make_binary_release "hadoop26" "-Dhadoop.version=2.6.5" "2.11"
   make_binary_release "hadoop27" "-Dhadoop.version=2.7.3" "2.11"
   make_binary_release "hadoop28" "-Dhadoop.version=2.8.0" "2.11"
 elif [ "$SCALA_VERSION" == none ] && [ "$HADOOP_VERSION" != "none" ]
 then
-  make_binary_release "hadoop2" "-Dhadoop.version=$HADOOP_VERSION" "2.10"
   make_binary_release "hadoop2" "-Dhadoop.version=$HADOOP_VERSION" "2.11"
 elif [ "$SCALA_VERSION" != none ] && [ "$HADOOP_VERSION" == "none" ]
 then

http://git-wip-us.apache.org/repos/asf/flink/blob/a6039cab/tools/releasing/deploy_staging_jars.sh
----------------------------------------------------------------------
diff --git a/tools/releasing/deploy_staging_jars.sh b/tools/releasing/deploy_staging_jars.sh
index a379f8f..9245bdd 100755
--- a/tools/releasing/deploy_staging_jars.sh
+++ b/tools/releasing/deploy_staging_jars.sh
@@ -43,9 +43,3 @@ echo "Deploying to repository.apache.org"
 echo "Deploying Scala 2.11 version"
 $MVN clean deploy -Prelease,docs-and-source,scala-2.11 -DskipTests -DretryFailedDeploymentCount=10
 
-# It is important to first deploy scala 2.11 and then scala 2.10 so that the quickstarts (which are independent of the scala version)
-# are depending on scala 2.10.
-
-echo "Deploying Scala 2.10 version"
-$MVN clean deploy -Prelease,docs-and-source,scala-2.10 -DskipTests -DretryFailedDeploymentCount=10
-