static <T> int loopJoinOrderedResult(PersistenceManager pm, TreeMap<Long, T> tree,
      String queryText, int keyIndex, ApplyFunc<T> func) throws MetaException {
    return loopJoinOrderedResult(pm, tree, queryText, null, keyIndex, func);
  }
Helper utilities used by DirectSQL code in HiveMetastore.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDirectSqlUtils.java