- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler.handle()
方法的一些代码示例,展示了YarnScheduler.handle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnScheduler.handle()
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler
类名称:YarnScheduler
方法名:handle
暂无
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public void handle(SchedulerEvent event) {
scheduler.handle(event);
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public void handle(SchedulerEvent event) {
scheduler.handle(event);
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
@Override
public void handle(SchedulerEvent event) {
scheduler.handle(event);
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public void handle(SchedulerEvent event) {
scheduler.handle(event);
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
@Override
public void handle(SchedulerEvent event) {
scheduler.handle(event);
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Test
public void testUnhealthyExpireForSchedulerRemove() {
RMNodeImpl node = getUnhealthyNode();
verify(scheduler,times(2)).handle(any(NodeRemovedSchedulerEvent.class));
node.handle(new RMNodeEvent(node.getNodeID(), RMNodeEventType.EXPIRE));
verify(scheduler,times(2)).handle(any(NodeRemovedSchedulerEvent.class));
Assert.assertEquals(NodeState.LOST, node.getState());
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
@Test
public void testUnhealthyExpireForSchedulerRemove() {
RMNodeImpl node = getUnhealthyNode();
verify(scheduler,times(2)).handle(any(NodeRemovedSchedulerEvent.class));
node.handle(new RMNodeEvent(node.getNodeID(), RMNodeEventType.EXPIRE));
verify(scheduler,times(2)).handle(any(NodeRemovedSchedulerEvent.class));
Assert.assertEquals(NodeState.LOST, node.getState());
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Test (timeout = 5000)
public void testExpiredContainer() {
// Start the node
node.handle(new RMNodeStartedEvent(null, null, null));
verify(scheduler).handle(any(NodeAddedSchedulerEvent.class));
// Expire a container
ContainerId completedContainerId = BuilderUtils.newContainerId(
BuilderUtils.newApplicationAttemptId(
BuilderUtils.newApplicationId(0, 0), 0), 0);
node.handle(new RMNodeCleanContainerEvent(null, completedContainerId));
Assert.assertEquals(1, node.getContainersToCleanUp().size());
// Now verify that scheduler isn't notified of an expired container
// by checking number of 'completedContainers' it got in the previous event
RMNodeStatusEvent statusEvent = getMockRMNodeStatusEvent(null);
ContainerStatus containerStatus = mock(ContainerStatus.class);
doReturn(completedContainerId).when(containerStatus).getContainerId();
doReturn(Collections.singletonList(containerStatus)).
when(statusEvent).getContainers();
node.handle(statusEvent);
/* Expect the scheduler call handle function 2 times
* 1. RMNode status from new to Running, handle the add_node event
* 2. handle the node update event
*/
verify(scheduler,times(2)).handle(any(NodeUpdateSchedulerEvent.class));
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
@Test (timeout = 5000)
public void testExpiredContainer() {
// Start the node
node.handle(new RMNodeStartedEvent(null, null, null));
verify(scheduler).handle(any(NodeAddedSchedulerEvent.class));
// Expire a container
ContainerId completedContainerId = BuilderUtils.newContainerId(
BuilderUtils.newApplicationAttemptId(
BuilderUtils.newApplicationId(0, 0), 0), 0);
node.handle(new RMNodeCleanContainerEvent(null, completedContainerId));
Assert.assertEquals(1, node.getContainersToCleanUp().size());
// Now verify that scheduler isn't notified of an expired container
// by checking number of 'completedContainers' it got in the previous event
RMNodeStatusEvent statusEvent = getMockRMNodeStatusEvent();
ContainerStatus containerStatus = mock(ContainerStatus.class);
doReturn(completedContainerId).when(containerStatus).getContainerId();
doReturn(Collections.singletonList(containerStatus)).
when(statusEvent).getContainers();
node.handle(statusEvent);
/* Expect the scheduler call handle function 2 times
* 1. RMNode status from new to Running, handle the add_node event
* 2. handle the node update event
*/
verify(scheduler,times(2)).handle(any(NodeUpdateSchedulerEvent.class));
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Before
public void setUp() throws Exception {
InlineDispatcher rmDispatcher = new InlineDispatcher();
rmContext =
new RMContextImpl(rmDispatcher, null, null, null,
null, null, null, null, null);
rmContext.setSystemMetricsPublisher(mock(SystemMetricsPublisher.class));
rmContext.setRMApplicationHistoryWriter(mock(RMApplicationHistoryWriter.class));
rmContext
.setRMTimelineCollectorManager(mock(RMTimelineCollectorManager.class));
scheduler = mock(YarnScheduler.class);
doAnswer(
new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocation) throws Throwable {
final SchedulerEvent event = (SchedulerEvent)(invocation.getArguments()[0]);
eventType = event.getType();
if (eventType == SchedulerEventType.NODE_UPDATE) {
//DO NOTHING
}
return null;
}
}
).when(scheduler).handle(any(SchedulerEvent.class));
rmDispatcher.register(SchedulerEventType.class,
new TestSchedulerEventDispatcher());
appId = ApplicationId.newInstance(System.currentTimeMillis(), 1);
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
).when(scheduler).handle(any(SchedulerEvent.class));
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
.when(statusEvent2).getContainers();
verify(scheduler,times(1)).handle(any(NodeUpdateSchedulerEvent.class));
node.handle(statusEvent1);
node.handle(statusEvent2);
verify(scheduler,times(1)).handle(any(NodeUpdateSchedulerEvent.class));
Assert.assertEquals(2, node.getQueueSize());
node.handle(new RMNodeEvent(node.getNodeID(), RMNodeEventType.EXPIRE));
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
).when(scheduler).handle(any(SchedulerEvent.class));
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
.when(statusEvent2).getContainers();
verify(scheduler,times(1)).handle(any(NodeUpdateSchedulerEvent.class));
node.handle(statusEvent1);
node.handle(statusEvent2);
verify(scheduler,times(1)).handle(any(NodeUpdateSchedulerEvent.class));
Assert.assertEquals(2, node.getQueueSize());
node.handle(new RMNodeEvent(node.getNodeID(), RMNodeEventType.EXPIRE));
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
.getContainers();
verify(scheduler, times(1)).handle(any(NodeUpdateSchedulerEvent.class));
node.handle(statusEvent1);
verify(scheduler, times(1)).handle(any(NodeUpdateSchedulerEvent.class));
Assert.assertEquals(1, node.getQueueSize());
Assert.assertEquals(1, node.getCompletedContainers().size());
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
/**
* {@link RMAppAttemptState#SUBMITTED}
*/
private void testAppAttemptSubmittedState() {
assertEquals(RMAppAttemptState.SUBMITTED,
applicationAttempt.getAppAttemptState());
assertEquals(0, applicationAttempt.getDiagnostics().length());
assertEquals(0,applicationAttempt.getJustFinishedContainers().size());
assertNull(applicationAttempt.getMasterContainer());
assertEquals(0.0, (double)applicationAttempt.getProgress(), 0.0001);
assertEquals(0, application.getRanNodes().size());
assertNull(applicationAttempt.getFinalApplicationStatus());
if (UserGroupInformation.isSecurityEnabled()) {
verify(clientToAMTokenManager).createMasterKey(
applicationAttempt.getAppAttemptId());
// can't create ClientToken as at this time ClientTokenMasterKey has
// not been registered in the SecretManager
assertNull(applicationAttempt.createClientToken("some client"));
}
assertNull(applicationAttempt.createClientToken(null));
// Check events
verify(masterService).
registerAppAttempt(applicationAttempt.getAppAttemptId());
verify(scheduler).handle(any(AppAttemptAddedSchedulerEvent.class));
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
/**
* {@link RMAppAttemptState#SUBMITTED}
*/
private void testAppAttemptSubmittedState() {
assertEquals(RMAppAttemptState.SUBMITTED,
applicationAttempt.getAppAttemptState());
assertEquals(0, applicationAttempt.getDiagnostics().length());
assertEquals(0,applicationAttempt.getJustFinishedContainers().size());
assertNull(applicationAttempt.getMasterContainer());
assertEquals(0.0, (double)applicationAttempt.getProgress(), 0.0001);
assertEquals(0, application.getRanNodes().size());
assertNull(applicationAttempt.getFinalApplicationStatus());
if (UserGroupInformation.isSecurityEnabled()) {
verify(clientToAMTokenManager).createMasterKey(
applicationAttempt.getAppAttemptId());
// can't create ClientToken as at this time ClientTokenMasterKey has
// not been registered in the SecretManager
assertNull(applicationAttempt.createClientToken("some client"));
}
assertNull(applicationAttempt.createClientToken(null));
// Check events
verify(masterService).
registerAppAttempt(applicationAttempt.getAppAttemptId());
verify(scheduler).handle(any(AppAttemptAddedSchedulerEvent.class));
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
List<NMContainerStatus> containerReports = new ArrayList<>();
containerReports.add(containerReport);
scheduler.handle(new NodeAddedSchedulerEvent(node1, containerReports));
RMContainer rmContainer = scheduler.getRMContainer(containerId);
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
scheduler.handle(new NodeAddedSchedulerEvent(node1));
Assert.assertEquals(1, scheduler.getNumClusterNodes());
maxVCores = scheduler.getMaximumResourceCapability().getVirtualCores();
Assert.assertEquals(expectedMaxVCores[1], maxVCores);
scheduler.handle(new NodeRemovedSchedulerEvent(node1));
Assert.assertEquals(0, scheduler.getNumClusterNodes());
maxVCores = scheduler.getMaximumResourceCapability().getVirtualCores();
scheduler.handle(new NodeAddedSchedulerEvent(node2));
Assert.assertEquals(1, scheduler.getNumClusterNodes());
maxVCores = scheduler.getMaximumResourceCapability().getVirtualCores();
scheduler.handle(new NodeAddedSchedulerEvent(node3));
Assert.assertEquals(2, scheduler.getNumClusterNodes());
maxVCores = scheduler.getMaximumResourceCapability().getVirtualCores();
Assert.assertEquals(expectedMaxVCores[4], maxVCores);
scheduler.handle(new NodeRemovedSchedulerEvent(node3));
Assert.assertEquals(1, scheduler.getNumClusterNodes());
maxVCores = scheduler.getMaximumResourceCapability().getVirtualCores();
Assert.assertEquals(expectedMaxVCores[5], maxVCores);
scheduler.handle(new NodeRemovedSchedulerEvent(node2));
Assert.assertEquals(0, scheduler.getNumClusterNodes());
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
scheduler.handle(new NodeAddedSchedulerEvent(node1));
Assert.assertEquals(1, scheduler.getNumClusterNodes());
maxMemory = scheduler.getMaximumResourceCapability().getMemorySize();
Assert.assertEquals(expectedMaxMemory[1], maxMemory);
scheduler.handle(new NodeRemovedSchedulerEvent(node1));
Assert.assertEquals(0, scheduler.getNumClusterNodes());
maxMemory = scheduler.getMaximumResourceCapability().getMemorySize();
scheduler.handle(new NodeAddedSchedulerEvent(node2));
Assert.assertEquals(1, scheduler.getNumClusterNodes());
maxMemory = scheduler.getMaximumResourceCapability().getMemorySize();
scheduler.handle(new NodeAddedSchedulerEvent(node3));
Assert.assertEquals(2, scheduler.getNumClusterNodes());
maxMemory = scheduler.getMaximumResourceCapability().getMemorySize();
Assert.assertEquals(expectedMaxMemory[4], maxMemory);
scheduler.handle(new NodeRemovedSchedulerEvent(node3));
Assert.assertEquals(1, scheduler.getNumClusterNodes());
maxMemory = scheduler.getMaximumResourceCapability().getMemorySize();
Assert.assertEquals(expectedMaxMemory[5], maxMemory);
scheduler.handle(new NodeRemovedSchedulerEvent(node2));
Assert.assertEquals(0, scheduler.getNumClusterNodes());
所以我有一个 ResourceManager,它指向一个包含一堆字符串的资源文件。当我使用文件中不存在的键调用 GetString() 时,我得到一个 System.Resources.Missing
我正在尝试将 Azure.ResourceManager.AppContainers 与 Azure.ResourceManager.ContainerRegistry 集成,但我不清楚如何一起使用它
我在 Windows 64 上以伪分布式模式运行 hadoop 2.7.1,无法运行 yarn。每当我尝试通过 yarn resourcemanager 启动它时,我都会得到以下输出: The sys
扩展其中一个问题: Hadoop: Connecting to ResourceManager failed Hadoop 2.6.1 我确实配置了 ResourceManager HA。 当我确实终
如果执行 ResourceManager.GetString(Key),您可以获取资源中某个项目的值。有没有一种方法可以进行反向查找以从给定值的资源中获取 key (本质上是反翻译)? 最佳答案 您应
我有一个从外部文件加载资源的库,如下所示: ResourceManager rm = ResourceManager.CreateFileBasedResourceManager(stringsFil
我使用 ResourceManager 对我的 WinCE 5 软件进行 UI 本地化。我有一些资源文件,其中包含不同语言的文本字符串 Resourse.resx Resourse.de-DE.res
我有一个托管 C++ 项目,它编译为一个库并被一个 Windows 窗体 .exe 引用。此库又引用包含本地化代码的 DLL。 ResourceManager 的构造函数需要一个表示资源父级的 Ass
我有一个类库——称之为框架。在 assemblyinfo.cs 中,我有: [assembly: NeutralResourcesLanguage("en-US")] 在\Resources\目录下,
我编写的 Winforms .Net 4 应用程序的客户端现在经常报告由于“参数无效”错误而导致的崩溃。 所有“图像”实际上都是很小的资源图标(16x16 像素),而且数量不多。它们都是通过资源管理器
我有一个 .net-core 2.0 控制台应用程序。本应用引用了一个.net-standard-2.0库,其中包含一个资源文件SqlStatements.resx,其中包含多个sql文件。 文件配置
我正在开发一个使用本地化 resx 资源文件的 wpf/prism 4 应用程序。经过一些调试(它没有按预期工作)我看到我的资源管理器的所有资源集都具有相同的值。默认 loc.resx 的值。 我的问
我正在使用 amazon aws cli 工具启动 AWS EMR 集群。我有一个在 master 上运行的 boostrap 操作并运行以下命令 hdfs dfs -put /home/ha
在 ResourceManager (nodemanager:8088/cluster/nodes) 中我只能看到一个节点是正常的吗? 在我的测试环境中,我设置了两个节点集群并命令 bin/hdfs
我收到以下错误,但 netstat 显示 8088 未使用。 这是一个 3 节点集群,Namenode、Jobtracker、Datanode 运行在不同的 EC2 实例上 2014-02-04 02
我使用本地化和语言属性翻译了我的 Form1。 在 Form1_Load 事件中,我想为标签、按钮等设置文本... private void Form1_Load(object sender, Eve
我很好奇是否有人在使用 ResourceManager 创建单元测试时遇到任何问题。我正在使用 Visual Studio 测试版,似乎在测试期间没有加载附属程序集。当我尝试为另一种文化获取资源时,测
我使用在 this blog by Alex Adamyan 上找到的代码创建了一个本地化的 MVC 网站。 . 如果我使用现有的文化,这非常有效。但是,我正在尝试本地化他加禄语(tl 或 tl-PH
我想将由ambari管理的 yarn 簇更新为HA。但是我不想重新启动Zookeeper。 为什么ambari ResourceManager HA需要重新启动Zookeeper? 最佳答案 Zook
我在yarn-site.xml中有一个配置条目,如下所示: yarn.resourcemanager.am.max-attempts 4 考虑到以下两种情况,我想问一下它的真正含义: 说,
我是一名优秀的程序员,十分优秀!