public static void setTokenStr(UserGroupInformation ugi, String tokenStr, String tokenService)
      throws IOException {
    Token<DelegationTokenIdentifier> delegationToken = createToken(tokenStr, tokenService);
    ugi.addToken(delegationToken);
  }
Create a delegation token object for the given token string and service. Add the token to given
UGI

@param ugi
@param tokenStr
@param tokenService
@throws IOException
service/src/java/org/apache/hive/service/cli/session/SessionUtils.java