@SuppressWarnings({ "rawtypes", "unchecked" })
  public static <T> T runAsLoginUser(PrivilegedExceptionAction<T> action) throws IOException {
    try {
      Class c = Class.forName("org.apache.hadoop.security.SecurityUtil");
      Class[] types = new Class[] { PrivilegedExceptionAction.class };
      Object[] args = new Object[] { action };
      return (T) Methods.call(c, null, "doAsLoginUser", types, args);
    } catch (Throwable e) {
      throw new IOException(e);
    }
  }
Executes the given action as the login user
hbase-common/src/main/java/org/apache/hadoop/hbase/security/User.java