ZkClient zkClient = new ZkClient(zkAddr);
zkClient.setZkSerializer(new ZNRecordSerializer());
try
{
ZKHelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor(zkClient));
Builder keyBuilder = accessor.keyBuilder();
for (String resGroupPartitionKey : stateMap.keySet())
{
Map<String, String> retMap = getResourceAndPartitionKey(resGroupPartitionKey);
String resGroup = retMap.get("RESOURCE");
String partitionKey = retMap.get("PARTITION");
ExternalView extView = accessor.getProperty(keyBuilder.externalView(resGroup));
for (String instance : stateMap.get(resGroupPartitionKey))
{
String actualState = extView.getStateMap(partitionKey).get(instance);
Assert.assertNotNull(actualState, "externalView doesn't contain state for "
+ resGroup + "/" + partitionKey + " on " + instance + " (expect " + state