public static synchronized TabletLocator getLocator(Instance instance, Text tableId) {
LocatorKey key = new LocatorKey(instance.getInstanceID(), tableId);
TabletLocator tl = locators.get(key);
if (tl == null) {
MetadataLocationObtainer mlo = new MetadataLocationObtainer(instance);
if (tableId.toString().equals(RootTable.ID)) {
tl = new RootTabletLocator(instance, new ZookeeperLockChecker(instance));
} else if (tableId.toString().equals(MetadataTable.ID)) {
tl = new TabletLocatorImpl(new Text(MetadataTable.ID), getLocator(instance, new Text(RootTable.ID)), mlo, new ZookeeperLockChecker(instance));