[solved]. zkClient needs a serializer. This is the final code:
ZkClient zkClient = new ZkClient(zookeeperCluster, 3, 3);
zkClient.setZkSerializer(new ZkSerializer() {
@Override
public byte[] serialize(Object o)
throws ZkMarshallingError
{
return ZKStri
Nope... i have checked this and replication factor is 1. Anyway, when i
tried to increase this param, an exception is thrown (rep. factor greater
than num. of brokers).
There is no difference in this code and the script, apparently, i can only
see changes in the constructor used in zkClient.
Any
David,
Topic creation can fail if you specify the replication factor > # of
brokers in the cluster. Can you check if that is true in your case?
Unfortunately, I don't think we fail the createTopic() API with the
appropriate exception since there is still a race condition where the
broker can come
This is the code that i can see in CreateTopicCommand
var zkClient: ZkClient = null
try {
zkClient = new ZkClient(zkConnect, 3, 3, ZKStringSerializer)
createTopic(zkClient, topic, nPartitions, replicationFactor,
replicaAssignmentStr)
println("creation succeeded!")
Is the ZK connection string + namespace the same btw the code and the
script?
Thanks,
Jun
On Tue, Feb 25, 2014 at 3:01 AM, David Morales de Frías <
dmora...@paradigmatecnologico.com> wrote:
> Hi there,
>
> I'm trying to create a topic from java code, by calling CreateTopicCommand:
>
>
> *ZkCli
Hi there,
I'm trying to create a topic from java code, by calling CreateTopicCommand:
*ZkClient zkClient = new ZkClient(zookeeperCluster, 3, 3);*
*CreateTopicCommand.createTopic(zkClient, topic,
numPartitions.intValue(),replicationFactor.intValue(), "");*
*zkClient.close();*
The prog