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

This commit is contained in:
Brahma Reddy Battula 2018-02-12 22:14:34 +05:30
parent 3414fd1243
commit 35c17351ca

View File

@ -253,7 +253,20 @@ private void doRefreshNamenodes(
lifelineAddrs.add(nnIdToLifelineAddr != null ?
nnIdToLifelineAddr.get(nnId) : null);
}
bpos.refreshNNList(addrs, lifelineAddrs);
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;
}
}
}
}