@Override
  public void set(final String name, final UserCredentials hostUser) throws IOException {

    assert this.proxyUGI == null;
    assert hostUser instanceof YarnProxyUser;

    LOG.log(Level.FINE, "UGI: user {0} copy from: {1}", new Object[] {name, hostUser});

    final UserGroupInformation hostUGI = ((YarnProxyUser) hostUser).get();
    final Collection<Token<? extends TokenIdentifier>> tokens = hostUGI.getCredentials().getAllTokens();

    this.set(name, hostUGI, tokens.toArray(new Token[tokens.size()]));
  }
@ Override public void set ( final String name , final UserCredentials hostUser ) throws IOException { assert this . proxyUGI == null ; assert hostUser instanceof YarnProxyUser ; LOG . log ( Level . FINE , "UGI: user {0} copy from: {1}" , new Object [ ] { name , hostUser } ) ; final UserGroupInformation hostUGI = ( ( YarnProxyUser ) hostUser ) . get ( ) ; final Collection < Token < ? extends TokenIdentifier > > tokens = hostUGI . getCredentials ( ) . getAllTokens ( ) ; this . set ( name , hostUGI , tokens . toArray ( new Token [ tokens . size ( ) ] ) ) ; }
Set YARN user. This method can be called only once per class instance.
@param name Name of the new proxy user.
@param hostUser User credentials to copy. Must be an instance of YarnProxyUser.