All Packages This Package Class Hierarchy Class Search Index
Class edu.utah.janos.antsr.apps.statsfusion.StatsCapsule
java.lang.Object
|
+----edu.utah.janos.antsr.core.Capsule
|
+----edu.utah.janos.antsr.apps.statsfusion.StatsCapsule
public class StatsCapsule
extends edu.utah.janos.antsr.core.Capsule
{
// Fields 12
private static final byte[] MID;
private static final byte[] PID;
public Vector branches;
public int cachetime;
public byte depth;
public short dpt;
public long keyid;
public int maxwaittime;
public long now;
private int numreturns;
public int returnwaittime;
public int rootaddress;
// Constructors 2
public StatsCapsule();
public StatsCapsule(int);
// Methods 8
private int branch(Node);
public Xdr decode();
public Xdr encode();
public boolean evaluate(Node);
public int length();
protected byte[] mid();
protected byte[] pid();
private StatsReturnCapsule waitForReturns(StatsReturnCapsule, int, Node);
}
Stats request capsule.
- Author:
-
Janos Ministry of Development
private static final byte[] MID
private static final byte[] PID
public int rootaddress
public long keyid
public short dpt
public byte depth
public long now
public int cachetime
public int returnwaittime
The maximum milliseconds to wait for unreturned capsules
before sending what has been accumlated so far
public int maxwaittime
The maximum milliseconds to wait before giving up on unresponded
nodes; only accurate to the nearest returnwaittime
public Vector branches
private int numreturns
public StatsCapsule()
public StatsCapsule(int d)
protected byte[] mid()
- Overrides:
- mid in class Capsule
protected byte[] pid()
- Overrides:
- pid in class Capsule
public int length()
- Overrides:
- length in class Capsule
public Xdr encode()
Stats request capsules look like:
4 Address of the root of the tree
4 Unique key id of this request tree
2 Application port
1 Depth
4 Time capsule was sent
4 Cachetime parameter
4 Returnwait parameter
4 Returntimeout parameter
- Overrides:
- encode in class Capsule
public Xdr decode()
- Overrides:
- decode in class Capsule
private int branch(Node n)
Does the actual process of branching the request packet
out to all neighboring nodes except those the have already
been visited.
Uses soft-state to persistantly keep track of which nodes
have already been visited and to keep from sending back to
root or the source of this request capsule
- Returns:
- The number of requests branched out
private StatsReturnCapsule waitForReturns(StatsReturnCapsule baseCap,
int numbranches,
Node n)
Waits for a maximum amount of time or for the number of expected
responses from neighboring nodes and returns a fused capsule of
all the stats return capsules that came to this node.
Parameter | Description |
baseCap | - The capsule to fuse other incomming capsules to, or
null to start with the first capsule that comes in |
numbranches | - The number of expected branches to return |
n | - This node |
public boolean evaluate(Node n)
- Overrides:
- evaluate in class Capsule
All Packages This Package Class Hierarchy Class Search Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7