Tuesday, February 10, 2015

Build Apache Kafka on Eclipse and Run Unit Tests

Earlier I tried to build Kafka by following the Developer Setup wiki link. But it was not successful due to several build error.

The same Developer Setup wiki has a link to Eclipse-Scala-Gradle-Git Developement Environment Setup page, by following the instruction on this page I was able to build and run Scala unit test without any problem.


The Following steps needs to be followed: 

* I downloaded the latest "kafka-trunk.zip" from GitHub and extracted it.
* Edit /kafka/gradle.properties
   Change to scalaVersion=2.11 from scalaVersion=2.10.4


Go to Eclipses > Help > Install New Software and install following plug-ins.

http://download.scala-ide.org/sdk/lithium/e44/scala211/stable/site 

http://dist.springsource.com/release/TOOLS/update/e4.4/
   (Above link details also available in Spring Tool Suite™ Downloads)

Import the Kafka Project

1 File > Import > Select Gradle Project.

2. In the next dialog, browse the Kafka project folder and Click "Build Model" button then it will start downloading necessary files and build the project. Once the build is completed, it will show all the Kafka projects.

3. Select All the projects and press Finish.


My Developer Environment Details:
  •  Ubuntu 14.04 LTS
  •  Java version "1.7.0_71"
  • eclipse-jee-luna-SR1a-linux-gtk-x86_64

Build Related Issues:

Friday, February 6, 2015

Wednesday, February 4, 2015

Build Apache Kafka

mahesh@hd-mahesh:~$ ./gradlew srcJar
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain


mahesh@hd-mahesh:~$ ./gradlew jar
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

you will get above errors if straight away execute the "./gradlew srcJar" or "./gradlew jar".

Type the followng it will bootstrap and download the wrapper.
gradle wrap
./gradlew clean



A successful build output.

mahesh@hd-mahesh:~$ ./gradlew srcJar
Downloading https://services.gradle.org/distributions/gradle-2.2.1-bin.zip
 

Unzipping /home/mahesh/.gradle/wrapper/dists/gradle-2.2.1-bin/88n1whbyjvxg3s40jzz5ur27/gradle-2.2.1-bin.zip to /home/mahesh/.gradle/wrapper/dists/gradle-2.2.1-bin/88n1whbyjvxg3s40jzz5ur27
Set executable permissions for: /home/mahesh/.gradle/wrapper/dists/gradle-2.2.1-bin/88n1whbyjvxg3s40jzz5ur27/gradle-2.2.1/bin/gradle
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html.
Building project 'core' with Scala version 2.10.4
:clients:srcJar
:contrib:srcJar
:core:srcJar
:examples:srcJar
:contrib:hadoop-consumer:srcJar
:contrib:hadoop-producer:srcJar

BUILD SUCCESSFUL

Total time: 5 mins 3.677 secs



All the above information is available in following URI:
https://github.com/apache/kafka/tree/trunk

Monday, February 2, 2015

Scala - Scalable Language

Expression Oriented Coding

Concise and Expressive
  • Scala will cut down your written code up to 60%.
  • Most of the design patters are build into  the language. This will allow you to focus on the problem itself. 
Java Interoperability
  • Scala compile into Java bite code
Reactive
  • Scalable
  • Resilient
  • Responsive
  • Event Driven
The Reactive Manifesto