com.bigdata.counters
Interface ICounterSet

All Superinterfaces:
ICounterNode
All Known Subinterfaces:
IGlobalLRU.IGlobalLRUCounters
All Known Implementing Classes:
AbstractCounterSet, CounterSet

public interface ICounterSet
extends ICounterNode

A collection of named Counters.

Version:
$Id: ICounterSet.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Nested Class Summary
static interface ICounterSet.IInstrumentFactory
          A factory for IInstrument.
 
Field Summary
static String pathSeparator
          Separator for path name components.
 
Method Summary
 void asXML(OutputStream os, String encoding, Pattern filter)
          Write an XML reprentation of the counters in the hierarchy together with their current value.
 String asXML(Pattern filter)
          Writes out the ICounterSet as XML on a string and returns that string.
 void asXML(Writer w, Pattern filter)
          Write an XML representation of the counters in the hierarchy together with their current value - does not write the XML declaration element since the encoding is unknown.
 Iterator<ICounter> getCounters(Pattern filter)
          Visits ICounter matching the optional filter declared anywhere in the hierarchy spanned by this ICounterSet.
 ICounterSet makePath(String path)
          Adds any necessary ICounterSets described in the path (ala mkdirs).
 void readXML(InputStream is, ICounterSet.IInstrumentFactory instrumentFactory, Pattern filter)
          Reads counters into this hierarchy.
 String toString()
          A human readable representation of all counters in the hierarchy together with their current value.
 String toString(Pattern filter)
          A human readable representation of the counters in the hierarchy together with their current value.
 
Methods inherited from interface com.bigdata.counters.ICounterNode
getChild, getDepth, getName, getParent, getPath, getPath, getRoot, isCounter, isCounterSet, isRoot
 

Field Detail

pathSeparator

static final String pathSeparator
Separator for path name components.

See Also:
Constant Field Values
Method Detail

getCounters

Iterator<ICounter> getCounters(Pattern filter)
Visits ICounter matching the optional filter declared anywhere in the hierarchy spanned by this ICounterSet.

Parameters:
filter - An optional regular expression that will be applied to ICounterNode.getPath() to filter matches. When specified, only ICounters whose ICounterNode.getPath() match will be visited by the Iterator.

makePath

ICounterSet makePath(String path)
Adds any necessary ICounterSets described in the path (ala mkdirs).

Parameters:
path - The path (may be relative or absolute).
Returns:
The ICounterSet described by the path.
Throws:
IllegalArgumentException - if the path is null
IllegalArgumentException - if the path is an empty string.

toString

String toString()
A human readable representation of all counters in the hierarchy together with their current value.

Overrides:
toString in class Object

toString

String toString(Pattern filter)
A human readable representation of the counters in the hierarchy together with their current value.

Parameters:
filter - An optional filter that will be used to select only specific counters.

asXML

void asXML(OutputStream os,
           String encoding,
           Pattern filter)
           throws IOException
Write an XML reprentation of the counters in the hierarchy together with their current value.

Parameters:
os - The sink on which the representation will be written.
encoding - The character set encoding that will be used, e.g., UTF-8.
filter - An optional filter that will be used to select only specific counters.
Throws:
IOException

asXML

void asXML(Writer w,
           Pattern filter)
           throws IOException
Write an XML representation of the counters in the hierarchy together with their current value - does not write the XML declaration element since the encoding is unknown.

Parameters:
w - The sink on which the representation will be written.
filter - An optional filter that will be used to select only specific counters.
Throws:
IOException

asXML

String asXML(Pattern filter)
Writes out the ICounterSet as XML on a string and returns that string.

Parameters:
filter - An optional filter.
Throws:
IOException

readXML

void readXML(InputStream is,
             ICounterSet.IInstrumentFactory instrumentFactory,
             Pattern filter)
             throws IOException,
                    ParserConfigurationException,
                    SAXException
Reads counters into this hierarchy.

Parameters:
os - The source from which the data will be read.
instrumentFactory - Used to create counters on an as needed basis.
filter - An optional filter, when specified only counters matching the filter will be processed.
Throws:
IOException
ParserConfigurationException
SAXException


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.