ShellParser (Hadoop 1.2.1 API)
Date: 2013-07-22

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.hadoop.contrib.failmon
Class ShellParser

    java.lang.Object
      org.apache.hadoop.contrib.failmon.ShellParser

All Implemented Interfaces:
  Monitored

Direct Known Subclasses:
  CPUParser, NICParser, SensorsParser, SMARTParser

    public abstract class ShellParser

extends Object
implements Monitored

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

### ShellParser

    public ShellParser()

Method Detail

### findPattern

    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.

  Parameters:
    `strPattern` - the regular expression to match
    `text` - the text to search
    `grp` - the number of the matching group to return
  Returns:
    a String containing the matched group of the regular expression

### findAll

    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.

  Parameters:
    `strPattern` - the regular expression to match
    `text` - the text to search
    `grp` - the number of the matching group to return
    `separator` - the string that separates occurences in the returned value
  Returns:
    a String that contains all occurences of strPattern in text, separated by separator

### monitor

    public void monitor(LocalStore ls)

  Insert all EventRecords that can be extracted for the represented hardware component into a LocalStore.

  Specified by:
    `monitor` in interface `Monitored`
  Parameters:
    `ls` - the LocalStore into which the EventRecords are to be stored.

### monitor

    public abstract EventRecord[] monitor()

  Description copied from interface: `Monitored`
  Get an array of all EventRecords that can be extracted for the represented hardware component.

  Specified by:
    `monitor` in interface `Monitored`
  Returns:
    The array of EventRecords

### query

    public abstract EventRecord query(String s)
                               throws Exception

  Throws:
    `Exception`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation