⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datanodereport.java

📁 Hadoop是一个用于运行应用程序在大型集群的廉价硬件设备上的框架。Hadoop为应用程序透明的提供了一组稳定/可靠的接口和数据运动。在 Hadoop中实现了Google的MapReduce算法
💻 JAVA
字号:
package org.apache.hadoop.dfs;import java.util.Date;import org.apache.hadoop.io.UTF8;/** A report on the status of a DataNode. * * @see DistributedFileSystem#getDataNodeStats */public class DataNodeReport {  String name;  String host;  long capacity;  long remaining;  long lastUpdate;    /** The name of the datanode. */  public String getName() { return name; }  /** The hostname of the datanode. */  public String getHost() { return host; }  /** The raw capacity. */  public long getCapacity() { return capacity; }  /** The raw free space. */  public long getRemaining() { return remaining; }  /** The time when this information was accurate. */  public long getLastUpdate() { return lastUpdate; }  public String toString() {    StringBuffer buffer = new StringBuffer();    long c = getCapacity();    long r = getRemaining();    long u = c - r;    buffer.append("Name: "+name+"\n");    buffer.append("Total raw bytes: "+c+" ("+DFSShell.byteDesc(c)+")"+"\n");    buffer.append("Used raw bytes: "+u+" ("+DFSShell.byteDesc(u)+")"+"\n");    buffer.append("% used: "+DFSShell.limitDecimal(((1.0*u)/c)*100,2)+"%"+"\n");    buffer.append("Last contact: "+new Date(lastUpdate)+"\n");    return buffer.toString();  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -