|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.engine.cluster.NodeStateInfo
public class NodeStateInfo
Holds performance data of a node.
This is a demo code only, we need to change it to handle some performance index which is comparable between different nodes.<!-- Messages of type "__sys__cluster.node.master[heron]": --> <state> <cpu id='0' idle='40'/> <!-- currently 60% load on first CPU --> <cpu id='1' idle='44'/> <ram free='12000'/> <!-- xmlBlaster server has 12 MB free memory --> <performance bogomips='1205.86' idleIndex='20'/> </master>
Nested Class Summary | |
---|---|
(package private) class |
NodeStateInfo.Cpu
|
Field Summary | |
---|---|
private int |
avgCpuIdle
Average idle of all CPUs of the node, -1 if not known |
private java.util.Map |
cpuMap
Holds Cpu info objects, the key is the 'id' |
private int |
freeRam
Free RAM memory in kBytes, -1 if not known |
private static java.util.logging.Logger |
log
|
Constructor Summary | |
---|---|
NodeStateInfo(Global global)
|
Method Summary | |
---|---|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String name,
java.lang.StringBuffer character)
Handle SAX parsed end element |
int |
getAvgCpuIdle()
|
int |
getFreeRam()
|
void |
setCpu(int id,
int idle)
Add or change the current CPU idle value |
void |
setFreeRam(int freeRam)
Free RAM memory in kBytes |
boolean |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String name,
java.lang.StringBuffer character,
org.xml.sax.Attributes attrs)
Called for SAX master start tag |
java.lang.String |
toXml()
Dump state of this object into a XML ASCII string. |
java.lang.String |
toXml(java.lang.String extraOffset)
Dump state of this object into a XML ASCII string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.util.logging.Logger log
private int freeRam
private java.util.Map cpuMap
private int avgCpuIdle
Constructor Detail |
---|
public NodeStateInfo(Global global)
Method Detail |
---|
public int getFreeRam()
public void setFreeRam(int freeRam)
public int getAvgCpuIdle()
public void setCpu(int id, int idle)
public final boolean startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, java.lang.StringBuffer character, org.xml.sax.Attributes attrs)
public final void endElement(java.lang.String uri, java.lang.String localName, java.lang.String name, java.lang.StringBuffer character)
public final java.lang.String toXml()
public final java.lang.String toXml(java.lang.String extraOffset)
extraOffset
- indenting of tags for nice output
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |