类 SecurityUtil


  • public class SecurityUtil
    extends java.lang.Object
    Provides synchronized access to UserGroupInformation to avoid multiple processors/services from interfering with each other.
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static boolean isSecurityEnabled​(org.apache.hadoop.conf.Configuration config)
      Initializes UserGroupInformation with the given Configuration and returns UserGroupInformation.isSecurityEnabled().
      static org.apache.hadoop.security.UserGroupInformation loginKerberos​(org.apache.hadoop.conf.Configuration config, java.lang.String principal, java.lang.String keyTab)
      Initializes UserGroupInformation with the given Configuration and performs the login for the given principal and keytab.
      static org.apache.hadoop.security.UserGroupInformation loginSimple​(org.apache.hadoop.conf.Configuration config)
      Initializes UserGroupInformation with the given Configuration and returns UserGroupInformation.getLoginUser().
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • HADOOP_SECURITY_AUTHENTICATION

        public static final java.lang.String HADOOP_SECURITY_AUTHENTICATION
        另请参阅:
        常量字段值
      • KERBEROS

        public static final java.lang.String KERBEROS
        另请参阅:
        常量字段值
    • 构造器详细资料

      • SecurityUtil

        public SecurityUtil()
    • 方法详细资料

      • loginKerberos

        public static org.apache.hadoop.security.UserGroupInformation loginKerberos​(org.apache.hadoop.conf.Configuration config,
                                                                                    java.lang.String principal,
                                                                                    java.lang.String keyTab)
                                                                             throws java.io.IOException
        Initializes UserGroupInformation with the given Configuration and performs the login for the given principal and keytab. All logins should happen through this class to ensure other threads are not concurrently modifying UserGroupInformation.

        参数:
        config - the configuration instance
        principal - the principal to authenticate as
        keyTab - the keytab to authenticate with
        返回:
        the UGI for the given principal
        抛出:
        java.io.IOException - if login failed
      • loginSimple

        public static org.apache.hadoop.security.UserGroupInformation loginSimple​(org.apache.hadoop.conf.Configuration config)
                                                                           throws java.io.IOException
        Initializes UserGroupInformation with the given Configuration and returns UserGroupInformation.getLoginUser(). All logins should happen through this class to ensure other threads are not concurrently modifying UserGroupInformation.
        参数:
        config - the configuration instance
        返回:
        the UGI for the given principal
        抛出:
        java.io.IOException - if login failed
      • isSecurityEnabled

        public static boolean isSecurityEnabled​(org.apache.hadoop.conf.Configuration config)
        Initializes UserGroupInformation with the given Configuration and returns UserGroupInformation.isSecurityEnabled(). All checks for isSecurityEnabled() should happen through this method.
        参数:
        config - the given configuration
        返回:
        true if kerberos is enabled on the given configuration, false otherwise