1

I'm creating a zookeeper browser for work wherein I want to implement a search function which looks up for some text in all zookeeper nodes and returns matching nodes which have that data.

It works by iterating over all nodes with Java, but it very very resource intensive. Calling lookup function on every node [around 20k of those] consumes around 500mb of RAM.

I'm sure there would be a much better way, can someone share how it could be done more effectively?

Thanks.

testuserx
  • 226
  • 2
  • 13

1 Answers1

0

I'm not sure what type of "text" you're searching for, but most of the operations around service discovery and data retrieving can be done via Curator.

You can get common stats through:

CuratorFramework client = ....
Stat stat = client.checkExists().forPath(path);

Plus, take a look at this thread.

diogo
  • 3,769
  • 1
  • 24
  • 30