Skip to content

Instantly share code, notes, and snippets.

@gustavoanatoly
Created November 5, 2012 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gustavoanatoly/4017977 to your computer and use it in GitHub Desktop.
Save gustavoanatoly/4017977 to your computer and use it in GitHub Desktop.
DirFilter Exception Refactor
public boolean accept(Path p) {
boolean isValid = false;
try {
if (HConstants.HBASE_NON_USER_TABLE_DIRS.contains(p.toString())) {
isValid = false;
} else {
isValid = this.fs.getFileStatus(p).isDir();
}
} catch (IOException e) {
String nonUserTableDirs = HConstants.HBASE_NON_USER_TABLE_DIRS.toString();
LOG.warn("The path: [" + p.toString() + "] is on the directories list not allowed: " + nonUserTableDirs, e);
}
return isValid;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment