public <T> Map<String, T> selectProperties(String key, java.util.function.Function<MMetastoreDBProperties, T> transform) {
    boolean success = false;
    Query<MMetastoreDBProperties> query = null;
    Map<String, T> results = null;
    try {
      if (openTransaction()) {
        Collection<MMetastoreDBProperties> properties;
        if (key == null || key.isEmpty()) {
          query = pm.newQuery(MMetastoreDBProperties.class);
          properties = (Collection<MMetastoreDBProperties>) query.execute();
        } else {
          query = pm.newQuery(MMetastoreDBProperties.class, "this.propertyKey.startsWith(key)");
          query.declareParameters(PTYPARAM_STR_KEY);
          properties = (Collection<MMetastoreDBProperties>) query.execute(key);
        }
        pm.retrieveAll(properties);
        if (!properties.isEmpty()) {
          results = new TreeMap<String, T>();
          for(MMetastoreDBProperties ptys : properties) {
            T t = (T) (transform != null? transform.apply(ptys) : ptys);
            if (t != null) {
              results.put(ptys.getPropertykey(), t);
            }
          }
        }
        success = commitTransaction();
      }
    } finally {
      rollbackAndCleanup(success, query);
    }
    return results;
  }
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