|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.counters.query.QueryUtil
public class QueryUtil
Some static utility methods.
| Nested Class Summary | |
|---|---|
static class |
QueryUtil.ReadCounterSetXMLFileTask
Task reads counters matching a regular expression into the caller's CounterSet. |
| Field Summary | |
|---|---|
protected static org.apache.log4j.Logger |
log
|
| Constructor Summary | |
|---|---|
QueryUtil()
|
|
| Method Summary | |
|---|---|
static Collection<File> |
collectFiles(Collection<File> in,
FileFilter filter)
Return the specified files, substituting recursively spanned files when a given file is a directory. |
static String[] |
getCapturedGroups(Pattern pattern,
ICounter counter)
Return the data captured by Pattern from the path of the
specified counter. |
static Pattern |
getPattern(Collection<Pattern> regex)
Generate a Pattern from the OR of zero or more regular
expressions which must be matched. |
static Pattern |
getPattern(Collection<String> filter,
Collection<String> regex)
Generate a Pattern from the OR of zero or more strings which must
be matched and zero or more regular expressions which must be matched. |
static Pattern |
getRequiredPerformanceCountersFilter()
Return a Pattern which will match the minimum set of performance
counters required by the load balancer to perform its function. |
static void |
main(String[] args)
Utility may be used to read the required performance counters for the load balancer from zero or more files specified on the command line. |
static void |
readCountersFromFile(File file,
CounterSet counterSet,
Pattern filter,
ICounterSet.IInstrumentFactory instrumentFactory)
Read counters matching the optional filter from the file into the given CounterSet. |
static void |
readCountersFromFile(File file,
CounterSet counterSet,
Pattern filter,
int nslots,
PeriodEnum unit)
Read counters matching the optional filter from the file into the given CounterSet. |
static void |
readEvents(DummyEventReportingService service,
File file)
Read in Events logged on a file in a tab-delimited format. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger log
| Constructor Detail |
|---|
public QueryUtil()
| Method Detail |
|---|
public static String[] getCapturedGroups(Pattern pattern,
ICounter counter)
Pattern from the path of the
specified counter.
Note: This is used to extract the parts of the Pattern which are
of interest - presuming that you mark some parts with capturing groups
and other parts that you do not care about with non-capturing groups.
Note: There is a presumption that Pattern was used to select the
counters and that counter is one of the selected counters, in
which case Pattern is KNOWN to match
ICounterNode.getPath().
null if there are no
capturing groups.
public static Pattern getPattern(Collection<String> filter,
Collection<String> regex)
Pattern from the OR of zero or more strings which must
be matched and zero or more regular expressions which must be matched.
filter - A list of strings to be matched (may be null).regex - A list of regular expressions to be matched (may be null).
Pattern -or- null if both collects are
empty.public static Pattern getPattern(Collection<Pattern> regex)
Pattern from the OR of zero or more regular
expressions which must be matched.
regex - A list of regular expressions to be matched (may be null).
Pattern -or- null if both collects are
empty.
public static void readCountersFromFile(File file,
CounterSet counterSet,
Pattern filter,
int nslots,
PeriodEnum unit)
throws IOException,
SAXException,
ParserConfigurationException
CounterSet.
file - The file.counterSet - The CounterSet.filter - An optional filter.nslots - The #of periods worth of data to be retained. This is used
when a counter not already present in counterSet is
encountered and controls the #of slots to be retained by
History allocated for that counter.unit - The unit in which the #of slots was expressed.
IOException
SAXException
ParserConfigurationException
public static void readCountersFromFile(File file,
CounterSet counterSet,
Pattern filter,
ICounterSet.IInstrumentFactory instrumentFactory)
throws IOException,
SAXException,
ParserConfigurationException
CounterSet.
file - The file.counterSet - The CounterSet.filter - An optional filter.instrumentFactory -
IOException
SAXException
ParserConfigurationException
public static void readEvents(DummyEventReportingService service,
File file)
throws IOException
Events logged on a file in a tab-delimited format.
service - The events will be added to this service.file - The file from which the events will be read.
IOException
public static Collection<File> collectFiles(Collection<File> in,
FileFilter filter)
in - A collection of zero or more files.filter - A filter which will select the files to be accepted.
public static Pattern getRequiredPerformanceCountersFilter()
Pattern which will match the minimum set of performance
counters required by the load balancer to perform its function.
public static void main(String[] args)
throws IOException,
SAXException,
ParserConfigurationException
args - The file(s).
IOException
SAXException
ParserConfigurationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||