private  boolean constraintNameAlreadyExists(MTable table, String constraintName) {
    boolean commited = false;
    Query<MConstraint> constraintExistsQuery = null;
    String constraintNameIfExists = null;
    try {
      openTransaction();
      constraintName = normalizeIdentifier(constraintName);
      constraintExistsQuery = pm.newQuery(MConstraint.class,
          "parentTable == parentTableP && constraintName == constraintNameP");
      constraintExistsQuery.declareParameters("MTable parentTableP, java.lang.String constraintNameP");
      constraintExistsQuery.setUnique(true);
      constraintExistsQuery.setResult("constraintName");
      constraintNameIfExists = (String) constraintExistsQuery.executeWithArray(table, constraintName);
      commited = commitTransaction();
    } finally {
      rollbackAndCleanup(commited, constraintExistsQuery);
    }
    return constraintNameIfExists != null && !constraintNameIfExists.isEmpty();
  }
Called right before an action that would drop a storage descriptor.
This function makes the SD's reference to a CD null, and then deletes the CD
if it no longer is referenced in the table.
@param msd the storage descriptor to drop
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java