return tcs;
}
public static ThriftTaskTrackerStatus toThrift(TaskTrackerStatus t) {
ThriftTaskTrackerStatus ttts = new ThriftTaskTrackerStatus();
ttts.setTrackerName(t.getTrackerName());
ttts.setAvailableSpace(t.getResourceStatus().getAvailableSpace());
ttts.setFailureCount(t.getFailures());
ttts.setHost(t.getHost());
ttts.setHttpPort(t.getHttpPort());
ttts.setLastSeen(t.getLastSeen());
ttts.setMapCount(t.countMapTasks());
ttts.setReduceCount(t.countReduceTasks());
ttts.setMaxMapTasks(t.getMaxMapSlots());
ttts.setMaxReduceTasks(t.getMaxReduceSlots());
ttts.setTotalPhysicalMemory(t.getResourceStatus().getTotalPhysicalMemory());
ttts.setTotalVirtualMemory(t.getResourceStatus().getTotalVirtualMemory());
Collection<TaskStatus> tasks = null;
synchronized(t) {
tasks = new ArrayList<TaskStatus>(t.getTaskReports());
}
for (TaskStatus tr : tasks) {
ttts.addToTaskReports(toThrift(tr));
}
return ttts;
}