}
@Override
public List<Task> assignTasks(TaskTracker taskTracker)
throws IOException {
TaskTrackerStatus status = taskTracker.getStatus();
long totalVirtualMemoryOnTT =
getConf().getLong("totalVmemOnTT", -1);
long totalPhysicalMemoryOnTT =
getConf().getLong("totalPmemOnTT", -1);
long mapSlotMemorySize =
getConf().getLong("mapSlotMemorySize", -1);
long reduceSlotMemorySize =
getConf()
.getLong("reduceSlotMemorySize", -1);
long availableVirtualMemoryOnTT =
getConf().getLong("availableVmemOnTT", -1);
long availablePhysicalMemoryOnTT =
getConf().getLong("availablePmemOnTT", -1);
long cumulativeCpuTime =
getConf().getLong("cumulativeCpuTime", -1);
long cpuFrequency =
getConf().getLong("cpuFrequency", -1);
int numProcessors =
getConf().getInt("numProcessors", -1);
float cpuUsage =
getConf().getFloat("cpuUsage", -1);
long reportedTotalVirtualMemoryOnTT =
status.getResourceStatus().getTotalVirtualMemory();
long reportedTotalPhysicalMemoryOnTT =
status.getResourceStatus().getTotalPhysicalMemory();
long reportedMapSlotMemorySize =
status.getResourceStatus().getMapSlotMemorySizeOnTT();
long reportedReduceSlotMemorySize =
status.getResourceStatus().getReduceSlotMemorySizeOnTT();
long reportedAvailableVirtualMemoryOnTT =
status.getResourceStatus().getAvailableVirtualMemory();
long reportedAvailablePhysicalMemoryOnTT =
status.getResourceStatus().getAvailablePhysicalMemory();
long reportedCumulativeCpuTime =
status.getResourceStatus().getCumulativeCpuTime();
long reportedCpuFrequency = status.getResourceStatus().getCpuFrequency();
int reportedNumProcessors = status.getResourceStatus().getNumProcessors();
float reportedCpuUsage = status.getResourceStatus().getCpuUsage();
message =
"expected memory values : "
+ "(totalVirtualMemoryOnTT, totalPhysicalMemoryOnTT, "
+ "availableVirtualMemoryOnTT, availablePhysicalMemoryOnTT, "
+ "mapSlotMemSize, reduceSlotMemorySize, cumulativeCpuTime, "
+ "cpuFrequency, numProcessors, cpuUsage) = ("
+ totalVirtualMemoryOnTT + ", "
+ totalPhysicalMemoryOnTT + ","
+ availableVirtualMemoryOnTT + ", "
+ availablePhysicalMemoryOnTT + ","
+ mapSlotMemorySize + ","
+ reduceSlotMemorySize + ","
+ cumulativeCpuTime + ","
+ cpuFrequency + ","
+ numProcessors + ","
+ cpuUsage
+")";
message +=
"\nreported memory values : "
+ "(totalVirtualMemoryOnTT, totalPhysicalMemoryOnTT, "
+ "availableVirtualMemoryOnTT, availablePhysicalMemoryOnTT, "
+ "reportedMapSlotMemorySize, reportedReduceSlotMemorySize, "
+ "reportedCumulativeCpuTime, reportedCpuFrequency, "
+ "reportedNumProcessors, cpuUsage) = ("
+ reportedTotalVirtualMemoryOnTT + ", "
+ reportedTotalPhysicalMemoryOnTT + ","
+ reportedAvailableVirtualMemoryOnTT + ", "
+ reportedAvailablePhysicalMemoryOnTT + ","
+ reportedMapSlotMemorySize + ","
+ reportedReduceSlotMemorySize + ","
+ reportedCumulativeCpuTime + ","
+ reportedCpuFrequency + ","
+ reportedNumProcessors + ","
+ reportedCpuUsage
+ ")";
LOG.info(message);
hasDynamicValuePassed = true;
// Check task resource status in task reports
for (TaskStatus taskStatus : status.getTaskReports()) {
Counters counters = taskStatus.getCounters();
// This should be zero because the initial CPU time is subtracted.
long procCumulativeCpuTime = 0;
long procVirtualMemorySize =
getConf().getLong("procVirtualMemorySize", -1);