try
{
HelixDataAccessor accessor = new ZKHelixDataAccessor( _clusterName, new ZkBaseDataAccessor(_client));
Builder keyBuilder = accessor.keyBuilder();
int numberOfPartitions = accessor.getProperty(keyBuilder.idealStates(_resourceName)).getRecord().getListFields().size();
ClusterDataCache cache = new ClusterDataCache();
cache.refresh(accessor);
String masterValue = cache.getStateModelDef(cache.getIdealState(_resourceName).getStateModelDefRef()).getStatesPriorityList().get(0);
int replicas = Integer.parseInt(cache.getIdealState(_resourceName).getReplicas());
String instanceGroupTag = cache.getIdealState(_resourceName).getInstanceGroupTag();
int instances = 0;
for(String liveInstanceName : cache.getLiveInstances().keySet())
{
if(cache.getInstanceConfigMap().get(liveInstanceName).containsTag(instanceGroupTag))
{
instances ++;
}
}
if(instances == 0)
{
instances = cache.getLiveInstances().size();
}
return verifyBalanceExternalView(accessor.getProperty(keyBuilder.externalView(_resourceName)).getRecord(), numberOfPartitions, masterValue, replicas, instances);
}
catch(Exception e)
{