You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@helix.apache.org by Vinayak Borkar <vi...@gmail.com> on 2014/01/30 14:20:18 UTC

Querying cluster state

Hi,


Is there a way I can query the current state of the cluster to know if 
it is currently enabled or disabled (using the 
HelixAdmin.enableCluster(...) call)?

Thanks,
Vinayak

RE: Querying cluster state

Posted by Kanak Biscuitwala <ka...@hotmail.com>.
It doesn't seem possible through HelixAdmin; you'll probably need to use HelixDataAccessor:
HelixDataAccessor accessor = manager.getHelixDataAccessor();PropertyKey key = accessor.keyBuilder.pause();boolean enabled = accessor.getProperty(key) != null;
or the more efficient version:
boolean enabled = accessor.getBaseDataAccessor().exists(key.getPath(), 0);
Kanak

> Date: Thu, 30 Jan 2014 05:20:18 -0800
> From: vinayakb@gmail.com
> To: user@helix.incubator.apache.org
> Subject: Querying cluster state
> 
> Hi,
> 
> 
> Is there a way I can query the current state of the cluster to know if 
> it is currently enabled or disabled (using the 
> HelixAdmin.enableCluster(...) call)?
> 
> Thanks,
> Vinayak