hey Yogesh, You can encode the data into any format you want and store it in the zNode, it's just stored as an array of bytes. So, you could encode your multiple data items into key value pairs separated by newlines, or use some other similar scheme. When you pull the data out of the zNode you'd need to decode it again. cheers
On Thu, Nov 13, 2014 at 4:37 PM, Yogesh Patil <[email protected]> wrote: > Hi, > Pardon me if this turns out to be too silly a question. > > My understanding of znode and data at that node was: like UNIX file stores > data spanning multiple lines, znode can also have multiple data values. > However it seems that was wrong. > > I ran following set of commands and I could see that each znode can only > store one data unit (say some string). > > [zk: 192.168.0.1:2181(CONNECTED) 15] set /Controller1 IP=192.168.0.1 > [zk: 192.168.0.1:2181(CONNECTED) 16] get /Controller1 > IP=192.168.0.1 > > [zk: 192.168.0.1:2181(CONNECTED) 15] set /Controller1 port=6655 > [zk: 192.168.0.1:2181(CONNECTED) 16] get /Controller1 > port=6655 <<<<< See data field 'IP' is lost and overwritten by port data > > does that mean I have to create one znode for every type of data that I > want to store?? > i.e. > [zk: 192.168.0.1:2181(CONNECTED) 15] set /Controller1/IP 192.168.0.1 > [zk: 192.168.0.1:2181(CONNECTED) 15] set /Controller1/port 6655 > > Kindly let me know if I am missing something here. > > > > > Thanks, > Yogesh Patil > > Graduate Student > University of Florida >
