|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanet.generic.commonapi.NodeImpl
planet.symphony.SymphonyNode
This node is an implementation of the Symphony overlay.
Field Summary | |
static int |
ACCEPT_CONNECT
|
static int |
BROADCAST
Type value: The message with this type identifies a broadcast message. |
static int |
CANCEL_CONNECT
|
static int |
CLOSE_LONG_CONNECT
|
static int |
CLOSE_PRED_CONNECT
|
static int |
CLOSE_SUCC_CONNECT
|
static int |
DATA
Type value: It identifies that this message contains an application level Message. |
static int |
GET_SUCC
|
static int |
JOIN_FINISHED
|
static int |
NEW_SUCC_IN_LIST
|
static int |
QUERY_CONNECT
|
static int |
QUERY_JOIN
Type value: First message that is send by any node to get its inmediate successor. |
static int |
QUERY_JOIN_SET
|
static int |
REFRESH
Mode value: Defines a message's mode that requires only communication on one way. |
static int |
REFUSE_JOIN
|
static int |
REPLY
Mode value: Defines the response of a communication. |
static int |
REQUEST
Mode value: Defines the start of communication that requires response (REPLY). |
static int |
SET_INFO
|
static int |
SET_SECTIONSIZEPRED
|
static java.lang.String[] |
TYPES
This String contains a string representation of each of types and modes values of the RouteMessage. |
Fields inherited from class planet.generic.commonapi.NodeImpl |
endpoints, id, listeners, nodeHandle |
Constructor Summary | |
SymphonyNode(Id id)
|
Method Summary | |
void |
broadcast(java.lang.String appId,
NodeHandle to,
NodeHandle nextHop,
Message msg)
Initiating a Broadcast Message |
void |
dispatcher(RouteMessage msg)
|
void |
fail()
If supose TCP connections onto network layer, this method must informe with some type of error message to its connected nodes for broken connection. |
java.util.Hashtable |
getInfo()
Returns information of the node |
NodeHandle |
getPred()
Returns the NodeHandle of the present predecessor of the node |
java.util.Vector |
getSuccList(int max)
Returns the successor list of the present node with max number of Ids. |
boolean |
isAlive()
Informs if this node is alive. |
boolean |
IsStabilized()
|
void |
join(Id bsId)
The node joins in the network |
void |
leave()
The node leaves the network |
java.util.Vector |
localLookup(Id key,
int max,
boolean safe)
Returns a list of nodes that can be used as next hops on a route towards key. |
void |
lookup(Id key)
Lookup of a key |
java.util.Vector |
neighborSet(int max)
Obtains an unordered list of up to max nodes that are neighbors of the local node. |
void |
prettyPrintNode()
Shows for System.out only the owner Id, its predecessor and successor. |
void |
printNode()
Shows for System.out all information of the node, including finger table. |
boolean |
process(int actualStep)
Given a time fraction, the node it can do everything what needs during this |
boolean |
range(NodeHandle node,
Id rank,
Id leftKey,
Id rightKey)
This operation provides information about ranges of keys for which the node is currently a root. |
java.util.Vector |
replicaSet(Id key,
int maxRank)
Returns an ordered set of nodes on which replicas of the object with this key can be stored. |
void |
routeData(java.lang.String appId,
NodeHandle to,
NodeHandle nextHop,
Message msg)
Receive's data of the application level and sends it through de network. |
java.lang.String |
toString()
|
Methods inherited from class planet.generic.commonapi.NodeImpl |
addMessageListener, getId, getIdFactory, getLocalHandle, getRegisteredApplications, hasMoreMessages, nextMessage, outMessages, receive, registerApplication, removeMessageListener, send, setTimer, setTimer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int REQUEST
public static final int REPLY
public static final int REFRESH
public static final int QUERY_JOIN
public static final int QUERY_JOIN_SET
public static final int SET_INFO
public static final int JOIN_FINISHED
public static final int SET_SECTIONSIZEPRED
public static final int REFUSE_JOIN
public static final int QUERY_CONNECT
public static final int ACCEPT_CONNECT
public static final int CANCEL_CONNECT
public static final int CLOSE_LONG_CONNECT
public static final int CLOSE_PRED_CONNECT
public static final int CLOSE_SUCC_CONNECT
public static final int NEW_SUCC_IN_LIST
public static final int GET_SUCC
public static final int BROADCAST
public static final int DATA
public static final java.lang.String[] TYPES
Constructor Detail |
public SymphonyNode(Id id) throws InitializationException
Method Detail |
public NodeHandle getPred()
Node
public void join(Id bsId)
NodeImpl
join
in interface Node
join
in class NodeImpl
public void leave()
NodeImpl
leave
in interface Node
leave
in class NodeImpl
public void lookup(Id key)
NodeImpl
lookup
in class NodeImpl
key
- Idpublic void dispatcher(RouteMessage msg)
public boolean process(int actualStep)
NodeImpl
process
in interface Node
process
in class NodeImpl
actualStep
- Actual step in simulation time.
public java.util.Hashtable getInfo()
NodeImpl
getInfo
in class NodeImpl
public void routeData(java.lang.String appId, NodeHandle to, NodeHandle nextHop, Message msg)
Node
appId
- String that includes the application identification.to
- Node that must receive this message. If cannot represents
a real node.nextHop
- Node that must receive this message as first hop.msg
- Message to be sent.
If it is null, the message must be routed.public void printNode()
Node
public void prettyPrintNode()
Node
public boolean isAlive()
Node
public java.lang.String toString()
public boolean IsStabilized()
public void broadcast(java.lang.String appId, NodeHandle to, NodeHandle nextHop, Message msg)
Node
appId
- to
- nextHop
- msg
-
Node.broadcast(java.lang.String, planet.commonapi.NodeHandle, planet.commonapi.NodeHandle, planet.commonapi.Message)
public void fail()
Node
Node.fail()
public java.util.Vector getSuccList(int max)
Node
max
-
Node.getSuccList(int)
public java.util.Vector localLookup(Id key, int max, boolean safe)
Node
key
- max
- safe
-
Node.localLookup(planet.commonapi.Id, int, boolean)
public java.util.Vector neighborSet(int max)
Node
max
-
Node.neighborSet(int)
public boolean range(NodeHandle node, Id rank, Id leftKey, Id rightKey)
Node
node
- rank
- leftKey
- rightKey
-
Node.range(planet.commonapi.NodeHandle, planet.commonapi.Id, planet.commonapi.Id, planet.commonapi.Id)
public java.util.Vector replicaSet(Id key, int maxRank)
Node
key
- maxRank
-
Node.replicaSet(planet.commonapi.Id, int)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |