Skip to content

Commit 2080cd0

Browse files
committed
add log
1 parent a13823d commit 2080cd0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

core/src/main/java/com/dtstack/flink/sql/util/KrbUtils.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
import org.apache.hadoop.conf.Configuration;
2222
import org.apache.hadoop.security.UserGroupInformation;
23+
import org.slf4j.Logger;
24+
import org.slf4j.LoggerFactory;
2325

2426
import java.io.IOException;
2527

@@ -30,23 +32,23 @@
3032
**/
3133
public class KrbUtils {
3234

35+
private static final Logger LOG = LoggerFactory.getLogger(KrbUtils.class);
36+
3337
public static final String KRB5_CONF_KEY = "java.security.krb5.conf";
3438
public static final String HADOOP_AUTH_KEY = "hadoop.security.authentication";
3539
public static final String KRB_STR = "Kerberos";
36-
public static final String FALSE_STR = "false";
37-
public static final String SUBJECT_ONLY_KEY = "javax.security.auth.useSubjectCredsOnly";
40+
// public static final String FALSE_STR = "false";
41+
// public static final String SUBJECT_ONLY_KEY = "javax.security.auth.useSubjectCredsOnly";
3842

3943
public static UserGroupInformation getUgi(String principal, String keytabPath, String krb5confPath) throws IOException {
44+
LOG.info("Kerberos login with principal: {} and keytab: {}", principal, keytabPath);
4045
System.setProperty(KRB5_CONF_KEY, krb5confPath);
46+
// TODO 尚未探索出此选项的意义,以后研究明白方可打开
4147
// System.setProperty(SUBJECT_ONLY_KEY, FALSE_STR);
4248
Configuration configuration = new Configuration();
4349
configuration.set(HADOOP_AUTH_KEY , KRB_STR);
4450
UserGroupInformation.setConfiguration(configuration);
4551
return UserGroupInformation.loginUserFromKeytabAndReturnUGI(principal, keytabPath);
4652
}
4753

48-
public void checkKrbParams() {
49-
50-
}
51-
5254
}

0 commit comments

Comments
 (0)