Skip to content

Commit 9930e5f

Browse files
McIntosh, Craignickpan47
authored andcommitted
SAMZA-469: Update Scala version to 2.11
Author: McIntosh, Craig <[email protected]> Reviewers: Yi Pan <[email protected]>, Shanthoosh Venkataraman <[email protected]> Closes apache#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
1 parent 7e1c92c commit 9930e5f

File tree

7 files changed

+37
-8
lines changed

7 files changed

+37
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ After the bootstrap script has completed, the regular gradlew instructions below
2828

2929
#### Scala and YARN
3030

31-
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.
31+
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.
3232

33-
./gradlew -PscalaVersion=2.10 clean build
33+
./gradlew -PscalaVersion=2.11 clean build
3434

3535
### Testing Samza
3636

bin/check-all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
set -e
2323

24-
SCALAs=( "2.10" )
24+
SCALAs=( "2.10" "2.11" )
2525
JDKs=( "JAVA7_HOME" "JAVA8_HOME" )
2626
YARNs=( "2.6.1" "2.7.1" )
2727

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717
group=org.apache.samza
1818
version=0.11.1-SNAPSHOT
19-
scalaVersion=2.10
19+
scalaVersion=2.11
2020

2121
gradleVersion=2.8
2222

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
ext {
20+
scalaVersion = "2.11"
21+
scalaLibVersion = "2.11.8"
22+
// Extra options for the compiler:
23+
// -feature: Give detailed warnings about language feature use (rather than just 'there were 4 warnings')
24+
// -language:implicitConversions: Allow the use of implicit conversions without warning or library import
25+
// -language:reflectiveCalls: Allow the automatic use of reflection to access fields without warning or library import
26+
scalaOptions = "-feature -language:implicitConversions -language:reflectiveCalls"
27+
scalatraVersion = "2.5.0"
28+
jettyVersion = "9.2.7.v20150116"
29+
}

samza-core/src/main/java/org/apache/samza/config/TaskConfigJava.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public Set<SystemStream> getAllInputStreams() {
112112
Set<SystemStream> allInputSS = new HashSet<>();
113113

114114
TaskConfig taskConfig = TaskConfig.Config2Task(this);
115-
allInputSS.addAll(JavaConversions.asJavaSet(taskConfig.getInputStreams()));
115+
allInputSS.addAll(JavaConversions.setAsJavaSet(taskConfig.getInputStreams()));
116116
allInputSS.addAll(getBroadcastSystemStreams());
117117

118118
return Collections.unmodifiableSet(allInputSS);

samza-core/src/main/java/org/apache/samza/container/RunLoopFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public Boolean apply(TaskInstance<?> t) {
100100
log.info("Run loop in asynchronous mode.");
101101

102102
return new AsyncRunLoop(
103-
JavaConversions.asJavaMap(asyncStreamTaskInstances),
103+
JavaConversions.mapAsJavaMap(asyncStreamTaskInstances),
104104
threadPool,
105105
consumerMultiplexer,
106106
taskMaxConcurrency,

samza-core/src/main/java/org/apache/samza/task/AsyncRunLoop.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private static Map<SystemStreamPartition, List<AsyncTaskWorker>> getSspToAsyncTa
115115
Map<TaskName, TaskInstance<AsyncStreamTask>> taskInstances, Map<TaskName, AsyncTaskWorker> taskWorkers) {
116116
Map<SystemStreamPartition, List<AsyncTaskWorker>> sspToWorkerMap = new HashMap<>();
117117
for (TaskInstance<AsyncStreamTask> task : taskInstances.values()) {
118-
Set<SystemStreamPartition> ssps = JavaConversions.asJavaSet(task.systemStreamPartitions());
118+
Set<SystemStreamPartition> ssps = JavaConversions.setAsJavaSet(task.systemStreamPartitions());
119119
for (SystemStreamPartition ssp : ssps) {
120120
if (sspToWorkerMap.get(ssp) == null) {
121121
sspToWorkerMap.put(ssp, new ArrayList<AsyncTaskWorker>());
@@ -354,7 +354,7 @@ public void run() {
354354
*/
355355
private Set<SystemStreamPartition> getWorkingSSPSet(TaskInstance<AsyncStreamTask> task) {
356356

357-
Set<SystemStreamPartition> allPartitions = new HashSet<>(JavaConversions.asJavaSet(task.systemStreamPartitions()));
357+
Set<SystemStreamPartition> allPartitions = new HashSet<>(JavaConversions.setAsJavaSet(task.systemStreamPartitions()));
358358

359359
// filter only those SSPs that are not at end of stream.
360360
Set<SystemStreamPartition> workingSSPSet = allPartitions.stream().filter(ssp -> !consumerMultiplexer.isEndOfStream(ssp)).collect(Collectors.toSet());

0 commit comments

Comments
 (0)