|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnewscast.SimpleNewscast
public class SimpleNewscast
This class represents the information stored by a node in the simplified newscast system (i.e., used just as a topology manager)
Field Summary | |
---|---|
protected peersim.core.Node[] |
cache
Neighbors currently in the cache |
static java.lang.String |
PAR_CACHE
config parameter name for the cache size |
protected static peersim.core.Node[] |
tn
Temp array for merging. |
protected static int[] |
ts
Temp array for merging. |
protected int[] |
tstamps
Time stamps currently in the cache |
Constructor Summary | |
---|---|
SimpleNewscast(java.lang.String n)
|
Method Summary | |
---|---|
protected int |
_degree()
Normally it does the same as degree() . |
boolean |
addNeighbor(peersim.core.Node node)
|
java.lang.Object |
clone()
|
protected static boolean |
contains(int size,
peersim.core.Node peer)
|
boolean |
contains(peersim.core.Node n)
|
int |
degree()
Might be less than cache size. |
peersim.core.Node |
getNeighbor(int i)
Does not check if the index is out of bound (larger than degree() ) |
protected peersim.core.Node |
getPeer()
Returns a peer node which is accessible (has ok fail state). |
protected void |
merge(peersim.core.Node thisNode,
SimpleNewscast peer,
peersim.core.Node peerNode,
int timestamp)
Merge the content of two nodes and adds a new version of the identifier. |
void |
nextCycle(peersim.core.Node n,
int protocolID)
|
void |
pack()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static peersim.core.Node[] tn
protected static int[] ts
public static final java.lang.String PAR_CACHE
protected peersim.core.Node[] cache
protected int[] tstamps
Constructor Detail |
---|
public SimpleNewscast(java.lang.String n)
Method Detail |
---|
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface peersim.core.Protocol
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
protected peersim.core.Node getPeer()
protected void merge(peersim.core.Node thisNode, SimpleNewscast peer, peersim.core.Node peerNode, int timestamp)
thisNode
- the node that hosts this newscast protocol instance (process)peer
- The peer with which we perform cache exchangepeerNode
- the node that hosts the peer newscast protocol instancetimestamp
- the timestamp nowprotected static boolean contains(int size, peersim.core.Node peer)
protected int _degree()
degree()
. It is necessary to allow
other implementations of degree()
in extending classes which fool
the system into
thinking that the graph is different from what it is. Methods of this class
should use this as degree.
public peersim.core.Node getNeighbor(int i)
degree()
)
getNeighbor
in interface peersim.core.Linkable
public int degree()
degree
in interface peersim.core.Linkable
public boolean addNeighbor(peersim.core.Node node)
addNeighbor
in interface peersim.core.Linkable
public void pack()
pack
in interface peersim.core.Linkable
public boolean contains(peersim.core.Node n)
contains
in interface peersim.core.Linkable
public void nextCycle(peersim.core.Node n, int protocolID)
nextCycle
in interface peersim.cdsim.CDProtocol
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |