helix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep Nayak <osgig...@gmail.com>
Subject HelixAdmin API Usage
Date Wed, 19 Feb 2014 06:15:53 GMT
Hi,

Prior to adding an instance config to a cluster I am trying to check if
there exists such a configuration already using
ZKHelixAdmin.getInstanceConfig. I found that it throws a RuntimeException
as against returning a null or throwing a checked exception.

I think the use-case of wanting to know if an instance is already existent
in the cluster and if not adding one seems common. Throwing a
RuntimeException indicates a condition that the system cannot handle, a
checked exception on the other hand would be more appropriate so that the
invoker of getInstanceConfig can take an action to remedy the lack of
configuration by creating it.

Is there a reason for the RuntimeException?

Thanks,

Sandeep

Mime
View raw message