-Re: newbie question: how to save a file using zookeeper
Cameron McKenzie 2014-05-19, 21:53
via zkCli.sh you can easily save a string as a value using the create
create /testdir "this is a string"
As far as loading a file into a zNode, it's just a matter of reading the
file into an array of bytes and then creating the zNode with that array of
bytes. I haven't used the native zookeeper client, but it's simple enough
with Apache Curator.
CuratorFramework curator = ... //Initialise your client
byte fileContents = readFileContent();
To read the data out
byte fileContents = curator.getData().forPath("/testdir");
On Mon, May 19, 2014 at 4:17 PM, xytd <[EMAIL PROTECTED]> wrote: