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

Java SchedulerNodeReport类代码示例

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

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



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

示例1: createNodeReports

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
private NodeReport createNodeReports(RMNode rmNode) {    
  SchedulerNodeReport schedulerNodeReport = 
      scheduler.getNodeReport(rmNode.getNodeID());
  Resource used = BuilderUtils.newResource(0, 0, 0);
  int numContainers = 0;
  if (schedulerNodeReport != null) {
    used = schedulerNodeReport.getUsedResource();
    numContainers = schedulerNodeReport.getNumContainers();
  } 
  
  NodeReport report =
      BuilderUtils.newNodeReport(rmNode.getNodeID(), rmNode.getState(),
          rmNode.getHttpAddress(), rmNode.getRackName(), used,
          rmNode.getTotalCapability(), numContainers,
          rmNode.getHealthReport(), rmNode.getLastHealthReportTime(),
          rmNode.getNodeLabels());

  return report;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:ClientRMService.java


示例2: testMinimumAllocation

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
private void testMinimumAllocation(YarnConfiguration conf, int testAlloc)
    throws Exception {
  MockRM rm = new MockRM(conf);
  rm.start();

  // Register node1
  MockNM nm1 = rm.registerNode("127.0.0.1:1234", 6 * GB);

  // Submit an application
  RMApp app1 = rm.submitApp(testAlloc);

  // kick the scheduling
  nm1.nodeHeartbeat(true);
  RMAppAttempt attempt1 = app1.getCurrentAppAttempt();
  MockAM am1 = rm.sendAMLaunched(attempt1.getAppAttemptId());
  am1.registerAppAttempt();
  SchedulerNodeReport report_nm1 = rm.getResourceScheduler().getNodeReport(
      nm1.getNodeId());

  int checkAlloc =
      conf.getInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB);
  Assert.assertEquals(checkAlloc, report_nm1.getUsedResource().getMemory());

  rm.stop();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:27,代码来源:TestFifoScheduler.java


示例3: createNodeReports

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
private NodeReport createNodeReports(RMNode rmNode) {    
  SchedulerNodeReport schedulerNodeReport = 
      scheduler.getNodeReport(rmNode.getNodeID());
  Resource used = BuilderUtils.newResource(0, 0);
  int numContainers = 0;
  if (schedulerNodeReport != null) {
    used = schedulerNodeReport.getUsedResource();
    numContainers = schedulerNodeReport.getNumContainers();
  } 

  NodeReport report =
      BuilderUtils.newNodeReport(rmNode.getNodeID(), rmNode.getState(),
          rmNode.getHttpAddress(), rmNode.getRackName(), used,
          rmNode.getTotalCapability(), numContainers,
          rmNode.getHealthReport(), rmNode.getLastHealthReportTime(),
          rmNode.getNodeLabels(), rmNode.getAggregatedContainersUtilization(),
          rmNode.getNodeUtilization());

  return report;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:21,代码来源:ClientRMService.java


示例4: testMinimumAllocation

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
private void testMinimumAllocation(YarnConfiguration conf, int testAlloc)
    throws Exception {
  MockRM rm = new MockRM(conf);
  rm.start();

  // Register node1
  MockNM nm1 = rm.registerNode("127.0.0.1:1234", 6 * GB);

  // Submit an application
  RMApp app1 = rm.submitApp(testAlloc);

  // kick the scheduling
  nm1.nodeHeartbeat(true);
  RMAppAttempt attempt1 = app1.getCurrentAppAttempt();
  MockAM am1 = rm.sendAMLaunched(attempt1.getAppAttemptId());
  am1.registerAppAttempt();
  SchedulerNodeReport report_nm1 =
      rm.getResourceScheduler().getNodeReport(nm1.getNodeId());

  int checkAlloc =
      conf.getInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB);
  Assert.assertEquals(checkAlloc, report_nm1.getUsedResource().getMemory());

  rm.stop();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:27,代码来源:TestFifoScheduler.java


示例5: createNodeReports

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
private NodeReport createNodeReports(RMNode rmNode) {    
  SchedulerNodeReport schedulerNodeReport = 
      scheduler.getNodeReport(rmNode.getNodeID());
  Resource used = BuilderUtils.newResource(0, 0);
  int numContainers = 0;
  if (schedulerNodeReport != null) {
    used = schedulerNodeReport.getUsedResource();
    numContainers = schedulerNodeReport.getNumContainers();
  } 
  
  NodeReport report =
      BuilderUtils.newNodeReport(rmNode.getNodeID(), rmNode.getState(),
          rmNode.getHttpAddress(), rmNode.getRackName(), used,
          rmNode.getTotalCapability(), numContainers,
          rmNode.getHealthReport(), rmNode.getLastHealthReportTime(),
          rmNode.getNodeLabels());

  return report;
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:20,代码来源:ClientRMService.java


示例6: NodeInfo

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
public NodeInfo(RMNode ni, ResourceScheduler sched) {
  NodeId id = ni.getNodeID();
  SchedulerNodeReport report = sched.getNodeReport(id);
  this.numContainers = 0;
  this.usedMemoryMB = 0;
  this.availMemoryMB = 0;
  if (report != null) {
    this.numContainers = report.getNumContainers();
    this.usedMemoryMB = report.getUsedResource().getMemory();
    this.availMemoryMB = report.getAvailableResource().getMemory();
  }
  this.id = id.toString();
  this.rack = ni.getRackName();
  this.nodeHostName = ni.getHostName();
  this.state = ni.getState();
  this.nodeHTTPAddress = ni.getHttpAddress();
  this.lastHealthUpdate = ni.getLastHealthReportTime();
  this.healthReport = String.valueOf(ni.getHealthReport());
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:20,代码来源:NodeInfo.java


示例7: createNodeReports

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
private NodeReport createNodeReports(RMNode rmNode) {    
  SchedulerNodeReport schedulerNodeReport = 
      scheduler.getNodeReport(rmNode.getNodeID());
  Resource used = BuilderUtils.newResource(0, 0);
  int numContainers = 0;
  if (schedulerNodeReport != null) {
    used = schedulerNodeReport.getUsedResource();
    numContainers = schedulerNodeReport.getNumContainers();
  } 
  
  NodeReport report = BuilderUtils.newNodeReport(rmNode.getNodeID(),
      rmNode.getState(),
      rmNode.getHttpAddress(), rmNode.getRackName(), used,
      rmNode.getTotalCapability(), numContainers,
      rmNode.getHealthReport(),
      rmNode.getLastHealthReportTime());

  return report;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:20,代码来源:ClientRMService.java


示例8: testMinimumAllocation

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
private void testMinimumAllocation(YarnConfiguration conf, int testAlloc)
    throws Exception {
  MockRM rm = new MockRM(conf);
  rm.start();

  // Register node1
  MockNM nm1 = rm.registerNode("127.0.0.1:1234", 6 * GB);

  // Submit an application
  RMApp app1 = rm.submitApp(testAlloc);

  // kick the scheduling
  nm1.nodeHeartbeat(true);
  RMAppAttempt attempt1 = app1.getCurrentAppAttempt();
  MockAM am1 = rm.sendAMLaunched(attempt1.getAppAttemptId());
  am1.registerAppAttempt();
  SchedulerNodeReport report_nm1 =
      rm.getResourceScheduler().getNodeReport(nm1.getNodeId());

  int checkAlloc =
      conf.getInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB,
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB);
  Assert.assertEquals(checkAlloc, report_nm1.getUsedResource().getMemorySize());

  rm.stop();
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:27,代码来源:TestFifoScheduler.java


示例9: createNodeReports

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
private NodeReport createNodeReports(RMNode rmNode) {    
    SchedulerNodeReport schedulerNodeReport = 
        scheduler.getNodeReport(rmNode.getNodeID());
    Resource used = BuilderUtils.newResource(0, 0);
    int numContainers = 0;
    if (schedulerNodeReport != null) {
      used = schedulerNodeReport.getUsedResource();
      numContainers = schedulerNodeReport.getNumContainers();
    } 
    
    NodeReport report = BuilderUtils.newNodeReport(rmNode.getNodeID(),
        rmNode.getState(),
        rmNode.getHttpAddress(), rmNode.getRackName(), used,
        rmNode.getTotalCapability(), numContainers,
        rmNode.getHealthReport(),
        rmNode.getLastHealthReportTime(),
//Add by ME
	rmNode.getTrustReport(),
        rmNode.getLastTrustReportTime());	

    return report;
  }
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:23,代码来源:ClientRMService.java


示例10: NodeInfo

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
public NodeInfo(RMNode ni, ResourceScheduler sched) {
  NodeId id = ni.getNodeID();
  SchedulerNodeReport report = sched.getNodeReport(id);
  this.numContainers = 0;
  this.usedMemoryMB = 0;
  this.availMemoryMB = 0;
  if (report != null) {
    this.numContainers = report.getNumContainers();
    this.usedMemoryMB = report.getUsedResource().getMemory();
    this.availMemoryMB = report.getAvailableResource().getMemory();
  }
  this.id = id.toString();
  this.rack = ni.getRackName();
  this.nodeHostName = ni.getHostName();
  this.state = ni.getState();
  this.nodeHTTPAddress = ni.getHttpAddress();
  this.lastHealthUpdate = ni.getLastHealthReportTime();
  this.healthReport = String.valueOf(ni.getHealthReport());
  this.version = ni.getNodeManagerVersion();
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:21,代码来源:NodeInfo.java


示例11: FifoSchedulerInfo

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
public FifoSchedulerInfo(final ResourceManager rm) {

    RMContext rmContext = rm.getRMContext();

    FifoScheduler fs = (FifoScheduler) rm.getResourceScheduler();
    qName = fs.getQueueInfo("", false, false).getQueueName();
    QueueInfo qInfo = fs.getQueueInfo(qName, true, true);

    this.usedCapacity = qInfo.getCurrentCapacity();
    this.capacity = qInfo.getCapacity();
    this.minQueueMemoryCapacity = fs.getMinimumResourceCapability().getMemory();
    this.maxQueueMemoryCapacity = fs.getMaximumResourceCapability().getMemory();
    this.qstate = qInfo.getQueueState();

    this.numNodes = rmContext.getRMNodes().size();
    this.usedNodeCapacity = 0;
    this.availNodeCapacity = 0;
    this.totalNodeCapacity = 0;
    this.numContainers = 0;

    for (RMNode ni : rmContext.getRMNodes().values()) {
      SchedulerNodeReport report = fs.getNodeReport(ni.getNodeID());
      this.usedNodeCapacity += report.getUsedResource().getMemory();
      this.availNodeCapacity += report.getAvailableResource().getMemory();
      this.totalNodeCapacity += ni.getTotalCapability().getMemory();
      this.numContainers += fs.getNodeReport(ni.getNodeID()).getNumContainers();
    }
  }
 
开发者ID:naver,项目名称:hadoop,代码行数:29,代码来源:FifoSchedulerInfo.java


示例12: NodeInfo

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
public NodeInfo(RMNode ni, ResourceScheduler sched) {
  NodeId id = ni.getNodeID();
  SchedulerNodeReport report = sched.getNodeReport(id);
  this.numContainers = 0;
  this.usedMemoryMB = 0;
  this.availMemoryMB = 0;
  if (report != null) {
    this.numContainers = report.getNumContainers();
    this.usedMemoryMB = report.getUsedResource().getMemory();
    this.availMemoryMB = report.getAvailableResource().getMemory();
    this.usedVirtualCores = report.getUsedResource().getVirtualCores();
    this.availableVirtualCores = report.getAvailableResource().getVirtualCores();
    this.usedGpuCores = report.getUsedResource().getGpuCores();
    this.availableGpuCores = report.getAvailableResource().getGpuCores();
  }
  this.id = id.toString();
  this.rack = ni.getRackName();
  this.nodeHostName = ni.getHostName();
  this.state = ni.getState();
  this.nodeHTTPAddress = ni.getHttpAddress();
  this.lastHealthUpdate = ni.getLastHealthReportTime();
  this.healthReport = String.valueOf(ni.getHealthReport());
  this.version = ni.getNodeManagerVersion();
  
  // add labels
  Set<String> labelSet = ni.getNodeLabels();
  if (labelSet != null) {
    nodeLabels.addAll(labelSet);
    Collections.sort(nodeLabels);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:32,代码来源:NodeInfo.java


示例13: getLiveNodeManagers

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
/**
 * Implements getLiveNodeManagers()
 * 
 * @return JSON formatted string containing statuses of all node managers
 */
@Override // RMNMInfoBeans
public String getLiveNodeManagers() {
  Collection<RMNode> nodes = this.rmContext.getRMNodes().values();
  List<InfoMap> nodesInfo = new ArrayList<InfoMap>();

  for (final RMNode ni : nodes) {
      SchedulerNodeReport report = scheduler.getNodeReport(ni.getNodeID());
      InfoMap info = new InfoMap();
      info.put("HostName", ni.getHostName());
      info.put("Rack", ni.getRackName());
      info.put("State", ni.getState().toString());
      info.put("NodeId", ni.getNodeID());
      info.put("NodeHTTPAddress", ni.getHttpAddress());
      info.put("LastHealthUpdate",
                      ni.getLastHealthReportTime());
      info.put("HealthReport",
                      ni.getHealthReport());
      info.put("NodeManagerVersion",
              ni.getNodeManagerVersion());
      if(report != null) {
        info.put("NumContainers", report.getNumContainers());
        info.put("UsedMemoryMB", report.getUsedResource().getMemory());
        info.put("AvailableMemoryMB",
            report.getAvailableResource().getMemory());
      }

      nodesInfo.add(info);
  }

  return JSON.toString(nodesInfo);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:37,代码来源:RMNMInfo.java


示例14: NodeInfo

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
public NodeInfo(RMNode ni, ResourceScheduler sched) {
  NodeId id = ni.getNodeID();
  SchedulerNodeReport report = sched.getNodeReport(id);
  this.numContainers = 0;
  this.usedMemoryMB = 0;
  this.availMemoryMB = 0;
  if (report != null) {
    this.numContainers = report.getNumContainers();
    this.usedMemoryMB = report.getUsedResource().getMemory();
    this.availMemoryMB = report.getAvailableResource().getMemory();
    this.usedVirtualCores = report.getUsedResource().getVirtualCores();
    this.availableVirtualCores = report.getAvailableResource().getVirtualCores();
  }
  this.id = id.toString();
  this.rack = ni.getRackName();
  this.nodeHostName = ni.getHostName();
  this.state = ni.getState();
  this.nodeHTTPAddress = ni.getHttpAddress();
  this.lastHealthUpdate = ni.getLastHealthReportTime();
  this.healthReport = String.valueOf(ni.getHealthReport());
  this.version = ni.getNodeManagerVersion();
  
  // add labels
  Set<String> labelSet = ni.getNodeLabels();
  if (labelSet != null) {
    nodeLabels.addAll(labelSet);
    Collections.sort(nodeLabels);
  }

  // update node and containers resource utilization
  this.resourceUtilization = new ResourceUtilizationInfo(ni);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:33,代码来源:NodeInfo.java


示例15: NodeInfo

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
public NodeInfo(RMNode ni, ResourceScheduler sched) {
  NodeId id = ni.getNodeID();
  SchedulerNodeReport report = sched.getNodeReport(id);
  this.numContainers = 0;
  this.usedMemoryMB = 0;
  this.availMemoryMB = 0;
  if (report != null) {
    this.numContainers = report.getNumContainers();
    this.usedMemoryMB = report.getUsedResource().getMemory();
    this.availMemoryMB = report.getAvailableResource().getMemory();
    this.usedVirtualCores = report.getUsedResource().getVirtualCores();
    this.availableVirtualCores = report.getAvailableResource().getVirtualCores();
  }
  this.id = id.toString();
  this.rack = ni.getRackName();
  this.nodeHostName = ni.getHostName();
  this.state = ni.getState();
  this.nodeHTTPAddress = ni.getHttpAddress();
  this.lastHealthUpdate = ni.getLastHealthReportTime();
  this.healthReport = String.valueOf(ni.getHealthReport());
  this.version = ni.getNodeManagerVersion();
  
  // add labels
  Set<String> labelSet = ni.getNodeLabels();
  if (labelSet != null) {
    nodeLabels.addAll(labelSet);
    Collections.sort(nodeLabels);
  }
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:30,代码来源:NodeInfo.java


示例16: getLiveNodeManagers

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
/**
 * Implements getLiveNodeManagers()
 * 
 * @return JSON formatted string containing statuses of all node managers
 */
@Override // RMNMInfoBeans
public String getLiveNodeManagers() {
  Collection<RMNode> nodes = this.rmContext.getRMNodes().values();
  List<InfoMap> nodesInfo = new ArrayList<InfoMap>();

  for (final RMNode ni : nodes) {
      SchedulerNodeReport report = scheduler.getNodeReport(ni.getNodeID());
      InfoMap info = new InfoMap();
      info.put("HostName", ni.getHostName());
      info.put("Rack", ni.getRackName());
      info.put("State", ni.getState().toString());
      info.put("NodeId", ni.getNodeID());
      info.put("NodeHTTPAddress", ni.getHttpAddress());
      info.put("LastHealthUpdate",
                      ni.getLastHealthReportTime());
      info.put("HealthReport",
                      ni.getHealthReport());
      if(report != null) {
        info.put("NumContainers", report.getNumContainers());
        info.put("UsedMemoryMB", report.getUsedResource().getMemory());
        info.put("AvailableMemoryMB",
            report.getAvailableResource().getMemory());
      }

      nodesInfo.add(info);
  }

  return JSON.toString(nodesInfo);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:35,代码来源:RMNMInfo.java


示例17: verifyNodeInfoGeneric

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
public void verifyNodeInfoGeneric(MockNM nm, String state, String rack,
    String id, String nodeHostName,
    String nodeHTTPAddress, long lastHealthUpdate, String healthReport,
    int numContainers, long usedMemoryMB, long availMemoryMB)
    throws JSONException, Exception {

  RMNode node = rm.getRMContext().getRMNodes().get(nm.getNodeId());
  ResourceScheduler sched = rm.getResourceScheduler();
  SchedulerNodeReport report = sched.getNodeReport(nm.getNodeId());

  WebServicesTestUtils.checkStringMatch("state", node.getState().toString(),
      state);
  WebServicesTestUtils.checkStringMatch("rack", node.getRackName(), rack);
  WebServicesTestUtils.checkStringMatch("id", nm.getNodeId().toString(), id);
  WebServicesTestUtils.checkStringMatch("nodeHostName", nm.getNodeId()
      .getHost(), nodeHostName);
  WebServicesTestUtils.checkStringMatch("healthReport",
      String.valueOf(node.getHealthReport()), healthReport);
  String expectedHttpAddress = nm.getNodeId().getHost() + ":"
      + nm.getHttpPort();
  WebServicesTestUtils.checkStringMatch("nodeHTTPAddress",
      expectedHttpAddress, nodeHTTPAddress);

  long expectedHealthUpdate = node.getLastHealthReportTime();
  assertEquals("lastHealthUpdate doesn't match, got: " + lastHealthUpdate
      + " expected: " + expectedHealthUpdate, expectedHealthUpdate,
      lastHealthUpdate);

  if (report != null) {
    assertEquals("numContainers doesn't match: " + numContainers,
        report.getNumContainers(), numContainers);
    assertEquals("usedMemoryMB doesn't match: " + usedMemoryMB, report
        .getUsedResource().getMemory(), usedMemoryMB);
    assertEquals("availMemoryMB doesn't match: " + availMemoryMB, report
        .getAvailableResource().getMemory(), availMemoryMB);
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:38,代码来源:TestRMWebServicesNodes.java


示例18: FifoSchedulerInfo

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
public FifoSchedulerInfo(final ResourceManager rm) {

    RMContext rmContext = rm.getRMContext();

    FifoScheduler fs = (FifoScheduler) rm.getResourceScheduler();
    qName = fs.getQueueInfo("", false, false).getQueueName();
    QueueInfo qInfo = fs.getQueueInfo(qName, true, true);

    this.usedCapacity = qInfo.getCurrentCapacity();
    this.capacity = qInfo.getCapacity();
    this.minQueueMemoryCapacity = fs.getMinimumResourceCapability().getMemorySize();
    this.maxQueueMemoryCapacity = fs.getMaximumResourceCapability().getMemorySize();
    this.qstate = qInfo.getQueueState();

    this.numNodes = rmContext.getRMNodes().size();
    this.usedNodeCapacity = 0;
    this.availNodeCapacity = 0;
    this.totalNodeCapacity = 0;
    this.numContainers = 0;

    for (RMNode ni : rmContext.getRMNodes().values()) {
      SchedulerNodeReport report = fs.getNodeReport(ni.getNodeID());
      this.usedNodeCapacity += report.getUsedResource().getMemorySize();
      this.availNodeCapacity += report.getAvailableResource().getMemorySize();
      this.totalNodeCapacity += ni.getTotalCapability().getMemorySize();
      this.numContainers += fs.getNodeReport(ni.getNodeID()).getNumContainers();
    }
  }
 
开发者ID:hopshadoop,项目名称:hops,代码行数:29,代码来源:FifoSchedulerInfo.java


示例19: NodeInfo

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
public NodeInfo(RMNode ni, ResourceScheduler sched) {
  NodeId id = ni.getNodeID();
  SchedulerNodeReport report = sched.getNodeReport(id);
  this.numContainers = 0;
  this.usedMemoryMB = 0;
  this.availMemoryMB = 0;
  if (report != null) {
    this.numContainers = report.getNumContainers();
    this.usedMemoryMB = report.getUsedResource().getMemorySize();
    this.availMemoryMB = report.getAvailableResource().getMemorySize();
    this.usedVirtualCores = report.getUsedResource().getVirtualCores();
    this.availableVirtualCores = report.getAvailableResource().getVirtualCores();
    this.usedGPUs = report.getUsedResource().getGPUs();
    this.availableGPUs = report.getAvailableResource().getGPUs();
  }
  this.id = id.toString();
  this.rack = ni.getRackName();
  this.nodeHostName = ni.getHostName();
  this.state = ni.getState();
  this.nodeHTTPAddress = ni.getHttpAddress();
  this.lastHealthUpdate = ni.getLastHealthReportTime();
  this.healthReport = String.valueOf(ni.getHealthReport());
  this.version = ni.getNodeManagerVersion();

  // add labels
  Set<String> labelSet = ni.getNodeLabels();
  if (labelSet != null) {
    nodeLabels.addAll(labelSet);
    Collections.sort(nodeLabels);
  }

  // update node and containers resource utilization
  this.resourceUtilization = new ResourceUtilizationInfo(ni);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:35,代码来源:NodeInfo.java


示例20: getLiveNodeManagers

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNodeReport; //导入依赖的package包/类
/**
 * Implements getLiveNodeManagers()
 * 
 * @return JSON formatted string containing statuses of all node managers
 */
@Override // RMNMInfoBeans
public String getLiveNodeManagers() {
  Collection<RMNode> nodes = this.rmContext.getRMNodes().values();
  List<InfoMap> nodesInfo = new ArrayList<InfoMap>();

  for (final RMNode ni : nodes) {
      SchedulerNodeReport report = scheduler.getNodeReport(ni.getNodeID());
      InfoMap info = new InfoMap();
      info.put("HostName", ni.getHostName());
      info.put("Rack", ni.getRackName());
      info.put("State", ni.getState().toString());
      info.put("NodeId", ni.getNodeID());
      info.put("NodeHTTPAddress", ni.getHttpAddress());
      info.put("LastHealthUpdate",
                      ni.getLastHealthReportTime());
      info.put("HealthReport",
                      ni.getHealthReport());
      info.put("NodeManagerVersion",
              ni.getNodeManagerVersion());
      if(report != null) {
        info.put("NumContainers", report.getNumContainers());
        info.put("UsedMemoryMB", report.getUsedResource().getMemorySize());
        info.put("AvailableMemoryMB",
            report.getAvailableResource().getMemorySize());
      }

      nodesInfo.add(info);
  }

  return JSON.toString(nodesInfo);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:37,代码来源:RMNMInfo.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java LogHandlerContainerFinishedEvent类代码示例发布时间:2022-05-22
下一篇:
Java ServiceDefinition类代码示例发布时间: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