I'd like to create a distributed unique int key with zookeeper sequential
String file = zooKeeper.create( folderPath + "/0", new byte,
String sequence = file.substring(file.lastIndexOf("/")+1);
int id = Integer.parseInt( sequence );
It works fine, even though the sequence number may not be adjacent.
However, I'd like to have the key to start at a certain value,
say 1000, as the ids under 1000 has been in use. Currently I will have to
call this function until it generates an id greater than 1000. Is there a
way in zooKeeper to set the starting value of the created sequence?
Camille Fournier 2011-11-15, 03:29
Patrick Hunt 2011-11-15, 04:57