Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -640,12 +640,18 @@ public TUGIAssumingTransportFactory(TTransportFactory wrapped, UserGroupInformat

@Override
public TTransport getTransport(final TTransport trans) {
return ugi.doAs(new PrivilegedAction<TTransport>() {
@Override
public TTransport run() {
return wrapped.getTransport(trans);
}
});
TTransport transport = null;
try {
transport = UserGroupInformation.getLoginUser().doAs(new PrivilegedAction<TTransport>() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field ugi in this class can be removed.

@Override
public TTransport run() {
return wrapped.getTransport(trans);
}
});
} catch (IOException ex) {
throw new RuntimeException(ex);
}
return transport;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public TUGIAssumingTransport(TTransport wrapped, UserGroupInformation ugi) {
@Override
public void open() throws TTransportException {
try {
ugi.doAs(new PrivilegedExceptionAction<Void>() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, the field ugi can be removed.


UserGroupInformation.getLoginUser().doAs(new PrivilegedExceptionAction<Void>() {
public Void run() {
try {
wrapped.open();
Expand Down