List of usage examples for org.apache.hadoop.yarn.api.records ApplicationSubmissionContext getAttemptFailuresValidityInterval
@Public @Stable public abstract long getAttemptFailuresValidityInterval();
From source file:org.apache.slider.core.launch.TestAppMasterLauncherWithAmReset.java
License:Apache License
@Test public void testExtractYarnResourceManagerAmRetryCountWindowMs() throws Exception { Map<String, String> options = new HashMap<String, String>(); final String expectedInterval = Integer.toString(120000); options.put(ResourceKeys.YARN_RESOURCEMANAGER_AM_RETRY_COUNT_WINDOW_MS, expectedInterval); EasyMock.replay(mockYarnClient, yarnClientApp); appMasterLauncher = new AppMasterLauncher("am1", SliderKeys.APP_TYPE, null, null, mockYarnClient, false, null, options, tags, null);//from w w w . j av a 2s. c o m ApplicationSubmissionContext ctx = appMasterLauncher.application.getApplicationSubmissionContext(); String retryIntervalWindow = Long.toString(ctx.getAttemptFailuresValidityInterval()); Assert.assertEquals(expectedInterval, retryIntervalWindow); }
From source file:org.apache.slider.core.launch.TestAppMasterLauncherWithAmReset.java
License:Apache License
@Test public void testExtractYarnResourceManagerAmRetryCountWindowMsDefaultValue() throws Exception { Map<String, String> options = new HashMap<String, String>(); EasyMock.replay(mockYarnClient, yarnClientApp); appMasterLauncher = new AppMasterLauncher("am1", SliderKeys.APP_TYPE, null, null, mockYarnClient, false, null, options, tags, null);// w ww. j a v a 2s.c o m ApplicationSubmissionContext ctx = appMasterLauncher.application.getApplicationSubmissionContext(); long retryIntervalWindow = ctx.getAttemptFailuresValidityInterval(); Assert.assertEquals(ResourceKeys.DEFAULT_AM_RETRY_COUNT_WINDOW_MS, retryIntervalWindow); }