Hi Sandeep, Mostly for compatibility and historical reasons. Also, many Helix systems typically run HelixAdmin via the REST or command line API, so in those cases, a loud failure is more natural.
We've wanted to add checked exceptions for some time now, but haven't had the cycles to take the time and really get it right. Kanak ________________________________ > Date: Tue, 18 Feb 2014 22:15:53 -0800 > Subject: HelixAdmin API Usage > From: [email protected] > To: [email protected] > > 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
