static boolean verifyBestPossAndExtView(HelixDataAccessor accessor,
Map<String, Map<String, String>> errStates)
{
try
{
Builder keyBuilder = accessor.keyBuilder();
// read cluster once and do verification
ClusterDataCache cache = new ClusterDataCache();
cache.refresh(accessor);
Map<String, IdealState> idealStates = cache.getIdealStates();
if (idealStates == null) // || idealStates.isEmpty())
{
// ideal state is null because ideal state is dropped
idealStates = Collections.emptyMap();
}
Map<String, ExternalView> extViews =
accessor.getChildValuesMap(keyBuilder.externalViews());
if (extViews == null) // || extViews.isEmpty())
{
extViews = Collections.emptyMap();
}