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

📄 clusterstatus.java

📁 Hadoop是一个用于运行应用程序在大型集群的廉价硬件设备上的框架。Hadoop为应用程序透明的提供了一组稳定/可靠的接口和数据运动。在 Hadoop中实现了Google的MapReduce算法
💻 JAVA
字号:
package org.apache.hadoop.mapred;import java.io.DataInput;import java.io.DataOutput;import java.io.IOException;import org.apache.hadoop.io.Writable;import org.apache.hadoop.io.WritableFactory;import org.apache.hadoop.io.WritableFactories;/** * Summarizes the size and current state of the cluster. * @author Owen O'Malley */public class ClusterStatus implements Writable {  static {                                        // register a ctor    WritableFactories.setFactory      (ClusterStatus.class,       new WritableFactory() {         public Writable newInstance() { return new ClusterStatus(); }       });    }  private int task_trackers;  private int map_tasks;  private int reduce_tasks;  private int max_tasks;  private ClusterStatus() {}    ClusterStatus(int trackers, int maps, int reduces, int max) {    task_trackers = trackers;    map_tasks = maps;    reduce_tasks = reduces;    max_tasks = max;  }    /**   * The number of task trackers in the cluster.   */  public int getTaskTrackers() {    return task_trackers;  }    /**   * The number of currently running map tasks.   */  public int getMapTasks() {    return map_tasks;  }    /**   * The number of current running reduce tasks.   */  public int getReduceTasks() {    return reduce_tasks;  }    /**   * The maximum capacity for running tasks in the cluster.   */  public int getMaxTasks() {    return max_tasks;  }    public void write(DataOutput out) throws IOException {    out.writeInt(task_trackers);    out.writeInt(map_tasks);    out.writeInt(reduce_tasks);    out.writeInt(max_tasks);  }  public void readFields(DataInput in) throws IOException {    task_trackers = in.readInt();    map_tasks = in.readInt();    reduce_tasks = in.readInt();    max_tasks = in.readInt();  }}

⌨️ 快捷键说明

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