@Override
  public List<String> listTableNamesByPattern(String dbName,
                        String tablePattern) throws HCatException {
    List<String> tableNames = null;
    try {
      tableNames = hmsClient.getTables(checkDB(dbName), tablePattern);
    } catch (MetaException e) {
      throw new HCatException("MetaException while fetching table names. " + e.getMessage(), e);
    } catch (UnknownDBException e) {
      throw new HCatException("UnknownDB " + dbName + " while fetching table names.", e);
    } catch (TException e) {
      throw new HCatException("Transport exception while fetching table names. "
          + e.getMessage(), e);
    }
    return tableNames;
  }
The HCatClientHMSImpl is the Hive Metastore client based implementation of
HCatClient.
hcatalog/webhcat/java-client/src/main/java/org/apache/hive/hcatalog/api/HCatClientHMSImpl.java