org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.AMLivelinessMonitor Java Examples
The following examples show how to use
org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.AMLivelinessMonitor.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MyriadOperationsTest.java From incubator-myriad with Apache License 2.0 | 6 votes |
private RMContext generateRMContext(AbstractYarnScheduler<FiCaSchedulerApp, FiCaSchedulerNode> scheduler) throws Exception { Configuration conf = new Configuration(); MockRMContext context = null; Dispatcher dispatcher = new MockDispatcher(); RMApplicationHistoryWriter rmApplicationHistoryWriter = new RMApplicationHistoryWriter(); AMLivelinessMonitor amLivelinessMonitor = new AMLivelinessMonitor(dispatcher); AMLivelinessMonitor amFinishingMonitor = new AMLivelinessMonitor(dispatcher); RMDelegationTokenSecretManager delegationTokenSecretManager = new RMDelegationTokenSecretManager(1, 1, 1, 1, context); context = new MockRMContext(); context.setStateStore(TestObjectFactory.getStateStore(conf, "tmp/myriad-operations-test")); context.setAmLivelinessMonitor(amLivelinessMonitor); context.setAmFinishingMonitor(amFinishingMonitor); context.setRMApplicationHistoryWriter(rmApplicationHistoryWriter); context.setRMDelegationTokenSecretManager(delegationTokenSecretManager); return context; }
Example #2
Source File: RMContextImpl.java From big-c with Apache License 2.0 | 6 votes |
@VisibleForTesting // helper constructor for tests public RMContextImpl(Dispatcher rmDispatcher, ContainerAllocationExpirer containerAllocationExpirer, AMLivelinessMonitor amLivelinessMonitor, AMLivelinessMonitor amFinishingMonitor, DelegationTokenRenewer delegationTokenRenewer, AMRMTokenSecretManager appTokenSecretManager, RMContainerTokenSecretManager containerTokenSecretManager, NMTokenSecretManagerInRM nmTokenSecretManager, ClientToAMTokenSecretManagerInRM clientToAMTokenSecretManager, RMApplicationHistoryWriter rmApplicationHistoryWriter) { this( rmDispatcher, containerAllocationExpirer, amLivelinessMonitor, amFinishingMonitor, delegationTokenRenewer, appTokenSecretManager, containerTokenSecretManager, nmTokenSecretManager, clientToAMTokenSecretManager, rmApplicationHistoryWriter, null); }
Example #3
Source File: RMContextImpl.java From big-c with Apache License 2.0 | 6 votes |
@VisibleForTesting // helper constructor for tests public RMContextImpl(Dispatcher rmDispatcher, ContainerAllocationExpirer containerAllocationExpirer, AMLivelinessMonitor amLivelinessMonitor, AMLivelinessMonitor amFinishingMonitor, DelegationTokenRenewer delegationTokenRenewer, AMRMTokenSecretManager appTokenSecretManager, RMContainerTokenSecretManager containerTokenSecretManager, NMTokenSecretManagerInRM nmTokenSecretManager, ClientToAMTokenSecretManagerInRM clientToAMTokenSecretManager, RMApplicationHistoryWriter rmApplicationHistoryWriter, ResourceScheduler scheduler) { this(); this.setDispatcher(rmDispatcher); setActiveServiceContext(new RMActiveServiceContext(rmDispatcher, containerAllocationExpirer, amLivelinessMonitor, amFinishingMonitor, delegationTokenRenewer, appTokenSecretManager, containerTokenSecretManager, nmTokenSecretManager, clientToAMTokenSecretManager, rmApplicationHistoryWriter, scheduler)); ConfigurationProvider provider = new LocalConfigurationProvider(); setConfigurationProvider(provider); }
Example #4
Source File: RMContextImpl.java From hadoop with Apache License 2.0 | 6 votes |
@VisibleForTesting // helper constructor for tests public RMContextImpl(Dispatcher rmDispatcher, ContainerAllocationExpirer containerAllocationExpirer, AMLivelinessMonitor amLivelinessMonitor, AMLivelinessMonitor amFinishingMonitor, DelegationTokenRenewer delegationTokenRenewer, AMRMTokenSecretManager appTokenSecretManager, RMContainerTokenSecretManager containerTokenSecretManager, NMTokenSecretManagerInRM nmTokenSecretManager, ClientToAMTokenSecretManagerInRM clientToAMTokenSecretManager, RMApplicationHistoryWriter rmApplicationHistoryWriter) { this( rmDispatcher, containerAllocationExpirer, amLivelinessMonitor, amFinishingMonitor, delegationTokenRenewer, appTokenSecretManager, containerTokenSecretManager, nmTokenSecretManager, clientToAMTokenSecretManager, rmApplicationHistoryWriter, null); }
Example #5
Source File: RMContextImpl.java From hadoop with Apache License 2.0 | 6 votes |
@VisibleForTesting // helper constructor for tests public RMContextImpl(Dispatcher rmDispatcher, ContainerAllocationExpirer containerAllocationExpirer, AMLivelinessMonitor amLivelinessMonitor, AMLivelinessMonitor amFinishingMonitor, DelegationTokenRenewer delegationTokenRenewer, AMRMTokenSecretManager appTokenSecretManager, RMContainerTokenSecretManager containerTokenSecretManager, NMTokenSecretManagerInRM nmTokenSecretManager, ClientToAMTokenSecretManagerInRM clientToAMTokenSecretManager, RMApplicationHistoryWriter rmApplicationHistoryWriter, ResourceScheduler scheduler) { this(); this.setDispatcher(rmDispatcher); setActiveServiceContext(new RMActiveServiceContext(rmDispatcher, containerAllocationExpirer, amLivelinessMonitor, amFinishingMonitor, delegationTokenRenewer, appTokenSecretManager, containerTokenSecretManager, nmTokenSecretManager, clientToAMTokenSecretManager, rmApplicationHistoryWriter, scheduler)); ConfigurationProvider provider = new LocalConfigurationProvider(); setConfigurationProvider(provider); }
Example #6
Source File: RMActiveServiceContext.java From hadoop with Apache License 2.0 | 5 votes |
@Private @Unstable public RMActiveServiceContext(Dispatcher rmDispatcher, ContainerAllocationExpirer containerAllocationExpirer, AMLivelinessMonitor amLivelinessMonitor, AMLivelinessMonitor amFinishingMonitor, DelegationTokenRenewer delegationTokenRenewer, AMRMTokenSecretManager appTokenSecretManager, RMContainerTokenSecretManager containerTokenSecretManager, NMTokenSecretManagerInRM nmTokenSecretManager, ClientToAMTokenSecretManagerInRM clientToAMTokenSecretManager, RMApplicationHistoryWriter rmApplicationHistoryWriter, ResourceScheduler scheduler) { this(); this.setContainerAllocationExpirer(containerAllocationExpirer); this.setAMLivelinessMonitor(amLivelinessMonitor); this.setAMFinishingMonitor(amFinishingMonitor); this.setDelegationTokenRenewer(delegationTokenRenewer); this.setAMRMTokenSecretManager(appTokenSecretManager); this.setContainerTokenSecretManager(containerTokenSecretManager); this.setNMTokenSecretManager(nmTokenSecretManager); this.setClientToAMTokenSecretManager(clientToAMTokenSecretManager); this.setRMApplicationHistoryWriter(rmApplicationHistoryWriter); this.setScheduler(scheduler); RMStateStore nullStore = new NullRMStateStore(); nullStore.setRMDispatcher(rmDispatcher); try { nullStore.init(new YarnConfiguration()); setStateStore(nullStore); } catch (Exception e) { assert false; } }
Example #7
Source File: TestAppManager.java From big-c with Apache License 2.0 | 5 votes |
public RMContext mockRMContext(int n, long time) { final List<RMApp> apps = newRMApps(n, time, RMAppState.FINISHED); final ConcurrentMap<ApplicationId, RMApp> map = Maps.newConcurrentMap(); for (RMApp app : apps) { map.put(app.getApplicationId(), app); } Dispatcher rmDispatcher = new AsyncDispatcher(); ContainerAllocationExpirer containerAllocationExpirer = new ContainerAllocationExpirer( rmDispatcher); AMLivelinessMonitor amLivelinessMonitor = new AMLivelinessMonitor( rmDispatcher); AMLivelinessMonitor amFinishingMonitor = new AMLivelinessMonitor( rmDispatcher); RMApplicationHistoryWriter writer = mock(RMApplicationHistoryWriter.class); RMContext context = new RMContextImpl(rmDispatcher, containerAllocationExpirer, amLivelinessMonitor, amFinishingMonitor, null, null, null, null, null, writer) { @Override public ConcurrentMap<ApplicationId, RMApp> getRMApps() { return map; } }; ((RMContextImpl)context).setStateStore(mock(RMStateStore.class)); metricsPublisher = mock(SystemMetricsPublisher.class); ((RMContextImpl)context).setSystemMetricsPublisher(metricsPublisher); return context; }
Example #8
Source File: RMActiveServiceContext.java From big-c with Apache License 2.0 | 5 votes |
@Private @Unstable public RMActiveServiceContext(Dispatcher rmDispatcher, ContainerAllocationExpirer containerAllocationExpirer, AMLivelinessMonitor amLivelinessMonitor, AMLivelinessMonitor amFinishingMonitor, DelegationTokenRenewer delegationTokenRenewer, AMRMTokenSecretManager appTokenSecretManager, RMContainerTokenSecretManager containerTokenSecretManager, NMTokenSecretManagerInRM nmTokenSecretManager, ClientToAMTokenSecretManagerInRM clientToAMTokenSecretManager, RMApplicationHistoryWriter rmApplicationHistoryWriter, ResourceScheduler scheduler) { this(); this.setContainerAllocationExpirer(containerAllocationExpirer); this.setAMLivelinessMonitor(amLivelinessMonitor); this.setAMFinishingMonitor(amFinishingMonitor); this.setDelegationTokenRenewer(delegationTokenRenewer); this.setAMRMTokenSecretManager(appTokenSecretManager); this.setContainerTokenSecretManager(containerTokenSecretManager); this.setNMTokenSecretManager(nmTokenSecretManager); this.setClientToAMTokenSecretManager(clientToAMTokenSecretManager); this.setRMApplicationHistoryWriter(rmApplicationHistoryWriter); this.setScheduler(scheduler); RMStateStore nullStore = new NullRMStateStore(); nullStore.setRMDispatcher(rmDispatcher); try { nullStore.init(new YarnConfiguration()); setStateStore(nullStore); } catch (Exception e) { assert false; } }
Example #9
Source File: TestAppManager.java From hadoop with Apache License 2.0 | 5 votes |
public RMContext mockRMContext(int n, long time) { final List<RMApp> apps = newRMApps(n, time, RMAppState.FINISHED); final ConcurrentMap<ApplicationId, RMApp> map = Maps.newConcurrentMap(); for (RMApp app : apps) { map.put(app.getApplicationId(), app); } Dispatcher rmDispatcher = new AsyncDispatcher(); ContainerAllocationExpirer containerAllocationExpirer = new ContainerAllocationExpirer( rmDispatcher); AMLivelinessMonitor amLivelinessMonitor = new AMLivelinessMonitor( rmDispatcher); AMLivelinessMonitor amFinishingMonitor = new AMLivelinessMonitor( rmDispatcher); RMApplicationHistoryWriter writer = mock(RMApplicationHistoryWriter.class); RMContext context = new RMContextImpl(rmDispatcher, containerAllocationExpirer, amLivelinessMonitor, amFinishingMonitor, null, null, null, null, null, writer) { @Override public ConcurrentMap<ApplicationId, RMApp> getRMApps() { return map; } }; ((RMContextImpl)context).setStateStore(mock(RMStateStore.class)); metricsPublisher = mock(SystemMetricsPublisher.class); ((RMContextImpl)context).setSystemMetricsPublisher(metricsPublisher); return context; }
Example #10
Source File: RMappTracerTest.java From garmadon with Apache License 2.0 | 5 votes |
@Test @AgentAttachmentRule.Enforce public void RMAppTracer_should_not_failed_attaching_RMContextImpl_constructior_due_to_TriConsumer_visibility() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, URISyntaxException, IOException, InstantiationException, NoSuchFieldException, InterruptedException { assertThat(ByteBuddyAgent.install(), instanceOf(Instrumentation.class)); final Header[] header = new Header[1]; final Object[] event = new Object[1]; TriConsumer<Long, Header, Object> cons = (t, h, o) -> { header[0] = h; event[0] = o; }; ReflectionHelper.setField(null, classLoader.loadClass(RMAppTracer.class.getName()), "eventHandler", cons); ClassFileTransformer classFileTransformer = new RMAppTracer.RMContextImplThread().installOnByteBuddyAgent(); try { Class<?> clazz = classLoader.loadClass(RMContextImpl.class.getName()); Constructor<?> constructor = clazz.getDeclaredConstructor(Dispatcher.class, ContainerAllocationExpirer.class, AMLivelinessMonitor.class, AMLivelinessMonitor.class, DelegationTokenRenewer.class, AMRMTokenSecretManager.class, RMContainerTokenSecretManager.class, NMTokenSecretManagerInRM.class, ClientToAMTokenSecretManagerInRM.class, RMApplicationHistoryWriter.class); constructor.newInstance(mock(Dispatcher.class), mock(ContainerAllocationExpirer.class), mock(AMLivelinessMonitor.class), mock(AMLivelinessMonitor.class), mock(DelegationTokenRenewer.class), mock(AMRMTokenSecretManager.class), mock(RMContainerTokenSecretManager.class), mock(NMTokenSecretManagerInRM.class), mock(ClientToAMTokenSecretManagerInRM.class), mock(RMApplicationHistoryWriter.class)); } finally { ByteBuddyAgent.getInstrumentation().removeTransformer(classFileTransformer); } }
Example #11
Source File: MockRMContext.java From incubator-myriad with Apache License 2.0 | 4 votes |
public void setAmFinishingMonitor(AMLivelinessMonitor amFinishingMonitor) { this.amFinishingMonitor = amFinishingMonitor; }
Example #12
Source File: MockRMContext.java From incubator-myriad with Apache License 2.0 | 4 votes |
public void setAmLivelinessMonitor(AMLivelinessMonitor amLivelinessMonitor) { this.amLivelinessMonitor = amLivelinessMonitor; }
Example #13
Source File: TestRMAppTransitions.java From big-c with Apache License 2.0 | 4 votes |
@Before public void setUp() throws Exception { conf = new YarnConfiguration(); AuthenticationMethod authMethod = AuthenticationMethod.SIMPLE; if (isSecurityEnabled) { authMethod = AuthenticationMethod.KERBEROS; } SecurityUtil.setAuthenticationMethod(authMethod, conf); UserGroupInformation.setConfiguration(conf); rmDispatcher = new DrainDispatcher(); ContainerAllocationExpirer containerAllocationExpirer = mock(ContainerAllocationExpirer.class); AMLivelinessMonitor amLivelinessMonitor = mock(AMLivelinessMonitor.class); AMLivelinessMonitor amFinishingMonitor = mock(AMLivelinessMonitor.class); store = mock(RMStateStore.class); writer = mock(RMApplicationHistoryWriter.class); DelegationTokenRenewer renewer = mock(DelegationTokenRenewer.class); RMContext realRMContext = new RMContextImpl(rmDispatcher, containerAllocationExpirer, amLivelinessMonitor, amFinishingMonitor, renewer, new AMRMTokenSecretManager(conf, this.rmContext), new RMContainerTokenSecretManager(conf), new NMTokenSecretManagerInRM(conf), new ClientToAMTokenSecretManagerInRM(), writer); ((RMContextImpl)realRMContext).setStateStore(store); publisher = mock(SystemMetricsPublisher.class); ((RMContextImpl)realRMContext).setSystemMetricsPublisher(publisher); this.rmContext = spy(realRMContext); ResourceScheduler resourceScheduler = mock(ResourceScheduler.class); doReturn(null).when(resourceScheduler) .getAppResourceUsageReport((ApplicationAttemptId)Matchers.any()); doReturn(resourceScheduler).when(rmContext).getScheduler(); rmDispatcher.register(RMAppAttemptEventType.class, new TestApplicationAttemptEventDispatcher(this.rmContext)); rmDispatcher.register(RMAppEventType.class, new TestApplicationEventDispatcher(rmContext)); rmDispatcher.register(RMAppManagerEventType.class, new TestApplicationManagerEventDispatcher()); schedulerDispatcher = new TestSchedulerEventDispatcher(); rmDispatcher.register(SchedulerEventType.class, schedulerDispatcher); rmDispatcher.init(conf); rmDispatcher.start(); }
Example #14
Source File: RMActiveServiceContext.java From hadoop with Apache License 2.0 | 4 votes |
@Private @Unstable public AMLivelinessMonitor getAMLivelinessMonitor() { return this.amLivelinessMonitor; }
Example #15
Source File: RMContextImpl.java From big-c with Apache License 2.0 | 4 votes |
void setAMFinishingMonitor(AMLivelinessMonitor amFinishingMonitor) { activeServiceContext.setAMFinishingMonitor(amFinishingMonitor); }
Example #16
Source File: RMContextImpl.java From big-c with Apache License 2.0 | 4 votes |
void setAMLivelinessMonitor(AMLivelinessMonitor amLivelinessMonitor) { activeServiceContext.setAMLivelinessMonitor(amLivelinessMonitor); }
Example #17
Source File: RMContextImpl.java From big-c with Apache License 2.0 | 4 votes |
@Override public AMLivelinessMonitor getAMFinishingMonitor() { return activeServiceContext.getAMFinishingMonitor(); }
Example #18
Source File: RMContextImpl.java From big-c with Apache License 2.0 | 4 votes |
@Override public AMLivelinessMonitor getAMLivelinessMonitor() { return activeServiceContext.getAMLivelinessMonitor(); }
Example #19
Source File: RMActiveServiceContext.java From hadoop with Apache License 2.0 | 4 votes |
@Private @Unstable public AMLivelinessMonitor getAMFinishingMonitor() { return this.amFinishingMonitor; }
Example #20
Source File: RMActiveServiceContext.java From hadoop with Apache License 2.0 | 4 votes |
@Private @Unstable void setAMLivelinessMonitor(AMLivelinessMonitor amLivelinessMonitor) { this.amLivelinessMonitor = amLivelinessMonitor; }
Example #21
Source File: MockRMContext.java From incubator-myriad with Apache License 2.0 | 4 votes |
@Override public AMLivelinessMonitor getAMLivelinessMonitor() { return amLivelinessMonitor; }
Example #22
Source File: MockRMContext.java From incubator-myriad with Apache License 2.0 | 4 votes |
@Override public AMLivelinessMonitor getAMFinishingMonitor() { return amFinishingMonitor; }
Example #23
Source File: ResourceManager.java From big-c with Apache License 2.0 | 4 votes |
protected AMLivelinessMonitor createAMLivelinessMonitor() { return new AMLivelinessMonitor(this.rmDispatcher); }
Example #24
Source File: RMActiveServiceContext.java From big-c with Apache License 2.0 | 4 votes |
@Private @Unstable void setAMFinishingMonitor(AMLivelinessMonitor amFinishingMonitor) { this.amFinishingMonitor = amFinishingMonitor; }
Example #25
Source File: RMActiveServiceContext.java From big-c with Apache License 2.0 | 4 votes |
@Private @Unstable void setAMLivelinessMonitor(AMLivelinessMonitor amLivelinessMonitor) { this.amLivelinessMonitor = amLivelinessMonitor; }
Example #26
Source File: RMActiveServiceContext.java From big-c with Apache License 2.0 | 4 votes |
@Private @Unstable public AMLivelinessMonitor getAMFinishingMonitor() { return this.amFinishingMonitor; }
Example #27
Source File: RMActiveServiceContext.java From big-c with Apache License 2.0 | 4 votes |
@Private @Unstable public AMLivelinessMonitor getAMLivelinessMonitor() { return this.amLivelinessMonitor; }
Example #28
Source File: RMActiveServiceContext.java From hadoop with Apache License 2.0 | 4 votes |
@Private @Unstable void setAMFinishingMonitor(AMLivelinessMonitor amFinishingMonitor) { this.amFinishingMonitor = amFinishingMonitor; }
Example #29
Source File: TestRMAppTransitions.java From hadoop with Apache License 2.0 | 4 votes |
@Before public void setUp() throws Exception { conf = new YarnConfiguration(); AuthenticationMethod authMethod = AuthenticationMethod.SIMPLE; if (isSecurityEnabled) { authMethod = AuthenticationMethod.KERBEROS; } SecurityUtil.setAuthenticationMethod(authMethod, conf); UserGroupInformation.setConfiguration(conf); rmDispatcher = new DrainDispatcher(); ContainerAllocationExpirer containerAllocationExpirer = mock(ContainerAllocationExpirer.class); AMLivelinessMonitor amLivelinessMonitor = mock(AMLivelinessMonitor.class); AMLivelinessMonitor amFinishingMonitor = mock(AMLivelinessMonitor.class); store = mock(RMStateStore.class); writer = mock(RMApplicationHistoryWriter.class); DelegationTokenRenewer renewer = mock(DelegationTokenRenewer.class); RMContext realRMContext = new RMContextImpl(rmDispatcher, containerAllocationExpirer, amLivelinessMonitor, amFinishingMonitor, renewer, new AMRMTokenSecretManager(conf, this.rmContext), new RMContainerTokenSecretManager(conf), new NMTokenSecretManagerInRM(conf), new ClientToAMTokenSecretManagerInRM(), writer); ((RMContextImpl)realRMContext).setStateStore(store); publisher = mock(SystemMetricsPublisher.class); ((RMContextImpl)realRMContext).setSystemMetricsPublisher(publisher); this.rmContext = spy(realRMContext); ResourceScheduler resourceScheduler = mock(ResourceScheduler.class); doReturn(null).when(resourceScheduler) .getAppResourceUsageReport((ApplicationAttemptId)Matchers.any()); doReturn(resourceScheduler).when(rmContext).getScheduler(); rmDispatcher.register(RMAppAttemptEventType.class, new TestApplicationAttemptEventDispatcher(this.rmContext)); rmDispatcher.register(RMAppEventType.class, new TestApplicationEventDispatcher(rmContext)); rmDispatcher.register(RMAppManagerEventType.class, new TestApplicationManagerEventDispatcher()); schedulerDispatcher = new TestSchedulerEventDispatcher(); rmDispatcher.register(SchedulerEventType.class, schedulerDispatcher); rmDispatcher.init(conf); rmDispatcher.start(); }
Example #30
Source File: ResourceManager.java From hadoop with Apache License 2.0 | 4 votes |
protected AMLivelinessMonitor createAMLivelinessMonitor() { return new AMLivelinessMonitor(this.rmDispatcher); }