Hi, guys,
I am trying to use PathChildrenCache to set up a watcher on a ZK path, so
when any children is added to the path, I will get a watcher event.

My client logic is in the watcher event, do getData().getData() to get the
children's data. This is working for me. The question is can I always relay
on this or should I have a backup option if data is a empty byte[], I still
retrieval data based on child's path ?

My logic in watcher event is:

if (data.length != 0) {
    //do the following logic
} else {
    byte[] data = client.getData().forPatch(childPath);
    // do the following logic
}

do I need the else block ? Let me know if need more code explanation.

Thanks,
Johnny

Reply via email to