public Set<String> getFunctionNames(Pattern funcPattern) {
    lock.lock();
    try {
      Set<String> funcNames = new TreeSet<String>();
      for (String funcName : mFunctions.keySet()) {
        if (funcName.contains(WINDOW_FUNC_PREFIX)) {
          continue;
        }
        if (funcPattern == null || funcPattern.matcher(funcName).matches()) {
          funcNames.add(funcName);
        }
      }
      return funcNames;
    } finally {
      lock.unlock();
    }
  }
Returns a set of registered function names. This is used for the CLI
command "SHOW FUNCTIONS 'regular expression';" Returns an empty set when
the regular expression is not valid.

@param funcPattern regular expression of the interested function names
@return set of strings contains function names
ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java