org.apache.hadoop.mapred
Class TaskTrackerStatus.ResourceStatus

java.lang.Object
  extended by org.apache.hadoop.mapred.TaskTrackerStatus.ResourceStatus
All Implemented Interfaces:
org.apache.hadoop.io.Writable
Enclosing class:
TaskTrackerStatus

public static class TaskTrackerStatus.ResourceStatus
extends java.lang.Object
implements org.apache.hadoop.io.Writable

Class representing a collection of resources on this tasktracker.


Method Summary
 long getAvailableSpace()
          Will return LONG_MAX if space hasn't been measured yet.
 long getCpuFrequency()
          Get the CPU frequency of this TaskTracker Will return UNAVAILABLE if it cannot be obtained
 float getCpuUsage()
          Get the CPU usage on this TaskTracker Will return UNAVAILABLE if it cannot be obtained
 long getCumulativeCpuTime()
          Get the cumulative CPU time on this TaskTracker since it is up Will return UNAVAILABLE if it cannot be obtained
 int getNumProcessors()
          Get the number of processors on this TaskTracker Will return UNAVAILABLE if it cannot be obtained
 long getTotalPhysicalMemory()
          Get the maximum amount of physical memory on the tasktracker.
 long getTotalVirtualMemory()
          Get the maximum amount of virtual memory on the tasktracker.
 void readFields(java.io.DataInput in)
           
 void setCpuFrequency(long cpuFrequency)
          Set the CPU frequency of this TaskTracker If the input is not a valid number, it will be set to UNAVAILABLE
 void setCpuUsage(float cpuUsage)
          Set the CPU usage on this TaskTracker
 void setCumulativeCpuTime(long cumulativeCpuTime)
          Set the cumulative CPU time on this TaskTracker since it is up It can be set to UNAVAILABLE if it is currently unavailable.
 void setNumProcessors(int numProcessors)
          Set the number of processors on this TaskTracker If the input is not a valid number, it will be set to UNAVAILABLE
 void write(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTotalVirtualMemory

public long getTotalVirtualMemory()
Get the maximum amount of virtual memory on the tasktracker. If this is JobConf.DISABLED_MEMORY_LIMIT, it should be ignored and not used in any computation.

Returns:
the maximum amount of virtual memory on the tasktracker in bytes.

getTotalPhysicalMemory

public long getTotalPhysicalMemory()
Get the maximum amount of physical memory on the tasktracker. If this is JobConf.DISABLED_MEMORY_LIMIT, it should be ignored and not used in any computation.

Returns:
maximum amount of physical memory on the tasktracker in bytes.

getAvailableSpace

public long getAvailableSpace()
Will return LONG_MAX if space hasn't been measured yet.

Returns:
bytes of available local disk space on this tasktracker.

setCpuFrequency

public void setCpuFrequency(long cpuFrequency)
Set the CPU frequency of this TaskTracker If the input is not a valid number, it will be set to UNAVAILABLE

Parameters:
cpuFrequency - CPU frequency in kHz

getCpuFrequency

public long getCpuFrequency()
Get the CPU frequency of this TaskTracker Will return UNAVAILABLE if it cannot be obtained

Returns:
CPU frequency in kHz

setNumProcessors

public void setNumProcessors(int numProcessors)
Set the number of processors on this TaskTracker If the input is not a valid number, it will be set to UNAVAILABLE

Parameters:
numProcessors - number of processors

getNumProcessors

public int getNumProcessors()
Get the number of processors on this TaskTracker Will return UNAVAILABLE if it cannot be obtained

Returns:
number of processors

setCumulativeCpuTime

public void setCumulativeCpuTime(long cumulativeCpuTime)
Set the cumulative CPU time on this TaskTracker since it is up It can be set to UNAVAILABLE if it is currently unavailable.

Parameters:
cumulativeCpuTime - Used CPU time in millisecond

getCumulativeCpuTime

public long getCumulativeCpuTime()
Get the cumulative CPU time on this TaskTracker since it is up Will return UNAVAILABLE if it cannot be obtained

Returns:
used CPU time in milliseconds

setCpuUsage

public void setCpuUsage(float cpuUsage)
Set the CPU usage on this TaskTracker

Parameters:
cpuUsage - CPU usage in %

getCpuUsage

public float getCpuUsage()
Get the CPU usage on this TaskTracker Will return UNAVAILABLE if it cannot be obtained

Returns:
CPU usage in %

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException


Copyright © 2009 The Apache Software Foundation