public ArrayList<String> getTablesByPattern(DB parent, String tablePattern) throws MetaException {
ArrayList<String> names = new ArrayList<String> ();
if(tablePattern == null || tablePattern.length() == 0) {
throw new MetaException("Empty table name");
}
tablePattern += ".dir$";
Pattern tpat = Pattern.compile(tablePattern);
File msPath = getDBDir(parent.getName());
String tpaths[] = msPath.list();
if(tpaths == null) {
LOG.fatal("Internal fatal err - bad db dir: " + msPath);
throw new MetaException("Internal fatal err - bad db dir: " + msPath);
}
for(int i = 0; tpaths != null && i < tpaths.length; i++) {
Matcher m = tpat.matcher(tpaths[i]);
if(m.matches()) {