private RegisterApplicationMasterResponse registerApplicationMaster() throws YarnException, IOException { RegisterApplicationMasterRequest request = RegisterApplicationMasterRequest.newInstance(this.appHostName, this.appHostPort, this.appTrackingUrl); RegisterApplicationMasterResponse response = rmClient.registerApplicationMaster(request); synchronized (this) { lastResponseId = 0; if (!response.getNMTokensFromPreviousAttempts().isEmpty()) { populateNMTokens(response.getNMTokensFromPreviousAttempts()); } } return response; }
private RegisterApplicationMasterResponse registerApplicationMaster() throws YarnException, IOException { RegisterApplicationMasterRequest request = RegisterApplicationMasterRequest.newInstance(this.appHostName, this.appHostPort, this.appTrackingUrl); RegisterApplicationMasterResponse response = rmClient.registerApplicationMaster(request); synchronized (this) { lastResponseId = 0; if (!response.getNMTokensFromPreviousAttempts().isEmpty()) { populateNMTokens(response.getNMTokensFromPreviousAttempts()); } } return response; }
private RegisterApplicationMasterResponse registerApplicationMaster() throws YarnException, IOException { RegisterApplicationMasterRequest request = RegisterApplicationMasterRequest.newInstance(this.appHostName, this.appHostPort, this.appTrackingUrl); RegisterApplicationMasterResponse response = rmClient.registerApplicationMaster(request); synchronized (this) { lastResponseId = 0; if (!response.getNMTokensFromPreviousAttempts().isEmpty()) { populateNMTokens(response.getNMTokensFromPreviousAttempts()); } } return response; }
@Override public void run() { try { launchUAM(attemptId); registerApplicationMaster( RegisterApplicationMasterRequest.newInstance(null, 1001, null), attemptId); } catch (Exception e) { LOG.info("Register thread exception", e); } } });
@SuppressWarnings("unchecked") private RegisterApplicationMasterResponse registerApplicationMaster() throws YarnException, IOException { RegisterApplicationMasterRequest request = RegisterApplicationMasterRequest.newInstance(this.appHostName, this.appHostPort, this.appTrackingUrl); if (!this.placementConstraints.isEmpty()) { request.setPlacementConstraints(this.placementConstraints); } RegisterApplicationMasterResponse response = rmClient.registerApplicationMaster(request); synchronized (this) { lastResponseId = 0; if (!response.getNMTokensFromPreviousAttempts().isEmpty()) { populateNMTokens(response.getNMTokensFromPreviousAttempts()); } this.resourceProfilesMap = response.getResourceProfiles(); List<Container> prevContainers = response.getContainersFromPreviousAttempts(); AMRMClientUtils.removeFromOutstandingSchedulingRequests(prevContainers, this.outstandingSchedRequests); } return response; }
@Before public void setup() throws YarnException, IOException { this.conf = new Configuration(); this.mockAMS = new MockApplicationMasterService(); this.relayer = new AMRMClientRelayer(this.mockAMS, null, "TEST"); this.relayer.init(conf); this.relayer.start(); this.relayer.registerApplicationMaster( RegisterApplicationMasterRequest.newInstance("", 0, "")); clearAllocateRequestLists(); }
@Test public void testForceKill() throws YarnException, IOException, InterruptedException { launchUAM(attemptId); registerApplicationMaster( RegisterApplicationMasterRequest.newInstance(null, 0, null), attemptId); uam.forceKillApplication(); try { uam.forceKillApplication(); Assert.fail("Should fail because application is already killed"); } catch (YarnException t) { } }
@Test(timeout = 5000) public void testBasicUsage() throws YarnException, IOException, InterruptedException { launchUAM(attemptId); registerApplicationMaster( RegisterApplicationMasterRequest.newInstance(null, 0, null), attemptId); allocateAsync(AllocateRequest.newInstance(0, 0, null, null, null), callback, attemptId); // Wait for outstanding async allocate callback waitForCallBackCountAndCheckZeroPending(callback, 1); finishApplicationMaster( FinishApplicationMasterRequest.newInstance(null, null, null), attemptId); }
RegisterApplicationMasterRequest.newInstance("localhost", 12345, ""); client.registerApplicationMaster(request);
@Test(timeout = 5000) public void testUAMReAttach() throws YarnException, IOException, InterruptedException { launchUAM(attemptId); registerApplicationMaster( RegisterApplicationMasterRequest.newInstance(null, 0, null), attemptId); allocateAsync(AllocateRequest.newInstance(0, 0, null, null, null), callback, attemptId); // Wait for outstanding async allocate callback waitForCallBackCountAndCheckZeroPending(callback, 1); MockResourceManagerFacade rmProxy = uam.getRMProxy(); uam = new TestableUnmanagedApplicationManager(conf, attemptId.getApplicationId(), null, "submitter", "appNameSuffix", true); uam.setRMProxy(rmProxy); reAttachUAM(null, attemptId); registerApplicationMaster( RegisterApplicationMasterRequest.newInstance(null, 0, null), attemptId); allocateAsync(AllocateRequest.newInstance(0, 0, null, null, null), callback, attemptId); // Wait for outstanding async allocate callback waitForCallBackCountAndCheckZeroPending(callback, 2); finishApplicationMaster( FinishApplicationMasterRequest.newInstance(null, null, null), attemptId); }
@Test(timeout = 5000) public void testReRegister() throws YarnException, IOException, InterruptedException { launchUAM(attemptId); registerApplicationMaster( RegisterApplicationMasterRequest.newInstance(null, 0, null), attemptId); uam.setShouldReRegisterNext(); allocateAsync(AllocateRequest.newInstance(0, 0, null, null, null), callback, attemptId); // Wait for outstanding async allocate callback waitForCallBackCountAndCheckZeroPending(callback, 1); uam.setShouldReRegisterNext(); finishApplicationMaster( FinishApplicationMasterRequest.newInstance(null, null, null), attemptId); }
RegisterApplicationMasterRequest.newInstance("localhost", 12345, ""); client.registerApplicationMaster(request);
RegisterApplicationMasterRequest.newInstance("", 0, "")); RegisterApplicationMasterRequest.newInstance("", 0, ""));