valzkConnectOpt=parser.accepts("zookeeper","REQUIRED: The zookeeper connection string for the kafka zookeeper instance in the form HOST:PORT[/CHROOT].")
valbrokerListOpt=parser.accepts("broker-list","REQUIRED: The broker list string in the form HOST1:PORT1,HOST2:PORT2.")
.withRequiredArg
.describedAs("connection_string")
.describedAs("broker-list")
.ofType(classOf[String])
valsyncOpt=parser.accepts("sync","If set message send requests to the brokers are synchronously, one at a time as they arrive.")
valcompressOpt=parser.accepts("compress","If set, messages batches are sent compressed")
@ -64,21 +75,6 @@ class ProducerPool(val config: ProducerConfig, val zkClient: ZkClient) extends L
@@ -64,21 +75,6 @@ class ProducerPool(val config: ProducerConfig, val zkClient: ZkClient) extends L
}
}
defgetAnyProducer:SyncProducer={
lock.synchronized{
if(syncProducers.size==0){
//refreshthelistofbrokersfromzookeeper
info("No sync producers available. Refreshing the available broker list from ZK and creating sync producers")
@ -88,7 +84,6 @@ class ProducerPool(val config: ProducerConfig, val zkClient: ZkClient) extends L
@@ -88,7 +84,6 @@ class ProducerPool(val config: ProducerConfig, val zkClient: ZkClient) extends L
assert(leaderReplicaOpt.isDefined,"Leader replica for topic %s partition %d".format(topic,partition)+" must exist on leader broker %d".format(logManager.config.brokerId))
assert(leaderReplicaOpt.isDefined,"Leader replica for topic %s partition %d".format(topic,partition)+" must exist on leader broker %d".format(brokerId))
assert(replicaOpt.isDefined,"No replica %d in replica manager on %d".format(fetchRequest.replicaId,replicaManager.config.brokerId))
assert(replicaOpt.isDefined,"No replica %d in replica manager on %d".format(fetchRequest.replicaId,brokerId))
valreplica=replicaOpt.get
debug("leader [%d] for topic [%s] partition [%d] received fetch request from follower [%d]".format(logManager.config.brokerId,replica.topic,replica.partition.partitionId,fetchRequest.replicaId))
debug("Leader %d returning %d messages for topic %s partition %d to follower %d".format(logManager.config.brokerId,messages.sizeInBytes,replica.topic,replica.partition.partitionId,fetchRequest.replicaId))
debug("leader [%d] for topic [%s] partition [%d] received fetch request from follower [%d]".format(brokerId,replica.topic,replica.partition.partitionId,fetchRequest.replicaId))
debug("Leader %d returning %d messages for topic %s partition %d to follower %d".format(brokerId,messages.sizeInBytes,replica.topic,replica.partition.partitionId,fetchRequest.replicaId))
@ -30,7 +32,7 @@ class KafkaConfig(props: Properties) extends ZKConfig(props) {
@@ -30,7 +32,7 @@ class KafkaConfig(props: Properties) extends ZKConfig(props) {
valport:Int=Utils.getInt(props,"port",6667)
/* hostname of broker. If not set, will pick up from the value returned from getLocalHost. If there are multiple interfaces getLocalHost may not be what you want. */
warn("during initializing leader of parition (%s, %d), assigned replicas are [%s], live brokers are [%s], no assigned replica is alive".format(topicPartition._1,topicPartition._2,replicaAssignment,allBrokerIds))
warn("during initializing leader of parition (%s, %d), assigned replicas are [%s], live brokers are [%s], no assigned replica is alive".format(topicPartition._1,topicPartition._2,replicaAssignment.mkString(","),allBrokerIds))
@ -261,9 +261,6 @@ class ZookeeperConsumerConnectorTest extends JUnit3Suite with KafkaServerTestHar
@@ -261,9 +261,6 @@ class ZookeeperConsumerConnectorTest extends JUnit3Suite with KafkaServerTestHar
@ -376,11 +373,10 @@ class ZookeeperConsumerConnectorTest extends JUnit3Suite with KafkaServerTestHar
@@ -376,11 +373,10 @@ class ZookeeperConsumerConnectorTest extends JUnit3Suite with KafkaServerTestHar
@ -392,20 +388,20 @@ class ZookeeperConsumerConnectorTest extends JUnit3Suite with KafkaServerTestHar
@@ -392,20 +388,20 @@ class ZookeeperConsumerConnectorTest extends JUnit3Suite with KafkaServerTestHar
@ -42,7 +42,6 @@ class AutoOffsetResetTest extends JUnit3Suite with KafkaServerTestHarness with L
@@ -42,7 +42,6 @@ class AutoOffsetResetTest extends JUnit3Suite with KafkaServerTestHarness with L
@ -70,7 +69,7 @@ class AutoOffsetResetTest extends JUnit3Suite with KafkaServerTestHarness with L
@@ -70,7 +69,7 @@ class AutoOffsetResetTest extends JUnit3Suite with KafkaServerTestHarness with L
@ -104,7 +104,7 @@ class PrimitiveApiTest extends JUnit3Suite with ProducerConsumerTestHarness with
@@ -104,7 +104,7 @@ class PrimitiveApiTest extends JUnit3Suite with ProducerConsumerTestHarness with
@ -131,7 +131,7 @@ class PrimitiveApiTest extends JUnit3Suite with ProducerConsumerTestHarness with
@@ -131,7 +131,7 @@ class PrimitiveApiTest extends JUnit3Suite with ProducerConsumerTestHarness with
@ -72,7 +72,7 @@ class ZookeeperConsumerConnectorTest extends JUnit3Suite with KafkaServerTestHar
@@ -72,7 +72,7 @@ class ZookeeperConsumerConnectorTest extends JUnit3Suite with KafkaServerTestHar
@ -54,7 +55,8 @@ class KafkaLog4jAppenderTest extends JUnit3Suite with ZooKeeperTestHarness with
@@ -54,7 +55,8 @@ class KafkaLog4jAppenderTest extends JUnit3Suite with ZooKeeperTestHarness with
@ -108,7 +110,7 @@ class KafkaLog4jAppenderTest extends JUnit3Suite with ZooKeeperTestHarness with
@@ -108,7 +110,7 @@ class KafkaLog4jAppenderTest extends JUnit3Suite with ZooKeeperTestHarness with
@ -124,7 +126,7 @@ class KafkaLog4jAppenderTest extends JUnit3Suite with ZooKeeperTestHarness with
@@ -124,7 +126,7 @@ class KafkaLog4jAppenderTest extends JUnit3Suite with ZooKeeperTestHarness with
@ -137,7 +139,7 @@ class KafkaLog4jAppenderTest extends JUnit3Suite with ZooKeeperTestHarness with
@@ -137,7 +139,7 @@ class KafkaLog4jAppenderTest extends JUnit3Suite with ZooKeeperTestHarness with
@ -160,7 +162,7 @@ class KafkaLog4jAppenderTest extends JUnit3Suite with ZooKeeperTestHarness with
@@ -160,7 +162,7 @@ class KafkaLog4jAppenderTest extends JUnit3Suite with ZooKeeperTestHarness with