gpt4 book ai didi

org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler.allocate()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 01:38:49 24 4
gpt4 key购买 nike

本文整理了Java中org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler.allocate()方法的一些代码示例,展示了YarnScheduler.allocate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnScheduler.allocate()方法的具体详情如下:
包路径:org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler
类名称:YarnScheduler
方法名:allocate

YarnScheduler.allocate介绍

[英]The main api between the ApplicationMaster and the Scheduler. The ApplicationMaster is updating his future resource requirements and may release containers he doens't need.
[中]ApplicationMaster和调度器之间的主api。应用程序管理员正在更新他未来的资源需求,可能会发布他不需要的容器。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

/**
 * {@link RMAppAttemptState#ALLOCATED}
 */
@SuppressWarnings("unchecked")
private void testAppAttemptAllocatedState(Container amContainer) {
 assertEquals(RMAppAttemptState.ALLOCATED, 
   applicationAttempt.getAppAttemptState());
 assertEquals(amContainer, applicationAttempt.getMasterContainer());
 // Check events
 verify(applicationMasterLauncher).handle(any(AMLauncherEvent.class));
 verify(scheduler, times(2)).allocate(any(ApplicationAttemptId.class),
   any(List.class), any(List.class), any(List.class), any(List.class), any(List.class),
   any(ContainerUpdates.class));
 verify(nmTokenManager).clearNodeSetForAttempt(
  applicationAttempt.getAppAttemptId());
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

/**
 * {@link RMAppAttemptState#ALLOCATED}
 */
@SuppressWarnings("unchecked")
private void testAppAttemptAllocatedState(Container amContainer) {
 assertEquals(RMAppAttemptState.ALLOCATED, 
   applicationAttempt.getAppAttemptState());
 assertEquals(amContainer, applicationAttempt.getMasterContainer());
 // Check events
 verify(applicationMasterLauncher).handle(any(AMLauncherEvent.class));
 verify(scheduler, times(2)).
   allocate(
     any(
       ApplicationAttemptId.class), any(List.class), any(List.class), 
       any(List.class), any(List.class));
 verify(nmTokenManager).clearNodeSetForAttempt(
  applicationAttempt.getAppAttemptId());
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

appAttempt.scheduler.allocate(appAttempt.applicationAttemptId,
  Collections.singletonList(appAttempt.amReq),
  EMPTY_CONTAINER_RELEASE_LIST, null, null);

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

appAttempt.scheduler.allocate(appAttempt.applicationAttemptId,
  Collections.singletonList(appAttempt.amReq),
  EMPTY_CONTAINER_RELEASE_LIST, null, null);

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

public void testScheduleTransitionReplaceAMContainerRequestWithDefaults() {
 YarnScheduler mockScheduler = mock(YarnScheduler.class);
 when(mockScheduler.allocate(any(ApplicationAttemptId.class),
   any(List.class), any(List.class), any(List.class), any(List.class), any(List.class),
   any(ContainerUpdates.class)))

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

YarnScheduler mockScheduler = mock(YarnScheduler.class);
when(
  mockScheduler.allocate(any(ApplicationAttemptId.class),
    any(List.class), any(List.class), any(List.class), any(List.class)))
  .thenAnswer(new Answer<Allocation>() {

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

/**
 * {@link RMAppAttemptState#SCHEDULED}
 */
@SuppressWarnings("unchecked")
private void testAppAttemptScheduledState() {
 RMAppAttemptState expectedState;
 int expectedAllocateCount;
 if(unmanagedAM) {
  expectedState = RMAppAttemptState.LAUNCHED;
  expectedAllocateCount = 0;
 } else {
  expectedState = RMAppAttemptState.SCHEDULED;
  expectedAllocateCount = 1;
 }
 assertEquals(expectedState, applicationAttempt.getAppAttemptState());
 verify(scheduler, times(expectedAllocateCount)).allocate(
   any(ApplicationAttemptId.class), any(List.class), eq(null), any(List.class),
   any(List.class), any(List.class), any(ContainerUpdates.class));
 assertEquals(0,applicationAttempt.getJustFinishedContainers().size());
 assertNull(applicationAttempt.getMasterContainer());
 assertEquals(0.0, (double)applicationAttempt.getProgress(), 0.0001);
 assertEquals(0, application.getRanNodes().size());
 assertNull(applicationAttempt.getFinalApplicationStatus());
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

/**
 * {@link RMAppAttemptState#SCHEDULED}
 */
@SuppressWarnings("unchecked")
private void testAppAttemptScheduledState() {
 RMAppAttemptState expectedState;
 int expectedAllocateCount;
 if(unmanagedAM) {
  expectedState = RMAppAttemptState.LAUNCHED;
  expectedAllocateCount = 0;
 } else {
  expectedState = RMAppAttemptState.SCHEDULED;
  expectedAllocateCount = 1;
 }
 assertEquals(expectedState, 
   applicationAttempt.getAppAttemptState());
 verify(scheduler, times(expectedAllocateCount)).
 allocate(any(ApplicationAttemptId.class), 
   any(List.class), any(List.class), any(List.class), any(List.class));
 assertEquals(0,applicationAttempt.getJustFinishedContainers().size());
 assertNull(applicationAttempt.getMasterContainer());
 assertEquals(0.0, (double)applicationAttempt.getProgress(), 0.0001);
 assertEquals(0, application.getRanNodes().size());
 assertNull(applicationAttempt.getFinalApplicationStatus());
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

appAttempt.scheduler.allocate(appAttempt.applicationAttemptId,
 EMPTY_CONTAINER_REQUEST_LIST, EMPTY_CONTAINER_RELEASE_LIST, null,
 null);

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

appAttempt.scheduler.allocate(appAttempt.applicationAttemptId,
 EMPTY_CONTAINER_REQUEST_LIST, null, EMPTY_CONTAINER_RELEASE_LIST, null,
 null, new ContainerUpdates());

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

appAttempt.scheduler.allocate(appAttempt.applicationAttemptId,
 EMPTY_CONTAINER_REQUEST_LIST, EMPTY_CONTAINER_RELEASE_LIST, null,
 null);

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

when(allocation.getContainers()).
  thenReturn(Collections.singletonList(container));
when(scheduler.allocate(any(ApplicationAttemptId.class), any(List.class),
  any(List.class), any(List.class), any(List.class), any(List.class),
  any(ContainerUpdates.class))).

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

thenReturn(Collections.singletonList(container));
when(
  scheduler.allocate(
    any(ApplicationAttemptId.class), 
    any(List.class),

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

appAttempt.scheduler.allocate(
  appAttempt.applicationAttemptId,
  appAttempt.amReqs, null, EMPTY_CONTAINER_RELEASE_LIST,

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

when(allocation.getContainers()).
  thenReturn(Collections.singletonList(amContainer));
when(scheduler.allocate(any(ApplicationAttemptId.class), any(List.class),
  any(List.class), any(List.class), any(List.class), any(List.class),
  any(ContainerUpdates.class)))

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

when(allocation.getContainers()).
  thenReturn(Collections.singletonList(amContainer));
when(scheduler.allocate(any(ApplicationAttemptId.class), any(List.class),
  any(List.class), any(List.class), any(List.class))).thenReturn(allocation);
RMContainer rmContainer = mock(RMContainerImpl.class);

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

} else {
 try {
  allocation = getScheduler().allocate(appAttemptId, ask,
    request.getSchedulingRequests(), release,
    blacklistAdditions, blacklistRemovals, containerUpdateRequests);

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

this.rScheduler.allocate(appAttemptId, ask, release, 
  blacklistAdditions, blacklistRemovals);

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

this.rScheduler.allocate(appAttemptId, ask, release, 
  blacklistAdditions, blacklistRemovals);

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com