• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java UpdateNodeResourceRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest的典型用法代码示例。如果您正苦于以下问题:Java UpdateNodeResourceRequest类的具体用法?Java UpdateNodeResourceRequest怎么用?Java UpdateNodeResourceRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UpdateNodeResourceRequest类属于org.apache.hadoop.yarn.server.api.protocolrecords包,在下文中一共展示了UpdateNodeResourceRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: updateNodeResource

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
private int updateNodeResource(String nodeIdStr, int memSize,
    int cores, int overCommitTimeout) throws IOException, YarnException {
  // check resource value first
  if (invalidResourceValue(memSize, cores)) {
    throw new IllegalArgumentException("Invalid resource value: " + "(" +
        memSize + "," + cores + ") for updateNodeResource.");
  }
  // Refresh the nodes
  ResourceManagerAdministrationProtocol adminProtocol = createAdminProtocol();
  UpdateNodeResourceRequest request =
    recordFactory.newRecordInstance(UpdateNodeResourceRequest.class);
  NodeId nodeId = ConverterUtils.toNodeId(nodeIdStr);
  
  Resource resource = Resources.createResource(memSize, cores);
  Map<NodeId, ResourceOption> resourceMap =
      new HashMap<NodeId, ResourceOption>();
  resourceMap.put(
      nodeId, ResourceOption.newInstance(resource, overCommitTimeout));
  request.setNodeResourceMap(resourceMap);
  adminProtocol.updateNodeResource(request);
  return 0;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:23,代码来源:RMAdminCLI.java


示例2: testUpdateNodeResource

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
@Test(timeout=500)
public void testUpdateNodeResource() throws Exception {
  String nodeIdStr = "0.0.0.0:0";
  int memSize = 2048;
  int cores = 2;
  String[] args = { "-updateNodeResource", nodeIdStr,
      Integer.toString(memSize), Integer.toString(cores) };
  assertEquals(0, rmAdminCLI.run(args));
  ArgumentCaptor<UpdateNodeResourceRequest> argument =
      ArgumentCaptor.forClass(UpdateNodeResourceRequest.class);
  verify(admin).updateNodeResource(argument.capture());
  UpdateNodeResourceRequest request = argument.getValue();
  Map<NodeId, ResourceOption> resourceMap = request.getNodeResourceMap();
  NodeId nodeId = ConverterUtils.toNodeId(nodeIdStr);
  Resource expectedResource = Resources.createResource(memSize, cores);
  ResourceOption resource = resourceMap.get(nodeId);
  assertNotNull("resource for " + nodeIdStr + " shouldn't be null.",
      resource);
  assertEquals("resource value for " + nodeIdStr + " is not as expected.",
      ResourceOption.newInstance(expectedResource,
          ResourceOption.OVER_COMMIT_TIMEOUT_MILLIS_DEFAULT),
      resource);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:24,代码来源:TestRMAdminCLI.java


示例3: updateNodeResource

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
private int updateNodeResource(String nodeIdStr, int memSize,
    int cores, int overCommitTimeout) throws IOException, YarnException {
  // check resource value first
  if (invalidResourceValue(memSize, cores)) {
    throw new IllegalArgumentException("Invalid resource value: " + "(" +
        memSize + "," + cores + ") for updateNodeResource.");
  }
  // Refresh the nodes
  ResourceManagerAdministrationProtocol adminProtocol = createAdminProtocol();
  UpdateNodeResourceRequest request =
    recordFactory.newRecordInstance(UpdateNodeResourceRequest.class);
  NodeId nodeId = NodeId.fromString(nodeIdStr);
  
  Resource resource = Resources.createResource(memSize, cores);
  Map<NodeId, ResourceOption> resourceMap =
      new HashMap<NodeId, ResourceOption>();
  resourceMap.put(
      nodeId, ResourceOption.newInstance(resource, overCommitTimeout));
  request.setNodeResourceMap(resourceMap);
  adminProtocol.updateNodeResource(request);
  return 0;
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:23,代码来源:RMAdminCLI.java


示例4: testUpdateNodeResource

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
@Test
public void testUpdateNodeResource() throws Exception {
  String nodeIdStr = "0.0.0.0:0";
  int memSize = 2048;
  int cores = 2;
  String[] args = { "-updateNodeResource", nodeIdStr,
      Integer.toString(memSize), Integer.toString(cores) };
  assertEquals(0, rmAdminCLI.run(args));
  ArgumentCaptor<UpdateNodeResourceRequest> argument =
      ArgumentCaptor.forClass(UpdateNodeResourceRequest.class);
  verify(admin).updateNodeResource(argument.capture());
  UpdateNodeResourceRequest request = argument.getValue();
  Map<NodeId, ResourceOption> resourceMap = request.getNodeResourceMap();
  NodeId nodeId = NodeId.fromString(nodeIdStr);
  Resource expectedResource = Resources.createResource(memSize, cores);
  ResourceOption resource = resourceMap.get(nodeId);
  assertNotNull("resource for " + nodeIdStr + " shouldn't be null.",
      resource);
  assertEquals("resource value for " + nodeIdStr + " is not as expected.",
      ResourceOption.newInstance(expectedResource,
          ResourceOption.OVER_COMMIT_TIMEOUT_MILLIS_DEFAULT),
      resource);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:24,代码来源:TestRMAdminCLI.java


示例5: updateNodeResource

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
@Override
public UpdateNodeResourceResponse updateNodeResource(
    UpdateNodeResourceRequest request) throws YarnException, IOException {
  UpdateNodeResourceRequestProto requestProto =
      ((UpdateNodeResourceRequestPBImpl) request).getProto();
  try {
    return new UpdateNodeResourceResponsePBImpl(proxy.updateNodeResource(null,
        requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:ResourceManagerAdministrationProtocolPBClientImpl.java


示例6: testUpdateNodeResource

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
@Test
public void testUpdateNodeResource() throws Exception {
  UpdateNodeResourceRequest request = recordFactory
          .newRecordInstance(UpdateNodeResourceRequest.class);
  UpdateNodeResourceResponse response = client.updateNodeResource(request);
  assertNotNull(response);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TestResourceManagerAdministrationProtocolPBClientImpl.java


示例7: testUpdateNodeResourceWithInvalidValue

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
@Test(timeout=500)
public void testUpdateNodeResourceWithInvalidValue() throws Exception {
  String nodeIdStr = "0.0.0.0:0";
  int memSize = -2048;
  int cores = 2;
  String[] args = { "-updateNodeResource", nodeIdStr,
      Integer.toString(memSize), Integer.toString(cores) };
  // execution of command line is expected to be failed
  assertEquals(-1, rmAdminCLI.run(args));
  // verify admin protocol never calls. 
  verify(admin,times(0)).updateNodeResource(
      any(UpdateNodeResourceRequest.class));
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:14,代码来源:TestRMAdminCLI.java


示例8: testUpdateNodeResourceWithInvalidValue

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
@Test
public void testUpdateNodeResourceWithInvalidValue() throws Exception {
  String nodeIdStr = "0.0.0.0:0";
  int memSize = -2048;
  int cores = 2;
  String[] args = { "-updateNodeResource", nodeIdStr,
      Integer.toString(memSize), Integer.toString(cores) };
  // execution of command line is expected to be failed
  assertEquals(-1, rmAdminCLI.run(args));
  // verify admin protocol never calls. 
  verify(admin,times(0)).updateNodeResource(
      any(UpdateNodeResourceRequest.class));
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:14,代码来源:TestRMAdminCLI.java


示例9: testResourceOverCommit

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
@Test
public void testResourceOverCommit() throws Exception {
  MockRM rm = new MockRM(conf);
  rm.start();
  
  MockNM nm1 = rm.registerNode("127.0.0.1:1234", 4 * GB);
  
  RMApp app1 = rm.submitApp(2048);
  // kick the scheduling, 2 GB given to AM1, remaining 2GB on nm1
  nm1.nodeHeartbeat(true);
  RMAppAttempt attempt1 = app1.getCurrentAppAttempt();
  MockAM am1 = rm.sendAMLaunched(attempt1.getAppAttemptId());
  am1.registerAppAttempt();
  SchedulerNodeReport report_nm1 = rm.getResourceScheduler().getNodeReport(
      nm1.getNodeId());
  // check node report, 2 GB used and 2 GB available
  Assert.assertEquals(2 * GB, report_nm1.getUsedResource().getMemory());
  Assert.assertEquals(2 * GB, report_nm1.getAvailableResource().getMemory());

  // add request for containers
  am1.addRequests(new String[] { "127.0.0.1", "127.0.0.2" }, 2 * GB, 1, 1);
  AllocateResponse alloc1Response = am1.schedule(); // send the request

  // kick the scheduler, 2 GB given to AM1, resource remaining 0
  nm1.nodeHeartbeat(true);
  while (alloc1Response.getAllocatedContainers().size() < 1) {
    LOG.info("Waiting for containers to be created for app 1...");
    Thread.sleep(1000);
    alloc1Response = am1.schedule();
  }

  List<Container> allocated1 = alloc1Response.getAllocatedContainers();
  Assert.assertEquals(1, allocated1.size());
  Assert.assertEquals(2 * GB, allocated1.get(0).getResource().getMemory());
  Assert.assertEquals(nm1.getNodeId(), allocated1.get(0).getNodeId());
  
  report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
  // check node report, 4 GB used and 0 GB available
  Assert.assertEquals(0, report_nm1.getAvailableResource().getMemory());
  Assert.assertEquals(4 * GB, report_nm1.getUsedResource().getMemory());

  // check container is assigned with 2 GB.
  Container c1 = allocated1.get(0);
  Assert.assertEquals(2 * GB, c1.getResource().getMemory());
  
  // update node resource to 2 GB, so resource is over-consumed.
  Map<NodeId, ResourceOption> nodeResourceMap = 
      new HashMap<NodeId, ResourceOption>();
  nodeResourceMap.put(nm1.getNodeId(), 
      ResourceOption.newInstance(Resource.newInstance(2 * GB, 1, 1), -1));
  UpdateNodeResourceRequest request = 
      UpdateNodeResourceRequest.newInstance(nodeResourceMap);
  AdminService as = rm.adminService;
  as.updateNodeResource(request);
  
  // Now, the used resource is still 4 GB, and available resource is minus value.
  report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
  Assert.assertEquals(4 * GB, report_nm1.getUsedResource().getMemory());
  Assert.assertEquals(-2 * GB, report_nm1.getAvailableResource().getMemory());
  
  // Check container can complete successfully in case of resource over-commitment.
  ContainerStatus containerStatus = BuilderUtils.newContainerStatus(
      c1.getId(), ContainerState.COMPLETE, "", 0);
  nm1.containerStatus(containerStatus);
  int waitCount = 0;
  while (attempt1.getJustFinishedContainers().size() < 1
      && waitCount++ != 20) {
    LOG.info("Waiting for containers to be finished for app 1... Tried "
        + waitCount + " times already..");
    Thread.sleep(100);
  }
  Assert.assertEquals(1, attempt1.getJustFinishedContainers().size());
  Assert.assertEquals(1, am1.schedule().getCompletedContainersStatuses().size());
  report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
  Assert.assertEquals(2 * GB, report_nm1.getUsedResource().getMemory());
  // As container return 2 GB back, the available resource becomes 0 again.
  Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemory());
  rm.stop();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:80,代码来源:TestFifoScheduler.java


示例10: refreshNodesResources

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
@Override
public RefreshNodesResourcesResponse refreshNodesResources(
    RefreshNodesResourcesRequest request)
    throws YarnException, StandbyException {
  String argName = "refreshNodesResources";
  UserGroupInformation user = checkAcls(argName);
  final String msg = "refresh nodes.";

  checkRMStatus(user.getShortUserName(), argName, msg);

  RefreshNodesResourcesResponse response =
      recordFactory.newRecordInstance(RefreshNodesResourcesResponse.class);

  try {
    Configuration conf = getConfig();
    Configuration configuration = new Configuration(conf);
    DynamicResourceConfiguration newconf;

    InputStream DRInputStream =
      this.rmContext.getConfigurationProvider()
      .getConfigurationInputStream(configuration,
        YarnConfiguration.DR_CONFIGURATION_FILE);
    if (DRInputStream != null) {
      configuration.addResource(DRInputStream);
      newconf = new DynamicResourceConfiguration(configuration, false);
    } else {
      newconf = new DynamicResourceConfiguration(configuration, true);
    }

    if (newconf.getNodes().length == 0) {
      RMAuditLogger.logSuccess(user.getShortUserName(), argName,
          "AdminService");
      return response;
    } else {
      Map<NodeId, ResourceOption> nodeResourceMap =
        newconf.getNodeResourceMap();

      UpdateNodeResourceRequest updateRequest =
        UpdateNodeResourceRequest.newInstance(nodeResourceMap);
      updateNodeResource(updateRequest);
      RMAuditLogger.logSuccess(user.getShortUserName(), argName,
        "AdminService");
      return response;
    }
  } catch (IOException ioe) {
    throw logAndWrapException(ioe, user.getShortUserName(), argName, msg);
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:49,代码来源:AdminService.java


示例11: testResourceOverCommit

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
@Test(timeout = 60000)
public void testResourceOverCommit() throws Exception {
  MockRM rm = new MockRM(conf);
  rm.start();

  MockNM nm1 = rm.registerNode("127.0.0.1:1234", 4 * GB);

  RMApp app1 = rm.submitApp(2048);
  // kick the scheduling, 2 GB given to AM1, remaining 2GB on nm1
  nm1.nodeHeartbeat(true);
  RMAppAttempt attempt1 = app1.getCurrentAppAttempt();
  MockAM am1 = rm.sendAMLaunched(attempt1.getAppAttemptId());
  am1.registerAppAttempt();
  SchedulerNodeReport report_nm1 =
      rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
  // check node report, 2 GB used and 2 GB available
  Assert.assertEquals(2 * GB, report_nm1.getUsedResource().getMemory());
  Assert.assertEquals(2 * GB, report_nm1.getAvailableResource().getMemory());

  // add request for containers
  am1.addRequests(new String[] { "127.0.0.1", "127.0.0.2" }, 2 * GB, 1, 1);
  AllocateResponse alloc1Response = am1.schedule(); // send the request

  // kick the scheduler, 2 GB given to AM1, resource remaining 0
  nm1.nodeHeartbeat(true);
  while (alloc1Response.getAllocatedContainers().size() < 1) {
    LOG.info("Waiting for containers to be created for app 1...");
    Thread.sleep(1000);
    alloc1Response = am1.schedule();
  }

  List<Container> allocated1 = alloc1Response.getAllocatedContainers();
  Assert.assertEquals(1, allocated1.size());
  Assert.assertEquals(2 * GB, allocated1.get(0).getResource().getMemory());
  Assert.assertEquals(nm1.getNodeId(), allocated1.get(0).getNodeId());

  report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
  // check node report, 4 GB used and 0 GB available
  Assert.assertEquals(0, report_nm1.getAvailableResource().getMemory());
  Assert.assertEquals(4 * GB, report_nm1.getUsedResource().getMemory());

  // check container is assigned with 2 GB.
  Container c1 = allocated1.get(0);
  Assert.assertEquals(2 * GB, c1.getResource().getMemory());

  // update node resource to 2 GB, so resource is over-consumed.
  Map<NodeId, ResourceOption> nodeResourceMap =
      new HashMap<NodeId, ResourceOption>();
  nodeResourceMap.put(nm1.getNodeId(),
      ResourceOption.newInstance(Resource.newInstance(2 * GB, 1), -1));
  UpdateNodeResourceRequest request =
      UpdateNodeResourceRequest.newInstance(nodeResourceMap);
  rm.getAdminService().updateNodeResource(request);

  // Now, the used resource is still 4 GB, and available resource is minus
  // value.
  report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
  Assert.assertEquals(4 * GB, report_nm1.getUsedResource().getMemory());
  Assert.assertEquals(-2 * GB, report_nm1.getAvailableResource().getMemory());

  // Check container can complete successfully in case of resource
  // over-commitment.
  ContainerStatus containerStatus =
      BuilderUtils.newContainerStatus(c1.getId(), ContainerState.COMPLETE,
          "", 0, c1.getResource());
  nm1.containerStatus(containerStatus);
  int waitCount = 0;
  while (attempt1.getJustFinishedContainers().size() < 1 && waitCount++ != 20) {
    LOG.info("Waiting for containers to be finished for app 1... Tried "
        + waitCount + " times already..");
    Thread.sleep(100);
  }
  Assert.assertEquals(1, attempt1.getJustFinishedContainers().size());
  Assert.assertEquals(1, am1.schedule().getCompletedContainersStatuses()
      .size());
  report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
  Assert.assertEquals(2 * GB, report_nm1.getUsedResource().getMemory());
  // As container return 2 GB back, the available resource becomes 0 again.
  Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemory());
  rm.stop();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:82,代码来源:TestFifoScheduler.java


示例12: testResourceOverCommit

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
@Test
public void testResourceOverCommit() throws Exception {
  MockRM rm = new MockRM(conf);
  rm.start();
  
  MockNM nm1 = rm.registerNode("127.0.0.1:1234", 4 * GB);
  
  RMApp app1 = rm.submitApp(2048);
  // kick the scheduling, 2 GB given to AM1, remaining 2GB on nm1
  nm1.nodeHeartbeat(true);
  RMAppAttempt attempt1 = app1.getCurrentAppAttempt();
  MockAM am1 = rm.sendAMLaunched(attempt1.getAppAttemptId());
  am1.registerAppAttempt();
  SchedulerNodeReport report_nm1 = rm.getResourceScheduler().getNodeReport(
      nm1.getNodeId());
  // check node report, 2 GB used and 2 GB available
  Assert.assertEquals(2 * GB, report_nm1.getUsedResource().getMemory());
  Assert.assertEquals(2 * GB, report_nm1.getAvailableResource().getMemory());

  // add request for containers
  am1.addRequests(new String[] { "127.0.0.1", "127.0.0.2" }, 2 * GB, 1, 1);
  AllocateResponse alloc1Response = am1.schedule(); // send the request

  // kick the scheduler, 2 GB given to AM1, resource remaining 0
  nm1.nodeHeartbeat(true);
  while (alloc1Response.getAllocatedContainers().size() < 1) {
    LOG.info("Waiting for containers to be created for app 1...");
    Thread.sleep(1000);
    alloc1Response = am1.schedule();
  }

  List<Container> allocated1 = alloc1Response.getAllocatedContainers();
  Assert.assertEquals(1, allocated1.size());
  Assert.assertEquals(2 * GB, allocated1.get(0).getResource().getMemory());
  Assert.assertEquals(nm1.getNodeId(), allocated1.get(0).getNodeId());
  
  report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
  // check node report, 4 GB used and 0 GB available
  Assert.assertEquals(0, report_nm1.getAvailableResource().getMemory());
  Assert.assertEquals(4 * GB, report_nm1.getUsedResource().getMemory());

  // check container is assigned with 2 GB.
  Container c1 = allocated1.get(0);
  Assert.assertEquals(2 * GB, c1.getResource().getMemory());
  
  // update node resource to 2 GB, so resource is over-consumed.
  Map<NodeId, ResourceOption> nodeResourceMap = 
      new HashMap<NodeId, ResourceOption>();
  nodeResourceMap.put(nm1.getNodeId(), 
      ResourceOption.newInstance(Resource.newInstance(2 * GB, 1), -1));
  UpdateNodeResourceRequest request = 
      UpdateNodeResourceRequest.newInstance(nodeResourceMap);
  AdminService as = rm.adminService;
  as.updateNodeResource(request);
  
  // Now, the used resource is still 4 GB, and available resource is minus value.
  report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
  Assert.assertEquals(4 * GB, report_nm1.getUsedResource().getMemory());
  Assert.assertEquals(-2 * GB, report_nm1.getAvailableResource().getMemory());
  
  // Check container can complete successfully in case of resource over-commitment.
  ContainerStatus containerStatus = BuilderUtils.newContainerStatus(
      c1.getId(), ContainerState.COMPLETE, "", 0);
  nm1.containerStatus(containerStatus);
  int waitCount = 0;
  while (attempt1.getJustFinishedContainers().size() < 1
      && waitCount++ != 20) {
    LOG.info("Waiting for containers to be finished for app 1... Tried "
        + waitCount + " times already..");
    Thread.sleep(100);
  }
  Assert.assertEquals(1, attempt1.getJustFinishedContainers().size());
  Assert.assertEquals(1, am1.schedule().getCompletedContainersStatuses().size());
  report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
  Assert.assertEquals(2 * GB, report_nm1.getUsedResource().getMemory());
  // As container return 2 GB back, the available resource becomes 0 again.
  Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemory());
  rm.stop();
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:80,代码来源:TestFifoScheduler.java


示例13: refreshNodesResources

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
@Override
public RefreshNodesResourcesResponse refreshNodesResources(
    RefreshNodesResourcesRequest request)
    throws YarnException, StandbyException {
  final String operation = "refreshNodesResources";
  UserGroupInformation user = checkAcls(operation);
  final String msg = "refresh nodes.";

  checkRMStatus(user.getShortUserName(), operation, msg);

  RefreshNodesResourcesResponse response =
      recordFactory.newRecordInstance(RefreshNodesResourcesResponse.class);

  try {
    Configuration conf = getConfig();
    Configuration configuration = new Configuration(conf);
    DynamicResourceConfiguration newConf;

    InputStream drInputStream =
        this.rmContext.getConfigurationProvider().getConfigurationInputStream(
            configuration, YarnConfiguration.DR_CONFIGURATION_FILE);

    if (drInputStream != null) {
      newConf = new DynamicResourceConfiguration(configuration,
          drInputStream);
    } else {
      newConf = new DynamicResourceConfiguration(configuration);
    }

    if (newConf.getNodes() != null && newConf.getNodes().length != 0) {
      Map<NodeId, ResourceOption> nodeResourceMap =
          newConf.getNodeResourceMap();
      UpdateNodeResourceRequest updateRequest =
          UpdateNodeResourceRequest.newInstance(nodeResourceMap);
      updateNodeResource(updateRequest);
    }
    // refresh dynamic resource in ResourceTrackerService
    this.rmContext.getResourceTrackerService().
        updateDynamicResourceConfiguration(newConf);
    RMAuditLogger.logSuccess(user.getShortUserName(), operation,
            "AdminService");
    return response;
  } catch (IOException ioe) {
    throw logAndWrapException(ioe, user.getShortUserName(), operation, msg);
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:47,代码来源:AdminService.java


示例14: updateNodeResource

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
/**
 * <p>The interface used by admin to update nodes' resources to the
 * <code>ResourceManager</code> </p>.
 * 
 * <p>The admin client is required to provide details such as a map from 
 * {@link NodeId} to {@link ResourceOption} required to update resources on 
 * a list of <code>RMNode</code> in <code>ResourceManager</code> etc.
 * via the {@link UpdateNodeResourceRequest}.</p>
 * 
 * @param request request to update resource for a node in cluster.
 * @return (empty) response on accepting update.
 * @throws YarnException
 * @throws IOException
 */
@Public
@Evolving
@Idempotent
public UpdateNodeResourceResponse updateNodeResource(
    UpdateNodeResourceRequest request) 
throws YarnException, IOException;
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:ResourceManagerAdministrationProtocol.java


示例15: updateNodeResource

import org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest; //导入依赖的package包/类
/**
 * <p>The interface used by admin to update nodes' resources to the
 * <code>ResourceManager</code> </p>.
 * 
 * <p>The admin client is required to provide details such as a map from 
 * {@link NodeId} to {@link ResourceOption} required to update resources on 
 * a list of <code>RMNode</code> in <code>ResourceManager</code> etc.
 * via the {@link UpdateNodeResourceRequest}.</p>
 * 
 * @param request request to update resource for a node in cluster.
 * @return (empty) response on accepting update.
 * @throws YarnException
 * @throws IOException
 */
@Private
@Idempotent
public UpdateNodeResourceResponse updateNodeResource(
    UpdateNodeResourceRequest request) throws YarnException, IOException;
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:19,代码来源:ResourceManagerAdministrationProtocol.java



注:本文中的org.apache.hadoop.yarn.server.api.protocolrecords.UpdateNodeResourceRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MorphShape类代码示例发布时间:2022-05-22
下一篇:
Java ZKGroupTopicDirs类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap