org.apache.hadoop.contrib.failmon
Class CPUParser

java.lang.Object
  extended by org.apache.hadoop.contrib.failmon.ShellParser
      extended by org.apache.hadoop.contrib.failmon.CPUParser
All Implemented Interfaces:
Monitored

public class CPUParser
extends ShellParser

Objects of this class parse the /proc/cpuinfo file to gather information about present processors in the system.


Constructor Summary
CPUParser()
          Constructs a CPUParser
 
Method Summary
 String getInfo()
          Return a String with information about this class
 EventRecord[] monitor()
          Invokes query() to do the parsing and handles parsing errors.
 EventRecord query(String s)
          Reads and parses /proc/cpuinfo and creates an appropriate EventRecord that holds the desirable information.
 
Methods inherited from class org.apache.hadoop.contrib.failmon.ShellParser
findAll, findPattern, monitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CPUParser

public CPUParser()
Constructs a CPUParser

Method Detail

query

public EventRecord query(String s)
                  throws Exception
Reads and parses /proc/cpuinfo and creates an appropriate EventRecord that holds the desirable information.

Specified by:
query in class ShellParser
Parameters:
s - unused parameter
Returns:
the EventRecord created
Throws:
Exception

monitor

public EventRecord[] monitor()
Invokes query() to do the parsing and handles parsing errors.

Specified by:
monitor in interface Monitored
Specified by:
monitor in class ShellParser
Returns:
an array of EventRecords that holds one element that represents the current state of /proc/cpuinfo

getInfo

public String getInfo()
Return a String with information about this class

Returns:
A String describing this class


Copyright © 2009 The Apache Software Foundation