public static User getActiveUser() throws IOException {
    Optional<User> optionalUser = RpcServer.getRequestUser();
    User user;
    if (optionalUser.isPresent()) {
      user = optionalUser.get();
    } else {
      user = User.getCurrent();
    }
    if (LOG.isTraceEnabled()) {
      LOG.trace("Current active user name is " + user.getShortName());
    }
    return user;
  }
@return User who called RPC method. For non-RPC handling, falls back to system user
@throws IOException When there is IOE in getting the system user (During non-RPC handling).
hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java