@Override
  public HCatTable getTable(String dbName, String tableName)
    throws HCatException {
    HCatTable table = null;
    try {
      Table hiveTable = hmsClient.getTable(checkDB(dbName), tableName);
      if (hiveTable != null) {
        table = new HCatTable(hiveTable);
      }
    } catch (MetaException e) {
      throw new HCatException("MetaException while fetching table.", e);
    } catch (NoSuchObjectException e) {
      throw new ObjectNotFoundException(
        "NoSuchObjectException while fetching table.", e);
    } catch (TException e) {
      throw new ConnectionFailureException(
          "TException while fetching table.", e);
    }
    return table;
  }
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