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


Java DFSUtil.getPercentUsed方法代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.DFSUtil.getPercentUsed方法的典型用法代码示例。如果您正苦于以下问题:Java DFSUtil.getPercentUsed方法的具体用法?Java DFSUtil.getPercentUsed怎么用?Java DFSUtil.getPercentUsed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hdfs.DFSUtil的用法示例。


在下文中一共展示了DFSUtil.getPercentUsed方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDfsUsedPercent

import org.apache.hadoop.hdfs.DFSUtil; //导入方法依赖的package包/类
/** The used space by the data node as percentage of present capacity */
public float getDfsUsedPercent() { 
  return DFSUtil.getPercentUsed(dfsUsed, capacity);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:DatanodeInfo.java

示例2: getBlockPoolUsedPercent

import org.apache.hadoop.hdfs.DFSUtil; //导入方法依赖的package包/类
/** Used space by the block pool as percentage of present capacity */
public float getBlockPoolUsedPercent() {
  return DFSUtil.getPercentUsed(blockPoolUsed, capacity);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:DatanodeInfo.java

示例3: getCacheUsedPercent

import org.apache.hadoop.hdfs.DFSUtil; //导入方法依赖的package包/类
/**
 * @return Cache used as a percentage of the datanode's total cache capacity
 */
public float getCacheUsedPercent() {
  return DFSUtil.getPercentUsed(cacheUsed, cacheCapacity);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:DatanodeInfo.java

示例4: toXML

import org.apache.hadoop.hdfs.DFSUtil; //导入方法依赖的package包/类
public void toXML(XMLOutputter doc) throws IOException {
  if (error != null) {
    // general exception, only print exception message onto web page.
    createGeneralException(doc, clusterid,
        StringUtils.stringifyException(error));
    doc.getWriter().flush();
    return;
  }
  
  int size = nnList.size();
  long total = 0L, free = 0L, nonDfsUsed = 0l;
  float dfsUsedPercent = 0.0f, dfsRemainingPercent = 0.0f;
  if (size > 0) {
    total = total_sum / size;
    free = free_sum / size;
    nonDfsUsed = nonDfsUsed_sum / size;
    dfsUsedPercent = DFSUtil.getPercentUsed(clusterDfsUsed, total);
    dfsRemainingPercent = DFSUtil.getPercentRemaining(free, total);
  }

  doc.startTag("cluster");
  doc.attribute("clusterId", clusterid);

  doc.startTag("storage");

  toXmlItemBlock(doc, "Total Files And Directories",
      Long.toString(totalFilesAndDirectories));

  toXmlItemBlock(doc, "Configured Capacity", StringUtils.byteDesc(total));

  toXmlItemBlock(doc, "DFS Used", StringUtils.byteDesc(clusterDfsUsed));

  toXmlItemBlock(doc, "Non DFS Used", StringUtils.byteDesc(nonDfsUsed));

  toXmlItemBlock(doc, "DFS Remaining", StringUtils.byteDesc(free));

  // dfsUsedPercent
  toXmlItemBlock(doc, "DFS Used%", DFSUtil.percent2String(dfsUsedPercent));

  // dfsRemainingPercent
  toXmlItemBlock(doc, "DFS Remaining%", DFSUtil.percent2String(dfsRemainingPercent));

  doc.endTag(); // storage

  doc.startTag("namenodes");
  // number of namenodes
  toXmlItemBlock(doc, "NamenodesCount", Integer.toString(size));

  for (NamenodeStatus nn : nnList) {
    doc.startTag("node");
    toXmlItemBlockWithLink(doc, nn.host, nn.httpAddress, "NameNode");
    toXmlItemBlock(doc, "Blockpool Used",
        StringUtils.byteDesc(nn.bpUsed));
    toXmlItemBlock(doc, "Blockpool Used%",
        DFSUtil.percent2String(DFSUtil.getPercentUsed(nn.bpUsed, total)));
    toXmlItemBlock(doc, "Files And Directories",
        Long.toString(nn.filesAndDirectories));
    toXmlItemBlock(doc, "Blocks", Long.toString(nn.blocksCount));
    toXmlItemBlock(doc, "Missing Blocks",
        Long.toString(nn.missingBlocksCount));
    toXmlItemBlockWithLink(doc, nn.liveDatanodeCount + " ("
        + nn.liveDecomCount + ")", new URL(nn.httpAddress,
        "/dfsnodelist.jsp?whatNodes=LIVE"),
        "Live Datanode (Decommissioned)");
    toXmlItemBlockWithLink(doc, nn.deadDatanodeCount + " ("
        + nn.deadDecomCount + ")", new URL(nn.httpAddress,
        "/dfsnodelist.jsp?whatNodes=DEAD"),
        "Dead Datanode (Decommissioned)");
    toXmlItemBlock(doc, "Software Version", nn.softwareVersion);
    doc.endTag(); // node
  }
  doc.endTag(); // namenodes

  createNamenodeExceptionMsg(doc, nnExceptions);
  doc.endTag(); // cluster
  doc.getWriter().flush();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:78,代码来源:ClusterJspHelper.java

示例5: getCapacityUsedPercent

import org.apache.hadoop.hdfs.DFSUtil; //导入方法依赖的package包/类
@Override
public synchronized float getCapacityUsedPercent() {
  return DFSUtil.getPercentUsed(stats.capacityUsed, stats.capacityTotal);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:HeartbeatManager.java

示例6: getPercentBlockPoolUsed

import org.apache.hadoop.hdfs.DFSUtil; //导入方法依赖的package包/类
@Override
public synchronized float getPercentBlockPoolUsed() {
  return DFSUtil.getPercentUsed(stats.blockPoolUsed, stats.capacityTotal);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:HeartbeatManager.java


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