LOG.error("Host lookup error resolving kerberos principal ("
+ kerberosPrincipal + "). Exception follows.", e);
throw e;
}
Preconditions.checkNotNull(principal, "Principal must not be null");
KerberosUser newUser = new KerberosUser(principal, kerberosKeytab);
//The HDFS Sink does not allow login credentials to change.
//To be uniform, we will do the same thing here.
User hbaseUser = null;
boolean loggedIn = false;
if (loggedInUser != null) {
Preconditions.checkArgument(newUser.equals(loggedInUser),
"Cannot switch kerberos credentials during a reconfiguration. "
+ "Please restart the agent to set the new credentials.");
try {
hbaseUser = User.create(UserGroupInformation.getLoginUser());
loggedIn = true;