Skip to content

Commit 01a33b1

Browse files
committed
KAFKA-55: Create SBT sub projects for perf, examples, contrib that are currently using ant
1 parent 737b5ad commit 01a33b1

File tree

220 files changed

+193
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+193
-260
lines changed

bin/kafka-run-class.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fi
88

99
base_dir=$(dirname $0)/..
1010

11-
for file in $base_dir/target/scala_2.8.0/*.jar;
11+
for file in $base_dir/core/target/scala_2.8.0/*.jar;
1212
do
1313
CLASSPATH=$CLASSPATH:$file
1414
done
@@ -20,7 +20,7 @@ do
2020
fi
2121
done
2222

23-
for file in $base_dir/lib_managed/scala_2.8.0/compile/*.jar;
23+
for file in $base_dir/core/lib_managed/scala_2.8.0/compile/*.jar;
2424
do
2525
if [ ${file##*/} != "sbt-launch.jar" ]; then
2626
CLASSPATH=$CLASSPATH:$file

contrib/hadoop-consumer/README

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ SimpleKafkaETLJob sets up job properties and files Hadoop job.
2727
SimpleKafkaETLMapper dumps kafka data into hdfs.
2828

2929
HOW TO RUN:
30-
1. Complile using "ant" and you will see kafka-etl-contrib-<version>.jar
31-
under $KAFKA_ROOT/dist.
30+
1. Complile using "sbt" to create a package for hadoop consumer code.
31+
./sbt
32+
project hadoop consumer
33+
package-all
3234

3335
2. Produce test events in server and generate offset files
3436
1) Start kafka server [ Follow the quick start -

contrib/hadoop-consumer/build.xml

-62
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-522 KB
Binary file not shown.

contrib/hadoop-consumer/run-class.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ fi
99
base_dir=$(dirname $0)/../..
1010

1111
# include kafka jars
12-
for file in $base_dir/dist/*.jar;
12+
for file in $base_dir/core/target/scala_2.8.0/*.jar;
1313
do
1414
CLASSPATH=$CLASSPATH:$file
1515
done
1616

17-
for file in $base_dir/lib/*.jar;
17+
for file in $base_dir/contrib/hadoop-consumer/lib_managed/scala_2.8.0/compile/*.jar;
1818
do
1919
CLASSPATH=$CLASSPATH:$file
2020
done
@@ -23,11 +23,13 @@ done
2323
local_dir=$(dirname $0)
2424

2525
# include hadoop-consumer jars
26-
for file in $local_dir/lib/*.jar;
26+
for file in $base_dir/contrib/hadoop-consumer/target/scala_2.8.0/*.jar;
2727
do
2828
CLASSPATH=$CLASSPATH:$file
2929
done
3030

31+
echo $CLASSPATH
32+
3133
CLASSPATH=dist:$CLASSPATH:${HADOOP_HOME}/conf
3234

3335
#if [ -z "$KAFKA_OPTS" ]; then

contrib/hadoop-consumer/src/java/kafka/etl/KafkaETLContext.java contrib/hadoop-consumer/src/main/java/kafka/etl/KafkaETLContext.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,19 @@ public KafkaETLContext(JobConf job, Props props, Reporter reporter,
108108

109109
public boolean hasMore () {
110110
return _messageIt != null && _messageIt.hasNext()
111-
|| _response != null && _response.hasNext()
111+
|| _response != null && _response.iterator().hasNext()
112112
|| _offset < _offsetRange[1];
113113
}
114114

115115
public boolean getNext(KafkaETLKey key, BytesWritable value) throws IOException {
116116
if ( !hasMore() ) return false;
117117

118118
boolean gotNext = get(key, value);
119-
120-
while ( !gotNext && _response != null && _response.hasNext()) {
121-
ByteBufferMessageSet msgSet = _response.next();
119+
120+
Iterator<ByteBufferMessageSet> iter = _response.iterator();
121+
122+
while ( !gotNext && _response != null && iter.hasNext()) {
123+
ByteBufferMessageSet msgSet = iter.next();
122124
if ( hasError(msgSet)) return false;
123125
_messageIt = (Iterator<Message>) msgSet.iterator();
124126
gotNext = get(key, value);

contrib/hadoop-producer/build.xml

-60
This file was deleted.
-555 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-2.13 MB
Binary file not shown.
File renamed without changes.
File renamed without changes.

examples/README

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ messages from Kafka server.
55

66
In order to run demo:
77
1. Start Zookeeper and the Kafka server
8-
2. Run 'ant' from inside the java directory
8+
2. ./sbt from top-level kafka directory
9+
3. Switch to the kafka java examples project -> project Kafka Java Examples
10+
4. execute run -> run
11+
5. For unlimited producer-consumer run, select option 1
12+
For simple consumer demo, select option 2

examples/java/build.xml

-33
This file was deleted.

lib/scala-compiler-2.8.0.jar

-8.27 MB
Binary file not shown.

lib/scala-library-2.8.0.jar

-5.88 MB
Binary file not shown.

lib/zkclient-0.1.0.jar

-95 KB
Binary file not shown.

lib/zookeeper-3.3.3.jar

-1000 KB
Binary file not shown.

perf/README.md

+3-1

perf/build.xml

-35
This file was deleted.

perf/run-simulator.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ do
1515
CLASSPATH=$CLASSPATH:$file
1616
fi
1717
done
18-
for file in $base_dir/lib_managed/scala_2.8.0/compile/*.jar;
18+
for file in $base_dir/core/lib_managed/scala_2.8.0/compile/*.jar;
1919
do
2020
CLASSPATH=$CLASSPATH:$file
2121
done
22-
for file in $base_dir/target/scala_2.8.0/*.jar;
22+
for file in $base_dir/core/target/scala_2.8.0/*.jar;
2323
do
2424
CLASSPATH=$CLASSPATH:$file
2525
done
26-
for file in $base_dir/dist/*.jar;
26+
for file in $base_dir/perf/target/scala_2.8.0/*.jar;
2727
do
2828
CLASSPATH=$CLASSPATH:$file
2929
done

0 commit comments

Comments
 (0)