/** * Get a delegation token for the user from the JobTracker. * * @param renewer the user who can renew the token * @return the new token * @throws IOException */ public Token<DelegationTokenIdentifier> getDelegationToken(Text renewer) throws IOException, InterruptedException { Token<DelegationTokenIdentifier> result = client.getDelegationToken(renewer); InetSocketAddress addr = Master.getMasterAddress(conf); StringBuilder service = new StringBuilder(); service.append(NetUtils.normalizeHostName(addr.getAddress().getHostAddress())); service.append(':'); service.append(addr.getPort()); result.setService(new Text(service.toString())); return result; }
/** * Get a delegation token for the user from the JobTracker. * * @param renewer the user who can renew the token * @return the new token * @throws IOException */ public Token<DelegationTokenIdentifier> getDelegationToken(Text renewer) throws IOException, InterruptedException { // client has already set the service return client.getDelegationToken(renewer); }