|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.contrib.failmon.ShellParser
public abstract class ShellParser
Objects of this class parse the output of system command-line utilities that can give information about the state of various hardware components in the system. Typically, each such object either invokes a command and reads its output or reads the output of one such command from a file on the disk. Currently supported utilities include ifconfig, smartmontools, lm-sensors, /proc/cpuinfo.
Constructor Summary | |
---|---|
ShellParser()
|
Method Summary | |
---|---|
protected String |
findAll(String strPattern,
String text,
int grp,
String separator)
Finds all occurences of a pattern in a piece of text and returns the matching groups. |
protected String |
findPattern(String strPattern,
String text,
int grp)
Find the first occurence ofa pattern in a piece of text and return a specific group. |
abstract EventRecord[] |
monitor()
Get an array of all EventRecords that can be extracted for the represented hardware component. |
void |
monitor(LocalStore ls)
Insert all EventRecords that can be extracted for the represented hardware component into a LocalStore. |
abstract EventRecord |
query(String s)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.hadoop.contrib.failmon.Monitored |
---|
getInfo |
Constructor Detail |
---|
public ShellParser()
Method Detail |
---|
protected String findPattern(String strPattern, String text, int grp)
strPattern
- the regular expression to matchtext
- the text to searchgrp
- the number of the matching group to return
protected String findAll(String strPattern, String text, int grp, String separator)
strPattern
- the regular expression to matchtext
- the text to searchgrp
- the number of the matching group to returnseparator
- the string that separates occurences in the returned value
public void monitor(LocalStore ls)
monitor
in interface Monitored
ls
- the LocalStore into which the EventRecords
are to be stored.public abstract EventRecord[] monitor()
Monitored
monitor
in interface Monitored
public abstract EventRecord query(String s) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |