{
ZKHelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor(_zkClient));
Builder keyBuilder = accessor.keyBuilder();
InstanceConfig oldConfig =
accessor.getProperty(keyBuilder.instanceConfig(oldInstanceName));
if (oldConfig == null)
{
String error = "Old instance " + oldInstanceName + " does not exist, cannot swap";
_logger.warn(error);
throw new HelixException(error);
}
InstanceConfig newConfig =
accessor.getProperty(keyBuilder.instanceConfig(newInstanceName));
if (newConfig == null)
{
String error = "New instance " + newInstanceName + " does not exist, cannot swap";
_logger.warn(error);