|
34 | 34 | import org.apache.hadoop.fs.FileSystem; |
35 | 35 | import org.apache.hadoop.fs.Path; |
36 | 36 | import org.apache.hadoop.io.DataOutputBuffer; |
37 | | -import org.apache.hadoop.io.Text; |
38 | 37 | import org.apache.hadoop.mapreduce.security.TokenCache; |
39 | 38 | import org.apache.hadoop.security.Credentials; |
40 | 39 | import org.apache.hadoop.security.UserGroupInformation; |
@@ -217,9 +216,8 @@ public static void setTokensFor( |
217 | 216 |
|
218 | 217 | Collection<Token<? extends TokenIdentifier>> usrTok = currUsr.getTokens(); |
219 | 218 | for (Token<? extends TokenIdentifier> token : usrTok) { |
220 | | - final Text id = new Text(token.getIdentifier()); |
221 | | - LOG.info("Adding user token " + id + " with " + token); |
222 | | - credentials.addToken(id, token); |
| 219 | + LOG.info("Adding user token " + token.getService() + " with " + token); |
| 220 | + credentials.addToken(token.getService(), token); |
223 | 221 | } |
224 | 222 | try (DataOutputBuffer dob = new DataOutputBuffer()) { |
225 | 223 | credentials.writeTokenStorageToStream(dob); |
@@ -568,8 +566,7 @@ static ContainerLaunchContext createTaskExecutorContext( |
568 | 566 | Collection<Token<? extends TokenIdentifier>> userTokens = cred.getAllTokens(); |
569 | 567 | for (Token<? extends TokenIdentifier> token : userTokens) { |
570 | 568 | if (!token.getKind().equals(AMRMTokenIdentifier.KIND_NAME)) { |
571 | | - final Text id = new Text(token.getIdentifier()); |
572 | | - taskManagerCred.addToken(id, token); |
| 569 | + taskManagerCred.addToken(token.getService(), token); |
573 | 570 | } |
574 | 571 | } |
575 | 572 |
|
|
0 commit comments