Github user JamesRTaylor commented on the pull request:
https://github.com/apache/phoenix/pull/12#issuecomment-55556203
Other more detailed advice. Simplify this and don't catch all exceptions.
```
try {
if (table.getColumnFamilies().isEmpty() ||
scan.getFamilyMap().isEmpty()) {
// For sure we can get the defaultCF from the table
gps = table.getTableStats().getGuidePosts().get(defaultCF);
} else {
if (scan.getFamilyMap().containsKey(defaultCF)) { // Favor
using default CF if it's used in scan
gps = table.getColumnFamily(defaultCF).getGuidePosts();
} else { // Otherwise, just use first CF in use by scan
gps =
table.getColumnFamily(scan.getFamilyMap().keySet().iterator().next()).getGuidePosts();
}
}
} catch (ColumnFamilyNotFoundException cfne) { // Don't catch all
exceptions here
logger.error("Error while getting guideposts for the cf " +
Bytes.toString(defaultCF));
}
if (gps == null) {
return regions;
}
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---