|
@@ -130,7 +130,6 @@ public class WebHdfsFileSystem extends FileSystem
|
|
private URI uri;
|
|
private URI uri;
|
|
private boolean hasInitedToken;
|
|
private boolean hasInitedToken;
|
|
private Token<?> delegationToken;
|
|
private Token<?> delegationToken;
|
|
- private final AuthenticatedURL.Token authToken = new AuthenticatedURL.Token();
|
|
|
|
private Path workingDir;
|
|
private Path workingDir;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -360,6 +359,8 @@ public class WebHdfsFileSystem extends FileSystem
|
|
try {
|
|
try {
|
|
if (requireAuth) {
|
|
if (requireAuth) {
|
|
LOG.debug("open AuthenticatedURL connection");
|
|
LOG.debug("open AuthenticatedURL connection");
|
|
|
|
+ UserGroupInformation.getCurrentUser().checkTGTAndReloginFromKeytab();
|
|
|
|
+ final AuthenticatedURL.Token authToken = new AuthenticatedURL.Token();
|
|
conn = new AuthenticatedURL(AUTH).openConnection(url, authToken);
|
|
conn = new AuthenticatedURL(AUTH).openConnection(url, authToken);
|
|
} else {
|
|
} else {
|
|
LOG.debug("open URL connection");
|
|
LOG.debug("open URL connection");
|
|
@@ -828,20 +829,12 @@ public class WebHdfsFileSystem extends FileSystem
|
|
@Override
|
|
@Override
|
|
public long renew(final Token<?> token, final Configuration conf
|
|
public long renew(final Token<?> token, final Configuration conf
|
|
) throws IOException, InterruptedException {
|
|
) throws IOException, InterruptedException {
|
|
- final UserGroupInformation ugi = UserGroupInformation.getLoginUser();
|
|
|
|
- // update the kerberos credentials, if they are coming from a keytab
|
|
|
|
- ugi.reloginFromKeytab();
|
|
|
|
-
|
|
|
|
return getWebHdfs(token, conf).renewDelegationToken(token);
|
|
return getWebHdfs(token, conf).renewDelegationToken(token);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void cancel(final Token<?> token, final Configuration conf
|
|
public void cancel(final Token<?> token, final Configuration conf
|
|
) throws IOException, InterruptedException {
|
|
) throws IOException, InterruptedException {
|
|
- final UserGroupInformation ugi = UserGroupInformation.getLoginUser();
|
|
|
|
- // update the kerberos credentials, if they are coming from a keytab
|
|
|
|
- ugi.checkTGTAndReloginFromKeytab();
|
|
|
|
-
|
|
|
|
getWebHdfs(token, conf).cancelDelegationToken(token);
|
|
getWebHdfs(token, conf).cancelDelegationToken(token);
|
|
}
|
|
}
|
|
}
|
|
}
|