Skip to content

Commit

Permalink
KAFKA-808 Migration tool internal queue between consumer and producer…
Browse files Browse the repository at this point in the history
… threads should be configurable; reviewed by Jun Rao
  • Loading branch information
nehanarkhede committed Mar 15, 2013
1 parent 3b3fb7f commit 7fd9268
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/src/main/scala/kafka/tools/KafkaMigrationTool.java
Expand Up @@ -134,6 +134,13 @@ public static void main(String[] args) throws InterruptedException, IOException
.describedAs("Java regex (String)")
.ofType(String.class);

ArgumentAcceptingOptionSpec<Integer> queueSizeOpt
= parser.accepts("queue.size", "Number of messages that are buffered between the 0.7 consumer and 0.8 producer")
.withRequiredArg()
.describedAs("Queue size in terms of number of messages")
.ofType(Integer.class)
.defaultsTo(10000);

OptionSpecBuilder helpOpt
= parser.accepts("help", "Print this message.");

Expand Down Expand Up @@ -212,7 +219,8 @@ public static void main(String[] args) throws InterruptedException, IOException
kafkaProducerProperties_08.load(new FileInputStream(producerConfigFile_08));
kafkaProducerProperties_08.setProperty("serializer.class", "kafka.serializer.DefaultEncoder");
// create a producer channel instead
ProducerDataChannel<KeyedMessage<String, byte[]>> producerDataChannel = new ProducerDataChannel<KeyedMessage<String, byte[]>>(numProducers);
int queueSize = options.valueOf(queueSizeOpt);
ProducerDataChannel<KeyedMessage<String, byte[]>> producerDataChannel = new ProducerDataChannel<KeyedMessage<String, byte[]>>(queueSize);
int threadId = 0;

Runtime.getRuntime().addShutdownHook(new Thread() {
Expand Down

0 comments on commit 7fd9268

Please sign in to comment.