Index: src/mapred/org/apache/hadoop/mapred/ClusterStatus.java===================================================================--- src/mapred/org/apache/hadoop/mapred/ClusterStatus.java (revision 106658)+++ src/mapred/org/apache/hadoop/mapred/ClusterStatus.java (working copy)@@ -21,9 +21,12 @@import java.io.DataInput;import java.io.DataOutput;import java.io.IOException;+import java.io.InputStream;import org.apache.hadoop.io.Writable;-import org.apache.hadoop.io.WritableUtils;+import org.apache.hadoop.io.DataOutputOutputStream;+import org.apache.hadoop.mapred.ClusterStatusProtos;+import org.apache.hadoop.mapred.ClusterStatusProtos.ClusterStatus.JTState;/*** Status information on the current state of the Map-Reduce cluster.@@ -50,14 +53,10 @@* @see JobClient*/public class ClusterStatus implements Writable {+ + ClusterStatusProtos.ClusterStatus.Builder status = + ClusterStatusProtos.ClusterStatus.newBuilder();- private int task_trackers;- private int map_tasks;- private int reduce_tasks;- private int max_map_tasks;- private int max_reduce_tasks;- private JobTracker.State state;- ClusterStatus() {}/**@@ -70,13 +69,13 @@* @param state the {@link JobTracker.State} of the <code>JobTracker</code>*/ClusterStatus(int trackers, int maps, int reduces, int maxMaps,- int maxReduces, JobTracker.State state) {- task_trackers = trackers;- map_tasks = maps;- reduce_tasks = reduces;- max_map_tasks = maxMaps;- max_reduce_tasks = maxReduces;- this.state = state;+ int maxReduces, JTState state) {+ status.setTaskTrackers(trackers)+ .setMapTasks(maps)+ .setReduceTasks(reduces)+ .setMaxMapTasks(maxMaps)+ .setMaxReduceTasks(maxReduces)+ .setState(state);}@@ -86,7 +85,7 @@* @return the number of task trackers in the cluster.*/public int getTaskTrackers() {- return task_trackers;+ return status.getTaskTrackers();}/**@@ -95,7 +94,7 @@* @return the number of currently running map tasks in the cluster.*/public int getMapTasks() {- return map_tasks;+ return status.getMapTasks();}/**@@ -104,7 +103,7 @@* @return the number of currently running reduce tasks in the cluster.*/public int getReduceTasks() {- return reduce_tasks;+ return status.getReduceTasks();}/**@@ -113,7 +112,7 @@* @return the maximum capacity for running map tasks in the cluster.*/public int getMaxMapTasks() {- return max_map_tasks;+ return status.getMaxMapTasks();}/**@@ -122,7 +121,7 @@* @return the maximum capacity for running reduce tasks in the cluster.*/public int getMaxReduceTasks() {- return max_reduce_tasks;+ return status.getMaxReduceTasks();}/**@@ -131,26 +130,17 @@** @return the current state of the <code>JobTracker</code>.*/- public JobTracker.State getJobTrackerState() {- return state;+ public JTState getJobTrackerState() {+ return status.getState();}public void write(DataOutput out) throws IOException {- out.writeInt(task_trackers);- out.writeInt(map_tasks);- out.writeInt(reduce_tasks);- out.writeInt(max_map_tasks);- out.writeInt(max_reduce_tasks);- WritableUtils.writeEnum(out, state);+ status.build().writeDelimitedTo(+ DataOutputOutputStream.constructOutputStream(out));}public void readFields(DataInput in) throws IOException {- task_trackers = in.readInt();- map_tasks = in.readInt();- reduce_tasks = in.readInt();- max_map_tasks = in.readInt();- max_reduce_tasks = in.readInt();- state = WritableUtils.readEnum(in, JobTracker.State.class);+ status = ClusterStatusProtos.ClusterStatus.parseDelimitedFrom((InputStream)in).toBuilder();}}