当前位置: 首页>>代码示例>>Java>>正文


Java ResourceInfo类代码示例

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


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

示例1: createNewApplication

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
/**
 * Function that actually creates the ApplicationId by calling the
 * ClientRMService
 * 
 * @return returns structure containing the app-id and maximum resource
 *         capabilities
 */
private NewApplication createNewApplication() {
  GetNewApplicationRequest req =
      recordFactory.newRecordInstance(GetNewApplicationRequest.class);
  GetNewApplicationResponse resp;
  try {
    resp = rm.getClientRMService().getNewApplication(req);
  } catch (YarnException e) {
    String msg = "Unable to create new app from RM web service";
    LOG.error(msg, e);
    throw new YarnRuntimeException(msg, e);
  }
  NewApplication appId =
      new NewApplication(resp.getApplicationId().toString(),
        new ResourceInfo(resp.getMaximumResourceCapability()));
  return appId;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:RMWebServices.java

示例2: getPercentage

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
private String getPercentage(ResourceInfo numerator, ResourceInfo denominator) {
  StringBuilder percentString = new StringBuilder("Memory: ");
  if (numerator != null) {
    percentString.append(numerator.getMemory());
  }
  if (denominator.getMemory() != 0) {
    percentString.append(" (<span title='of used resources in this queue'>")
      .append(StringUtils.format("%.2f", numerator.getMemory() * 100.0 /
        denominator.getMemory()) + "%</span>)");
  }
  percentString.append(", vCores: ");
  if (numerator != null) {
    percentString.append(numerator.getvCores());
  }
  if (denominator.getvCores() != 0) {
    percentString.append(" (<span title='of used resources in this queue'>")
      .append(StringUtils.format("%.2f", numerator.getvCores() * 100.0 /
      denominator.getvCores()) + "%</span>)");
  }
  return percentString.toString();
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:22,代码来源:CapacitySchedulerPage.java

示例3: UserInfo

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
UserInfo(String username, Resource resUsed, int activeApps, int pendingApps,
    Resource amResUsed, Resource resourceLimit) {
  this.username = username;
  this.resourcesUsed = new ResourceInfo(resUsed);
  this.numActiveApplications = activeApps;
  this.numPendingApplications = pendingApps;
  this.AMResourceUsed = new ResourceInfo(amResUsed);
  this.userResourceLimit = new ResourceInfo(resourceLimit);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:UserInfo.java

示例4: render

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
@Override
protected void render(Block html) {
  TBODY<TABLE<Hamlet>> tbody =
      html.table("#userinfo").thead().$class("ui-widget-header").tr().th()
          .$class("ui-state-default")._("User Name")._().th()
          .$class("ui-state-default")._("Max Resource")._().th()
          .$class("ui-state-default")._("Used Resource")._().th()
          .$class("ui-state-default")._("Max AM Resource")._().th()
          .$class("ui-state-default")._("Used AM Resource")._().th()
          .$class("ui-state-default")._("Schedulable Apps")._().th()
          .$class("ui-state-default")._("Non-Schedulable Apps")._()._()._()
          .tbody();

  ArrayList<UserInfo> users = lqinfo.getUsers().getUsersList();
  for (UserInfo userInfo : users) {
    ResourceInfo resourcesUsed = userInfo.getResourcesUsed();
    if (nodeLabel != null) {
      resourcesUsed = userInfo.getResourceUsageInfo()
          .getPartitionResourceUsageInfo(nodeLabel).getUsed();
    }
    tbody.tr().td(userInfo.getUsername())
        .td(userInfo.getUserResourceLimit().toString())
        .td(resourcesUsed.toString())
        .td(lqinfo.getUserAMResourceLimit().toString())
        .td(userInfo.getAMResourcesUsed().toString())
        .td(Integer.toString(userInfo.getNumActiveApplications()))
        .td(Integer.toString(userInfo.getNumPendingApplications()))._();
  }

  html.div().$class("usersinfo").h5("Active Users Info")._();
  tbody._()._();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:33,代码来源:CapacitySchedulerPage.java

示例5: UserInfo

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
UserInfo(String username, Resource resUsed, int activeApps, int pendingApps,
    Resource amResUsed, Resource resourceLimit, ResourceUsage resourceUsage) {
  this.username = username;
  this.resourcesUsed = new ResourceInfo(resUsed);
  this.numActiveApplications = activeApps;
  this.numPendingApplications = pendingApps;
  this.AMResourceUsed = new ResourceInfo(amResUsed);
  this.userResourceLimit = new ResourceInfo(resourceLimit);
  this.resources = new ResourceUsageInfo(resourceUsage);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:11,代码来源:UserInfo.java

示例6: render

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
@Override
protected void render(Block html) {
  StringBuilder activeUserList = new StringBuilder("");
  ResourceInfo usedResources = lqinfo.getResourcesUsed();
  ArrayList<UserInfo> users = lqinfo.getUsers().getUsersList();
  for (UserInfo entry: users) {
    activeUserList.append(entry.getUsername()).append(" &lt;")
      .append(getPercentage(entry.getResourcesUsed(), usedResources))
      .append(", Schedulable Apps: " + entry.getNumActiveApplications())
      .append(", Non-Schedulable Apps: " + entry.getNumPendingApplications())
      .append("&gt;<br style='display:block'>"); //Force line break
  }

  ResponseInfo ri = info("\'" + lqinfo.getQueuePath().substring(5) + "\' Queue Status").
      _("Queue State:", lqinfo.getQueueState()).
      _("Used Capacity:", percent(lqinfo.getUsedCapacity() / 100)).
      _("Absolute Used Capacity:", percent(lqinfo.getAbsoluteUsedCapacity() / 100)).
      _("Absolute Capacity:", percent(lqinfo.getAbsoluteCapacity() / 100)).
      _("Absolute Max Capacity:", percent(lqinfo.getAbsoluteMaxCapacity() / 100)).
      _("Used Resources:", lqinfo.getResourcesUsed().toString()).
      _("Num Schedulable Applications:", Integer.toString(lqinfo.getNumActiveApplications())).
      _("Num Non-Schedulable Applications:", Integer.toString(lqinfo.getNumPendingApplications())).
      _("Num Containers:", Integer.toString(lqinfo.getNumContainers())).
      _("Max Applications:", Integer.toString(lqinfo.getMaxApplications())).
      _("Max Applications Per User:", Integer.toString(lqinfo.getMaxApplicationsPerUser())).
      _("Max Schedulable Applications:", Integer.toString(lqinfo.getMaxActiveApplications())).
      _("Max Schedulable Applications Per User:", Integer.toString(lqinfo.getMaxActiveApplicationsPerUser())).
      _("Configured Capacity:", percent(lqinfo.getCapacity() / 100)).
      _("Configured Max Capacity:", percent(lqinfo.getMaxCapacity() / 100)).
      _("Configured Minimum User Limit Percent:", Integer.toString(lqinfo.getUserLimit()) + "%").
      _("Configured User Limit Factor:", String.format("%.1f", lqinfo.getUserLimitFactor())).
      _("Active Users: ", activeUserList.toString()).
      _r("Accessible Node Labels:", StringUtils.join(",", lqinfo.getNodeLabels()));

  html._(InfoBlock.class);

  // clear the info contents so this queue's info doesn't accumulate into another queue's info
  ri.clear();
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:40,代码来源:CapacitySchedulerPage.java

示例7: render

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
@Override
protected void render(Block html) {
  StringBuilder activeUserList = new StringBuilder("");
  ResourceInfo usedResources = lqinfo.getResourcesUsed();
  ArrayList<UserInfo> users = lqinfo.getUsers().getUsersList();
  for (UserInfo entry: users) {
    activeUserList.append(entry.getUsername()).append(" &lt;")
      .append(getPercentage(entry.getResourcesUsed(), usedResources))
      .append(", Active Apps: " + entry.getNumActiveApplications())
      .append(", Pending Apps: " + entry.getNumPendingApplications())
      .append("&gt;<br style='display:block'>"); //Force line break
  }

  ResponseInfo ri = info("\'" + lqinfo.getQueuePath().substring(5) + "\' Queue Status").
      _("Queue State:", lqinfo.getQueueState()).
      _("Used Capacity:", percent(lqinfo.getUsedCapacity() / 100)).
      _("Absolute Capacity:", percent(lqinfo.getAbsoluteCapacity() / 100)).
      _("Absolute Max Capacity:", percent(lqinfo.getAbsoluteMaxCapacity() / 100)).
      _("Used Resources:", StringEscapeUtils.escapeHtml(lqinfo.getUsedResources().toString())).
      _("Num Active Applications:", Integer.toString(lqinfo.getNumActiveApplications())).
      _("Num Pending Applications:", Integer.toString(lqinfo.getNumPendingApplications())).
      _("Num Containers:", Integer.toString(lqinfo.getNumContainers())).
      _("Max Applications:", Integer.toString(lqinfo.getMaxApplications())).
      _("Max Applications Per User:", Integer.toString(lqinfo.getMaxApplicationsPerUser())).
      _("Max Active Applications:", Integer.toString(lqinfo.getMaxActiveApplications())).
      _("Max Active Applications Per User:", Integer.toString(lqinfo.getMaxActiveApplicationsPerUser())).
      _("Configured Capacity:", percent(lqinfo.getCapacity() / 100)).
      _("Configured Max Capacity:", percent(lqinfo.getMaxCapacity() / 100)).
      _("Configured Minimum User Limit Percent:", Integer.toString(lqinfo.getUserLimit()) + "%").
      _("Configured User Limit Factor:", String.format("%.1f", lqinfo.getUserLimitFactor())).
      _r("Active users: ", activeUserList.toString());

  html._(InfoBlock.class);

  // clear the info contents so this queue's info doesn't accumulate into another queue's info
  ri.clear();
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:38,代码来源:CapacitySchedulerPage.java

示例8: renderQueueCapacityInfo

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
private void renderQueueCapacityInfo(ResponseInfo ri, String label) {
  PartitionQueueCapacitiesInfo capacities =
      lqinfo.getCapacities().getPartitionQueueCapacitiesInfo(label);
  PartitionResourcesInfo resourceUsages =
      lqinfo.getResources().getPartitionResourceUsageInfo(label);

  // Get UserInfo from first user to calculate AM Resource Limit per user.
  ResourceInfo userAMResourceLimit = null;
  ArrayList<UserInfo> usersList = lqinfo.getUsers().getUsersList();
  if (usersList.isEmpty()) {
    // If no users are present, consider AM Limit for that queue.
    userAMResourceLimit = resourceUsages.getAMLimit();
  } else {
    userAMResourceLimit = usersList.get(0)
        .getResourceUsageInfo().getPartitionResourceUsageInfo(label)
        .getAMLimit();
  }
  ResourceInfo amUsed = (resourceUsages.getAmUsed() == null)
      ? new ResourceInfo(Resources.none())
      : resourceUsages.getAmUsed();
  ri.
  _("Used Capacity:", percent(capacities.getUsedCapacity() / 100)).
  _("Configured Capacity:", percent(capacities.getCapacity() / 100)).
  _("Configured Max Capacity:", percent(capacities.getMaxCapacity() / 100)).
  _("Absolute Used Capacity:", percent(capacities.getAbsoluteUsedCapacity() / 100)).
  _("Absolute Configured Capacity:", percent(capacities.getAbsoluteCapacity() / 100)).
  _("Absolute Configured Max Capacity:", percent(capacities.getAbsoluteMaxCapacity() / 100)).
  _("Used Resources:", resourceUsages.getUsed().toString()).
  _("Configured Max Application Master Limit:", StringUtils.format("%.1f",
      capacities.getMaxAMLimitPercentage())).
  _("Max Application Master Resources:",
      resourceUsages.getAMLimit().toString()).
  _("Used Application Master Resources:",
      amUsed.toString()).
  _("Max Application Master Resources Per User:",
      userAMResourceLimit.toString());
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:38,代码来源:CapacitySchedulerPage.java

示例9: render

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
@Override
protected void render(Block html) {
  TBODY<TABLE<Hamlet>> tbody =
      html.table("#userinfo").thead().$class("ui-widget-header").tr().th()
          .$class("ui-state-default")._("User Name")._().th()
          .$class("ui-state-default")._("Max Resource")._().th()
          .$class("ui-state-default")._("Used Resource")._().th()
          .$class("ui-state-default")._("Max AM Resource")._().th()
          .$class("ui-state-default")._("Used AM Resource")._().th()
          .$class("ui-state-default")._("Schedulable Apps")._().th()
          .$class("ui-state-default")._("Non-Schedulable Apps")._()._()._()
          .tbody();

  ArrayList<UserInfo> users = lqinfo.getUsers().getUsersList();
  for (UserInfo userInfo : users) {
    ResourceInfo resourcesUsed = userInfo.getResourcesUsed();
    PartitionResourcesInfo resourceUsages = lqinfo
        .getResources()
        .getPartitionResourceUsageInfo((nodeLabel == null) ? "" : nodeLabel);
    if (nodeLabel != null) {
      resourcesUsed = userInfo.getResourceUsageInfo()
          .getPartitionResourceUsageInfo(nodeLabel).getUsed();
    }
    ResourceInfo amUsed = (resourceUsages.getAmUsed() == null)
        ? new ResourceInfo(Resources.none())
        : resourceUsages.getAmUsed();
    tbody.tr().td(userInfo.getUsername())
        .td(userInfo.getUserResourceLimit().toString())
        .td(resourcesUsed.toString())
        .td(resourceUsages.getAMLimit().toString())
        .td(amUsed.toString())
        .td(Integer.toString(userInfo.getNumActiveApplications()))
        .td(Integer.toString(userInfo.getNumPendingApplications()))._();
  }

  html.div().$class("usersinfo").h5("Active Users Info")._();
  tbody._()._();
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:39,代码来源:CapacitySchedulerPage.java

示例10: UserInfo

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
UserInfo(String username, Resource resUsed, int activeApps, int pendingApps,
    Resource amResUsed, Resource resourceLimit, ResourceUsage resourceUsage) {
  this.username = username;
  this.resourcesUsed = new ResourceInfo(resUsed);
  this.numActiveApplications = activeApps;
  this.numPendingApplications = pendingApps;
  this.AMResourceUsed = new ResourceInfo(amResUsed);
  this.userResourceLimit = new ResourceInfo(resourceLimit);
  this.resources = new ResourcesInfo(resourceUsage);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:11,代码来源:UserInfo.java

示例11: render

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
@Override
protected void render(Block html) {
  StringBuilder activeUserList = new StringBuilder("");
  ResourceInfo usedResources = lqinfo.getResourcesUsed();
  ArrayList<UserInfo> users = lqinfo.getUsers().getUsersList();
  for (UserInfo entry: users) {
    activeUserList.append(entry.getUsername()).append(" &lt;")
      .append(getPercentage(entry.getResourcesUsed(), usedResources))
      .append(", Schedulable Apps: " + entry.getNumActiveApplications())
      .append(", Non-Schedulable Apps: " + entry.getNumPendingApplications())
      .append("&gt;<br style='display:block'>"); //Force line break
  }

  ResponseInfo ri = info("\'" + lqinfo.getQueuePath().substring(5) + "\' Queue Status").
      _("Queue State:", lqinfo.getQueueState()).
      _("Used Capacity:", percent(lqinfo.getUsedCapacity() / 100)).
      _("Absolute Used Capacity:", percent(lqinfo.getAbsoluteUsedCapacity() / 100)).
      _("Absolute Capacity:", percent(lqinfo.getAbsoluteCapacity() / 100)).
      _("Absolute Max Capacity:", percent(lqinfo.getAbsoluteMaxCapacity() / 100)).
      _("Used Resources:", StringEscapeUtils.escapeHtml(lqinfo.getUsedResources().toString())).
      _("Num Schedulable Applications:", Integer.toString(lqinfo.getNumActiveApplications())).
      _("Num Non-Schedulable Applications:", Integer.toString(lqinfo.getNumPendingApplications())).
      _("Num Containers:", Integer.toString(lqinfo.getNumContainers())).
      _("Max Applications:", Integer.toString(lqinfo.getMaxApplications())).
      _("Max Applications Per User:", Integer.toString(lqinfo.getMaxApplicationsPerUser())).
      _("Max Schedulable Applications:", Integer.toString(lqinfo.getMaxActiveApplications())).
      _("Max Schedulable Applications Per User:", Integer.toString(lqinfo.getMaxActiveApplicationsPerUser())).
      _("Configured Capacity:", percent(lqinfo.getCapacity() / 100)).
      _("Configured Max Capacity:", percent(lqinfo.getMaxCapacity() / 100)).
      _("Configured Minimum User Limit Percent:", Integer.toString(lqinfo.getUserLimit()) + "%").
      _("Configured User Limit Factor:", String.format("%.1f", lqinfo.getUserLimitFactor())).
      _r("Active users: ", activeUserList.toString());

  html._(InfoBlock.class);

  // clear the info contents so this queue's info doesn't accumulate into another queue's info
  ri.clear();
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:39,代码来源:CapacitySchedulerPage.java

示例12: render

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
@Override
protected void render(Block html) {
  StringBuilder activeUserList = new StringBuilder("");
  ResourceInfo usedResources = lqinfo.getResourcesUsed();
  ArrayList<UserInfo> users = lqinfo.getUsers().getUsersList();
  for (UserInfo entry: users) {
    activeUserList.append(entry.getUsername()).append(" &lt;")
      .append(getPercentage(entry.getResourcesUsed(), usedResources))
      .append(", Schedulable Apps: " + entry.getNumActiveApplications())
      .append(", Non-Schedulable Apps: " + entry.getNumPendingApplications())
      .append("&gt;<br style='display:block'>"); //Force line break
  }

  ResponseInfo ri = info("\'" + lqinfo.getQueuePath().substring(5) + "\' Queue Status").
      _("Queue State:", lqinfo.getQueueState()).
      _("Used Capacity:", percent(lqinfo.getUsedCapacity() / 100)).
      _("Absolute Used Capacity:", percent(lqinfo.getAbsoluteUsedCapacity() / 100)).
      _("Absolute Capacity:", percent(lqinfo.getAbsoluteCapacity() / 100)).
      _("Absolute Max Capacity:", percent(lqinfo.getAbsoluteMaxCapacity() / 100)).
      _("Used Resources:", StringEscapeUtils.escapeHtml(lqinfo.getResourcesUsed().toString())).
      _("Num Schedulable Applications:", Integer.toString(lqinfo.getNumActiveApplications())).
      _("Num Non-Schedulable Applications:", Integer.toString(lqinfo.getNumPendingApplications())).
      _("Num Containers:", Integer.toString(lqinfo.getNumContainers())).
      _("Max Applications:", Integer.toString(lqinfo.getMaxApplications())).
      _("Max Applications Per User:", Integer.toString(lqinfo.getMaxApplicationsPerUser())).
      _("Max Schedulable Applications:", Integer.toString(lqinfo.getMaxActiveApplications())).
      _("Max Schedulable Applications Per User:", Integer.toString(lqinfo.getMaxActiveApplicationsPerUser())).
      _("Configured Capacity:", percent(lqinfo.getCapacity() / 100)).
      _("Configured Max Capacity:", percent(lqinfo.getMaxCapacity() / 100)).
      _("Configured Minimum User Limit Percent:", Integer.toString(lqinfo.getUserLimit()) + "%").
      _("Configured User Limit Factor:", String.format("%.1f", lqinfo.getUserLimitFactor())).
      _r("Active users: ", activeUserList.toString());

  html._(InfoBlock.class);

  // clear the info contents so this queue's info doesn't accumulate into another queue's info
  ri.clear();
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:39,代码来源:CapacitySchedulerPage.java

示例13: getResourcesUsed

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
public ResourceInfo getResourcesUsed() {
  return resourcesUsed;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:UserInfo.java

示例14: getAMResourcesUsed

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
public ResourceInfo getAMResourcesUsed() {
  return AMResourceUsed;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:UserInfo.java

示例15: getUserResourceLimit

import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo; //导入依赖的package包/类
public ResourceInfo getUserResourceLimit() {
  return userResourceLimit;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:UserInfo.java


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