@Override public FinishApplicationMasterResponse finishApplicationMaster( FinishApplicationMasterRequest request) throws YarnException, IOException { if (this.failover) { this.failover = false; throw new ApplicationMasterNotRegisteredException("Mock RM restarted"); } return null; }
} catch (ApplicationMasterNotRegisteredException e) { Assert.assertNotNull(e); Assert.assertNotNull(e.getMessage()); Assert.assertTrue(e.getMessage().contains( "Application Master is trying to unregister before registering for:" ));
} catch (ApplicationMasterNotRegisteredException e) { Assert.assertNotNull(e); Assert.assertNotNull(e.getMessage()); Assert.assertTrue(e.getMessage().contains( "Application Master is trying to unregister before registering for:" ));
@Override public FinishApplicationMasterResponse finishApplicationMaster( FinishApplicationMasterRequest request) throws YarnException, IOException { if (this.failover) { this.failover = false; throw new ApplicationMasterNotRegisteredException("Mock RM restarted"); } return null; }
@Override public FinishApplicationMasterResponse finishApplicationMaster( FinishApplicationMasterRequest request) throws YarnException, IOException { validateRunning(); ApplicationAttemptId attemptId = getAppIdentifier(); LOG.info("Finishing application attempt: " + attemptId); ApplicationId appId = attemptId.getApplicationId(); if (shouldReRegisterNext) { String message = "AM is not registered, should re-register."; LOG.warn(message); throw new ApplicationMasterNotRegisteredException(message); } synchronized (applicationContainerIdMap) { // Remove the containers that were being tracked for this application Assert.assertTrue("The application id is NOT registered: " + attemptId, applicationContainerIdMap.containsKey(appId)); applicationContainerIdMap.remove(appId); } return FinishApplicationMasterResponse.newInstance( request.getFinalApplicationStatus() == FinalApplicationStatus.SUCCEEDED ? true : false); }
message, appId, applicationAttemptId); throw new ApplicationMasterNotRegisteredException(message);
message, appId, applicationAttemptId); throw new ApplicationMasterNotRegisteredException(message);
message, appId, applicationAttemptId); throw new ApplicationMasterNotRegisteredException(message);
String message = "AM is not registered, should re-register."; LOG.warn(message); throw new ApplicationMasterNotRegisteredException(message);
throw new ApplicationMasterNotRegisteredException( "AMRMProxy just restarted and recovered for " + this.attemptId + ". AM should re-register and full re-send pending requests.");
@Override public AllocateResponse allocate(AllocateRequest request) throws YarnException, IOException { if (this.failover) { this.failover = false; throw new ApplicationMasterNotRegisteredException("Mock RM restarted"); } if(this.exception){ this.exception = false; throw new YarnException("Mock RM encountered exception"); } this.lastAsk = request.getAskList(); this.lastRelease = request.getReleaseList(); this.lastUpdates = request.getUpdateRequests(); this.lastBlacklistAdditions = request.getResourceBlacklistRequest().getBlacklistAdditions(); this.lastBlacklistRemovals = request.getResourceBlacklistRequest().getBlacklistRemovals(); return response; }
+ " or RM had restarted after AM registered. " + " AM should re-register."; throw new ApplicationMasterNotRegisteredException(message);
.getUser(), AuditConstants.AM_ALLOCATE, "", "ApplicationMasterService", message, applicationId, appAttemptId); throw new ApplicationMasterNotRegisteredException(message);
.getUser(), AuditConstants.AM_ALLOCATE, "", "ApplicationMasterService", message, applicationId, appAttemptId); throw new ApplicationMasterNotRegisteredException(message);
@Override public AllocateResponse allocate(AllocateRequest request) throws YarnException, IOException { if (this.failover) { this.failover = false; throw new ApplicationMasterNotRegisteredException("Mock RM restarted"); } if (this.responseIdReset != -1) { String errorMessage = AMRMClientUtils.assembleInvalidResponseIdExceptionMessage(null, this.responseIdReset, request.getResponseId()); this.responseIdReset = -1; throw new InvalidApplicationMasterRequestException(errorMessage); } this.lastAsk = request.getAskList(); this.lastRelease = request.getReleaseList(); this.lastBlacklistAdditions = request.getResourceBlacklistRequest().getBlacklistAdditions(); this.lastBlacklistRemovals = request.getResourceBlacklistRequest().getBlacklistRemovals(); return AllocateResponse.newInstance(request.getResponseId() + 1, null, null, new ArrayList<NodeReport>(), Resource.newInstance(0, 0), null, 0, null, null); }