test_class.file: core/src/test/java/com/dtstack/flink/sql/util/KrbUtilsTest.java
test_class.identifier: KrbUtilsTest
test_case.body: @Test
      public void testLoginAndReturnUgi() throws IOException {
          String principal = "";
          String keytabPath = "";
          String krb5confPath = "";
          try {
              KrbUtils.loginAndReturnUgi(principal, keytabPath, krb5confPath);
          } catch (IllegalArgumentException e) {
              Assert.assertEquals(e.getMessage(), "Can't get Kerberos realm");
          }
      }
test_case.class_method_signature: KrbUtilsTest.testLoginAndReturnUgi()
test_case.full_signature: @Test public void testLoginAndReturnUgi()
test_case.identifier: testLoginAndReturnUgi
test_case.invocations: loginAndReturnUgi assertEquals getMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLoginAndReturnUgi()
focal_class.declarator: LOG = LoggerFactory.getLogger(KrbUtils.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(KrbUtils.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: KRB5_CONF_KEY = "java.security.krb5.conf"
focal_class.modifier: public static final
focal_class.original_string: public static final String KRB5_CONF_KEY = "java.security.krb5.conf";
focal_class.type: String
focal_class.var_name: KRB5_CONF_KEY
focal_class.declarator: HADOOP_AUTH_KEY = "hadoop.security.authentication"
focal_class.modifier: public static final
focal_class.original_string: public static final String HADOOP_AUTH_KEY = "hadoop.security.authentication";
focal_class.type: String
focal_class.var_name: HADOOP_AUTH_KEY
focal_class.declarator: KRB_STR = "Kerberos"
focal_class.modifier: public static final
focal_class.original_string: public static final String KRB_STR = "Kerberos";
focal_class.type: String
focal_class.var_name: KRB_STR
focal_class.file: core/src/main/java/com/dtstack/flink/sql/util/KrbUtils.java
focal_class.identifier: KrbUtils
focal_class.class_method_signature: KrbUtils.loginAndReturnUgi(String principal, String keytabPath, String krb5confPath)
focal_class.full_signature: public static UserGroupInformation loginAndReturnUgi(String principal, String keytabPath, String krb5confPath)
focal_class.identifier: loginAndReturnUgi
focal_class.modifiers: public static
focal_class.parameters: (String principal, String keytabPath, String krb5confPath)
focal_class.return: UserGroupInformation
focal_class.signature: UserGroupInformation loginAndReturnUgi(String principal, String keytabPath, String krb5confPath)
focal_method.body: public static UserGroupInformation loginAndReturnUgi(String principal, String keytabPath, String krb5confPath) throws IOException {
          LOG.info("Kerberos login with principal: {} and keytab: {}", principal, keytabPath);
          System.setProperty(KRB5_CONF_KEY, krb5confPath);
          // 不刷新会读/etc/krb5.conf
          try {
              Config.refresh();
              KerberosName.resetDefaultRealm();
          } catch (KrbException e) {
              LOG.warn("resetting default realm failed, current default realm will still be used.", e);
          }
          // TODO 尚未探索出此选项的意义，以后研究明白方可打开
  //        System.setProperty(SUBJECT_ONLY_KEY, FALSE_STR);
          Configuration configuration = new Configuration();
          configuration.set(HADOOP_AUTH_KEY , KRB_STR);
          UserGroupInformation.setConfiguration(configuration);
          return UserGroupInformation.loginUserFromKeytabAndReturnUGI(principal, keytabPath);
      }
focal_method.class_method_signature: KrbUtils.loginAndReturnUgi(String principal, String keytabPath, String krb5confPath)
focal_method.full_signature: public static UserGroupInformation loginAndReturnUgi(String principal, String keytabPath, String krb5confPath)
focal_method.identifier: loginAndReturnUgi
focal_method.invocations: info setProperty refresh resetDefaultRealm warn set setConfiguration loginUserFromKeytabAndReturnUGI
focal_method.modifiers: public static
focal_method.parameters: (String principal, String keytabPath, String krb5confPath)
focal_method.return: UserGroupInformation
focal_method.signature: UserGroupInformation loginAndReturnUgi(String principal, String keytabPath, String krb5confPath)