Java 类org.apache.hadoop.mapreduce.v2.hs.HSAuditLogger.AuditConstants 实例源码

项目:hadoop    文件:HSAdminServer.java   
private UserGroupInformation checkAcls(String method) throws IOException {
  UserGroupInformation user;
  try {
    user = UserGroupInformation.getCurrentUser();
  } catch (IOException ioe) {
    LOG.warn("Couldn't get current user", ioe);

    HSAuditLogger.logFailure("UNKNOWN", method, adminAcl.toString(),
        HISTORY_ADMIN_SERVER, "Couldn't get current user");

    throw ioe;
  }

  if (!adminAcl.isUserAllowed(user)) {
    LOG.warn("User " + user.getShortUserName() + " doesn't have permission"
        + " to call '" + method + "'");

    HSAuditLogger.logFailure(user.getShortUserName(), method,
        adminAcl.toString(), HISTORY_ADMIN_SERVER,
        AuditConstants.UNAUTHORIZED_USER);

    throw new AccessControlException("User " + user.getShortUserName()
        + " doesn't have permission" + " to call '" + method + "'");
  }
  LOG.info("HS Admin: " + method + " invoked by user "
      + user.getShortUserName());

  return user;
}
项目:aliyun-oss-hadoop-fs    文件:HSAdminServer.java   
private UserGroupInformation checkAcls(String method) throws IOException {
  UserGroupInformation user;
  try {
    user = UserGroupInformation.getCurrentUser();
  } catch (IOException ioe) {
    LOG.warn("Couldn't get current user", ioe);

    HSAuditLogger.logFailure("UNKNOWN", method, adminAcl.toString(),
        HISTORY_ADMIN_SERVER, "Couldn't get current user");

    throw ioe;
  }

  if (!adminAcl.isUserAllowed(user)) {
    LOG.warn("User " + user.getShortUserName() + " doesn't have permission"
        + " to call '" + method + "'");

    HSAuditLogger.logFailure(user.getShortUserName(), method,
        adminAcl.toString(), HISTORY_ADMIN_SERVER,
        AuditConstants.UNAUTHORIZED_USER);

    throw new AccessControlException("User " + user.getShortUserName()
        + " doesn't have permission" + " to call '" + method + "'");
  }
  LOG.info("HS Admin: " + method + " invoked by user "
      + user.getShortUserName());

  return user;
}
项目:big-c    文件:HSAdminServer.java   
private UserGroupInformation checkAcls(String method) throws IOException {
  UserGroupInformation user;
  try {
    user = UserGroupInformation.getCurrentUser();
  } catch (IOException ioe) {
    LOG.warn("Couldn't get current user", ioe);

    HSAuditLogger.logFailure("UNKNOWN", method, adminAcl.toString(),
        HISTORY_ADMIN_SERVER, "Couldn't get current user");

    throw ioe;
  }

  if (!adminAcl.isUserAllowed(user)) {
    LOG.warn("User " + user.getShortUserName() + " doesn't have permission"
        + " to call '" + method + "'");

    HSAuditLogger.logFailure(user.getShortUserName(), method,
        adminAcl.toString(), HISTORY_ADMIN_SERVER,
        AuditConstants.UNAUTHORIZED_USER);

    throw new AccessControlException("User " + user.getShortUserName()
        + " doesn't have permission" + " to call '" + method + "'");
  }
  LOG.info("HS Admin: " + method + " invoked by user "
      + user.getShortUserName());

  return user;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:HSAdminServer.java   
private UserGroupInformation checkAcls(String method) throws IOException {
  UserGroupInformation user;
  try {
    user = UserGroupInformation.getCurrentUser();
  } catch (IOException ioe) {
    LOG.warn("Couldn't get current user", ioe);

    HSAuditLogger.logFailure("UNKNOWN", method, adminAcl.toString(),
        HISTORY_ADMIN_SERVER, "Couldn't get current user");

    throw ioe;
  }

  if (!adminAcl.isUserAllowed(user)) {
    LOG.warn("User " + user.getShortUserName() + " doesn't have permission"
        + " to call '" + method + "'");

    HSAuditLogger.logFailure(user.getShortUserName(), method,
        adminAcl.toString(), HISTORY_ADMIN_SERVER,
        AuditConstants.UNAUTHORIZED_USER);

    throw new AccessControlException("User " + user.getShortUserName()
        + " doesn't have permission" + " to call '" + method + "'");
  }
  LOG.info("HS Admin: " + method + " invoked by user "
      + user.getShortUserName());

  return user;
}
项目:FlexMap    文件:HSAdminServer.java   
private UserGroupInformation checkAcls(String method) throws IOException {
  UserGroupInformation user;
  try {
    user = UserGroupInformation.getCurrentUser();
  } catch (IOException ioe) {
    LOG.warn("Couldn't get current user", ioe);

    HSAuditLogger.logFailure("UNKNOWN", method, adminAcl.toString(),
        HISTORY_ADMIN_SERVER, "Couldn't get current user");

    throw ioe;
  }

  if (!adminAcl.isUserAllowed(user)) {
    LOG.warn("User " + user.getShortUserName() + " doesn't have permission"
        + " to call '" + method + "'");

    HSAuditLogger.logFailure(user.getShortUserName(), method,
        adminAcl.toString(), HISTORY_ADMIN_SERVER,
        AuditConstants.UNAUTHORIZED_USER);

    throw new AccessControlException("User " + user.getShortUserName()
        + " doesn't have permission" + " to call '" + method + "'");
  }
  LOG.info("HS Admin: " + method + " invoked by user "
      + user.getShortUserName());

  return user;
}
项目:hops    文件:HSAdminServer.java   
private UserGroupInformation checkAcls(String method) throws IOException {
  UserGroupInformation user;
  try {
    user = UserGroupInformation.getCurrentUser();
  } catch (IOException ioe) {
    LOG.warn("Couldn't get current user", ioe);

    HSAuditLogger.logFailure("UNKNOWN", method, adminAcl.toString(),
        HISTORY_ADMIN_SERVER, "Couldn't get current user");

    throw ioe;
  }

  if (!adminAcl.isUserAllowed(user)) {
    LOG.warn("User " + user.getShortUserName() + " doesn't have permission"
        + " to call '" + method + "'");

    HSAuditLogger.logFailure(user.getShortUserName(), method,
        adminAcl.toString(), HISTORY_ADMIN_SERVER,
        AuditConstants.UNAUTHORIZED_USER);

    throw new AccessControlException("User " + user.getShortUserName()
        + " doesn't have permission" + " to call '" + method + "'");
  }
  LOG.info("HS Admin: " + method + " invoked by user "
      + user.getShortUserName());

  return user;
}
项目:hadoop-on-lustre2    文件:HSAdminServer.java   
private UserGroupInformation checkAcls(String method) throws IOException {
  UserGroupInformation user;
  try {
    user = UserGroupInformation.getCurrentUser();
  } catch (IOException ioe) {
    LOG.warn("Couldn't get current user", ioe);

    HSAuditLogger.logFailure("UNKNOWN", method, adminAcl.toString(),
        HISTORY_ADMIN_SERVER, "Couldn't get current user");

    throw ioe;
  }

  if (!adminAcl.isUserAllowed(user)) {
    LOG.warn("User " + user.getShortUserName() + " doesn't have permission"
        + " to call '" + method + "'");

    HSAuditLogger.logFailure(user.getShortUserName(), method,
        adminAcl.toString(), HISTORY_ADMIN_SERVER,
        AuditConstants.UNAUTHORIZED_USER);

    throw new AccessControlException("User " + user.getShortUserName()
        + " doesn't have permission" + " to call '" + method + "'");
  }
  LOG.info("HS Admin: " + method + " invoked by user "
      + user.getShortUserName());

  return user;
}