}
return new ZooCacheFactory().getZooCache(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
}
private static SortedMap<String,String> getMap(Instance instance, boolean nameAsKey) {
ZooCache zc = getZooCache(instance);
List<String> tableIds = zc.getChildren(ZooUtil.getRoot(instance) + Constants.ZTABLES);
TreeMap<String,String> tableMap = new TreeMap<String,String>();
Map<String,String> namespaceIdToNameMap = new HashMap<String,String>();
for (String tableId : tableIds) {
byte[] tableName = zc.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_NAME);
byte[] nId = zc.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_NAMESPACE);
String namespaceName = Namespaces.DEFAULT_NAMESPACE;
// create fully qualified table name
if (nId == null) {
namespaceName = null;
} else {