|
@@ -20,6 +20,7 @@ package org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt;
|
|
|
|
|
|
import static org.apache.hadoop.yarn.util.StringHelper.pjoin;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.net.URI;
|
|
|
import java.net.URISyntaxException;
|
|
|
import java.util.ArrayList;
|
|
@@ -675,7 +676,7 @@ public class RMAppAttemptImpl implements RMAppAttempt, Recoverable {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void recover(RMState state) {
|
|
|
+ public void recover(RMState state) throws Exception{
|
|
|
ApplicationState appState =
|
|
|
state.getApplicationState().get(getAppAttemptId().getApplicationId());
|
|
|
ApplicationAttemptState attemptState = appState.getAttempt(getAppAttemptId());
|
|
@@ -690,7 +691,8 @@ public class RMAppAttemptImpl implements RMAppAttempt, Recoverable {
|
|
|
RMAppAttemptEventType.RECOVER));
|
|
|
}
|
|
|
|
|
|
- private void recoverAppAttemptCredentials(Credentials appAttemptTokens) {
|
|
|
+ private void recoverAppAttemptCredentials(Credentials appAttemptTokens)
|
|
|
+ throws IOException {
|
|
|
if (appAttemptTokens == null) {
|
|
|
return;
|
|
|
}
|
|
@@ -707,11 +709,7 @@ public class RMAppAttemptImpl implements RMAppAttempt, Recoverable {
|
|
|
this.amrmToken =
|
|
|
(Token<AMRMTokenIdentifier>) appAttemptTokens
|
|
|
.getToken(RMStateStore.AM_RM_TOKEN_SERVICE);
|
|
|
-
|
|
|
- // For now, no need to populate tokens back to AMRMTokenSecretManager,
|
|
|
- // because running attempts are rebooted. Later in work-preserve restart,
|
|
|
- // we'll create NEW->RUNNING transition in which the restored tokens will be
|
|
|
- // added to the secret manager
|
|
|
+ rmContext.getAMRMTokenSecretManager().addPersistedPassword(this.amrmToken);
|
|
|
}
|
|
|
|
|
|
private static class BaseTransition implements
|