MountTableResolver implements FileSubclusterResolver, StateStoreCache { @Override public PathLocation getDestinationForPath(final String path) throws IOException { verifyMountTable(); readLock.lock(); try { if (this.locationCache == null) { return lookupLocation(path); } Callable<? extends PathLocation> meh = new Callable<PathLocation>() { @Override public PathLocation call() throws Exception { return lookupLocation(path); } }; return this.locationCache.get(path, meh); } catch (ExecutionException e) { Throwable cause = e.getCause(); final IOException ioe; if (cause instanceof IOException) { ioe = (IOException) cause; } else { ioe = new IOException(cause); } throw ioe; } finally { readLock.unlock(); } } @VisibleForTesting  MountTableResolver(Configuration conf);  MountTableResolver(Configuration conf, Router routerService);  MountTableResolver(Configuration conf, StateStoreService store);  MountTableResolver(Configuration conf, Router routerService,
      StateStoreService store); void addEntry(final MountTable entry); void removeEntry(final String srcPath); @VisibleForTesting void refreshEntries(final Collection<MountTable> entries); @Override boolean loadCache(boolean force); void clear(); @Override PathLocation getDestinationForPath(final String path); PathLocation lookupLocation(final String str); MountTable getMountPoint(final String path); @Override List<String> getMountPoints(final String str); List<MountTable> getMounts(final String path); @Override String toString(); @Override String getDefaultNamespace(); @VisibleForTesting String getDefaultNameService(); @VisibleForTesting void setDefaultNameService(String defaultNameService); @VisibleForTesting boolean isDefaultNSEnable(); @VisibleForTesting void setDefaultNSEnable(boolean defaultNSRWEnable); @VisibleForTesting void setDisabled(boolean disable);  }
@Test public void testMuiltipleDestinations() throws IOException { try { mountTable.getDestinationForPath("/multi"); fail("The getDestinationForPath call should fail."); } catch (IOException ioe) { GenericTestUtils.assertExceptionContains( "MountTableResolver should not resolve multiple destinations", ioe); } }