HDFS-8693. Addendum patch to execute the command using UGI. Contributed by Brahma Reddy Battula.

(cherry picked from commit 35c17351ca)
This commit is contained in:
Brahma Reddy Battula 2018-02-12 22:14:34 +05:30
parent 41cf2b8e7c
commit 055d5e0b85
1 changed files with 14 additions and 1 deletions

View File

@ -253,7 +253,20 @@ class BlockPoolManager {
lifelineAddrs.add(nnIdToLifelineAddr != null ?
nnIdToLifelineAddr.get(nnId) : null);
}
try {
UserGroupInformation.getLoginUser()
.doAs(new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws Exception {
bpos.refreshNNList(addrs, lifelineAddrs);
return null;
}
});
} catch (InterruptedException ex) {
IOException ioe = new IOException();
ioe.initCause(ex.getCause());
throw ioe;
}
}
}
}