Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka >> mail # dev >> Re: Review Request 14013: Added support for Scala 2.10 builds while maintaining compatibility with 2.8.x


Copy link to this message
-
Re: Review Request 14013: Added support for Scala 2.10 builds while maintaining compatibility with 2.8.x

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14013/#review25977
-----------------------------------------------------------
Overall, this is a great patch. Thanks for contributing it. I have some minor questions/suggestions.
core/build.sbt
<https://reviews.apache.org/r/14013/#comment50698>

    Does Scala 2.10 require scalatest 1.9.1?
    How about Scala 2.9.x ?

core/src/main/scala/kafka/javaapi/Implicits.scala
<https://reviews.apache.org/r/14013/#comment50699>

    Could you please add a comment above this API explaining why we need to do this ? The same one you have in ByteBufferMessageSet.scala

core/src/main/scala/kafka/utils/Pool.scala
<https://reviews.apache.org/r/14013/#comment50700>

    In all other places, we have limited the scope of the JavaConversions import. Could we also do the same here?

project/Build.scala
<https://reviews.apache.org/r/14013/#comment50701>

    This is a cool hack. I think we can get rid of this only if/when we drop support for Scala 2.8.x.
- Neha Narkhede
On Sept. 7, 2013, 11:35 p.m., Christopher Freeman wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/14013/
> -----------------------------------------------------------
>
> (Updated Sept. 7, 2013, 11:35 p.m.)
>
>
> Review request for kafka and Neha Narkhede.
>
>
> Bugs: KAFKA-1046
>     https://issues.apache.org/jira/browse/KAFKA-1046
>
>
> Repository: kafka
>
>
> Description
> -------
>
> This RB contains necessary changes to the kafka source code to support Scala 2.10.x while still maintaining support for Scala 2.8.x
>
> The existing cause of source incompatibility between 2.8.x and 2.10.x was primarily due to the use of implicit conversions in the scala.collection.JavaConversions object.  Many of them where deprecated (and replaced with differently named methods) and the deprecated methods where removed in 2.10.  I avoided the source incompatibility by importing the implicits with a wild card.
>
> Scala annotations moved to a different package in 2.9 and the reference to the old location was removed in 2.10.  I couldn't think of a source compatible way to support both in Annotations.scala so since this source file is very small, I created two copies and configured sbt to use the one appropriate for when building for a particular Scala version.
>
> I also typed many of the catch block case statements with :Throwable.  This change isn't required but starting with Scala 2.9, the compiler will emit warnings if the type is emitted.  Otherwise "case e =>" and case "e: Throwable =>" are equivalent.
>
>
>  
>
>
> Diffs
> -----
>
>   core/build.sbt c54cf44
>   core/src/main/scala/kafka/Kafka.scala dafb1ee
>   core/src/main/scala/kafka/admin/AddPartitionsCommand.scala 5757c32
>   core/src/main/scala/kafka/admin/AdminUtils.scala c399bc7
>   core/src/main/scala/kafka/admin/CreateTopicCommand.scala 21c1186
>   core/src/main/scala/kafka/admin/DeleteTopicCommand.scala 3da4518
>   core/src/main/scala/kafka/admin/ListTopicCommand.scala c760cc0
>   core/src/main/scala/kafka/admin/PreferredReplicaLeaderElectionCommand.scala d5de5f3
>   core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala aa61fa1
>   core/src/main/scala/kafka/client/ClientUtils.scala cc526ec
>   core/src/main/scala/kafka/cluster/Broker.scala b03dea2
>   core/src/main/scala/kafka/consumer/ConsoleConsumer.scala 719beb5
>   core/src/main/scala/kafka/consumer/ConsumerFetcherManager.scala fa6b213
>   core/src/main/scala/kafka/consumer/SimpleConsumer.scala 4395fe3
>   core/src/main/scala/kafka/consumer/TopicCount.scala c8e8406
>   core/src/main/scala/kafka/consumer/ZookeeperConsumerConnector.scala e7a692a
>   core/src/main/scala/kafka/consumer/ZookeeperTopicEventWatcher.scala df83baa
>   core/src/main/scala/kafka/controller/ControllerChannelManager.scala ed1ce0b