if (LOG.isDebugEnabled()) {
LOG.debug(MessageFormat.format(
"Building join-table from \"{0}\" on distributed cache",
getCacheName()));
}
StageResourceDriver driver = new StageResourceDriver(configuration);
try {
List<Path> paths = driver.findCache(getCacheName());
if (paths.isEmpty()) {
throw new FileNotFoundException(MessageFormat.format(
"Missing resource \"{0}\" in distributed cache",
getCacheName()));
}
if (LOG.isDebugEnabled()) {
LOG.debug(MessageFormat.format(
"Building join table \"{0}\" using \"{1}\"",
getCacheName(),
paths));
}
try {
table = createTable(driver, paths);
} catch (IOException e) {
throw new IOException(MessageFormat.format(
"Failed to build a join table from \"{0}\"",
getCacheName()), e);
}
if (LOG.isDebugEnabled()) {
LOG.debug(MessageFormat.format(
"Built join-table from \"{0}\"",
getCacheName()));
}
} finally {
driver.close();
}
}