SAMZA-469: Update Scala version to 2.11
authorMcIntosh, Craig <Craig.McIntosh@ncr.com>
Thu, 22 Dec 2016 01:25:31 +0000 (17:25 -0800)
committerYi Pan (Data Infrastructure) <nickpan47@gmail.com>
Thu, 22 Dec 2016 01:25:31 +0000 (17:25 -0800)
Author: McIntosh, Craig <Craig.McIntosh@ncr.com>

Reviewers: Yi Pan <nickpan47@gmail.com>, Shanthoosh Venkataraman <santhoshvenkat1988@gmail.com>

Closes #28 from craigtmc/master-scala-2.11 and squashes the following commits:

2705376 [McIntosh, Craig] Fix scala version array in check-all.sh
94f1f7c [McIntosh, Craig] SAMZA-469: Update Scala version to 2.11

README.md
bin/check-all.sh
gradle.properties
gradle/dependency-versions-scala-2.11.gradle [new file with mode: 0644]
samza-core/src/main/java/org/apache/samza/config/TaskConfigJava.java
samza-core/src/main/java/org/apache/samza/container/RunLoopFactory.java
samza-core/src/main/java/org/apache/samza/task/AsyncRunLoop.java

index 672f220..9522390 100644 (file)
--- a/README.md
+++ b/README.md
@@ -28,9 +28,9 @@ After the bootstrap script has completed, the regular gradlew instructions below
 
 #### Scala and YARN
 
-Samza builds with [Scala](http://www.scala-lang.org/) 2.10 and [YARN](http://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-site/YARN.html) 2.6.1, by default. Use the -PscalaVersion switches to change Scala versions. Samza supports building Scala with 2.10.
+Samza builds with [Scala](http://www.scala-lang.org/) 2.10 or 2.11 and [YARN](http://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-site/YARN.html) 2.6.1, by default. Use the -PscalaVersion switches to change Scala versions. Samza supports building Scala with 2.10 and 2.11.
 
-    ./gradlew -PscalaVersion=2.10 clean build
+    ./gradlew -PscalaVersion=2.11 clean build
 
 ### Testing Samza
 
index cb72247..b612ae5 100755 (executable)
@@ -21,7 +21,7 @@
 
 set -e
 
-SCALAs=( "2.10" )
+SCALAs=( "2.10" "2.11" )
 JDKs=( "JAVA7_HOME" "JAVA8_HOME" )
 YARNs=( "2.6.1" "2.7.1" )
 
index d977832..49812f4 100644 (file)
@@ -16,7 +16,7 @@
 # under the License.
 group=org.apache.samza
 version=0.11.1-SNAPSHOT
-scalaVersion=2.10
+scalaVersion=2.11
 
 gradleVersion=2.8
 
diff --git a/gradle/dependency-versions-scala-2.11.gradle b/gradle/dependency-versions-scala-2.11.gradle
new file mode 100644 (file)
index 0000000..e033a86
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+ext {
+  scalaVersion = "2.11"
+  scalaLibVersion = "2.11.8"
+  // Extra options for the compiler:
+  // -feature: Give detailed warnings about language feature use (rather than just 'there were 4 warnings')
+  // -language:implicitConversions: Allow the use of implicit conversions without warning or library import
+  // -language:reflectiveCalls: Allow the automatic use of reflection to access fields without warning or library import
+  scalaOptions = "-feature -language:implicitConversions -language:reflectiveCalls"
+  scalatraVersion = "2.5.0"
+  jettyVersion = "9.2.7.v20150116"
+}
index 021d42a..648fe58 100644 (file)
@@ -112,7 +112,7 @@ public class TaskConfigJava extends MapConfig {
     Set<SystemStream> allInputSS = new HashSet<>();
 
     TaskConfig taskConfig = TaskConfig.Config2Task(this);
-    allInputSS.addAll(JavaConversions.asJavaSet(taskConfig.getInputStreams()));
+    allInputSS.addAll(JavaConversions.setAsJavaSet(taskConfig.getInputStreams()));
     allInputSS.addAll(getBroadcastSystemStreams());
 
     return Collections.unmodifiableSet(allInputSS);
index 1c66c82..23a68cb 100644 (file)
@@ -100,7 +100,7 @@ public class RunLoopFactory {
       log.info("Run loop in asynchronous mode.");
 
       return new AsyncRunLoop(
-        JavaConversions.asJavaMap(asyncStreamTaskInstances),
+        JavaConversions.mapAsJavaMap(asyncStreamTaskInstances),
         threadPool,
         consumerMultiplexer,
         taskMaxConcurrency,
index 0376a37..16f1563 100644 (file)
@@ -115,7 +115,7 @@ public class AsyncRunLoop implements Runnable, Throttleable {
       Map<TaskName, TaskInstance<AsyncStreamTask>> taskInstances, Map<TaskName, AsyncTaskWorker> taskWorkers) {
     Map<SystemStreamPartition, List<AsyncTaskWorker>> sspToWorkerMap = new HashMap<>();
     for (TaskInstance<AsyncStreamTask> task : taskInstances.values()) {
-      Set<SystemStreamPartition> ssps = JavaConversions.asJavaSet(task.systemStreamPartitions());
+      Set<SystemStreamPartition> ssps = JavaConversions.setAsJavaSet(task.systemStreamPartitions());
       for (SystemStreamPartition ssp : ssps) {
         if (sspToWorkerMap.get(ssp) == null) {
           sspToWorkerMap.put(ssp, new ArrayList<AsyncTaskWorker>());
@@ -354,7 +354,7 @@ public class AsyncRunLoop implements Runnable, Throttleable {
      */
     private Set<SystemStreamPartition> getWorkingSSPSet(TaskInstance<AsyncStreamTask> task) {
 
-      Set<SystemStreamPartition> allPartitions = new HashSet<>(JavaConversions.asJavaSet(task.systemStreamPartitions()));
+      Set<SystemStreamPartition> allPartitions = new HashSet<>(JavaConversions.setAsJavaSet(task.systemStreamPartitions()));
 
       // filter only those SSPs that are not at end of stream.
       Set<SystemStreamPartition> workingSSPSet = allPartitions.stream().filter(ssp -> !consumerMultiplexer.isEndOfStream(ssp)).collect(Collectors.toSet());