@Override
  public List<HCatPartition> getPartitions(String dbName, String tblName)
    throws HCatException {
    List<HCatPartition> hcatPtns = new ArrayList<HCatPartition>();
    try {
      HCatTable hcatTable = getTable(dbName, tblName);
      List<Partition> hivePtns = hmsClient.listPartitions(
        checkDB(dbName), tblName, (short) -1);
      for (Partition ptn : hivePtns) {
        hcatPtns.add(new HCatPartition(hcatTable, ptn));
      }
    } catch (NoSuchObjectException e) {
      throw new ObjectNotFoundException(
        "NoSuchObjectException while retrieving partition.", e);
    } catch (MetaException e) {
      throw new HCatException(
        "MetaException while retrieving partition.", e);
    } catch (TException e) {
      throw new ConnectionFailureException(
        "TException while retrieving partition.", e);
    }
    return hcatPtns;
  }
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