Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

NodeSet Class Reference

List of all members.

Public Member Functions

 this (ILogger logger)
ILogger getLogger ()
synchronized void addNode (Node node)
void optimize ()
synchronized void enable (char[] name, ushort port1, ushort port2)
IPayload request (ProtocolWriter writer, ProtocolReader reader, char[] key=null)

Private Member Functions

final Node selectNode (uint index)
Node selectNode (char[] key=null)
bool scan (bool(*dg)(Node))

Private Attributes

HashMap map
Node[] nodes
Node[] random
ILogger logger

Detailed Description

Models a set of remote cluster nodes.

Definition at line 1115 of file Cluster.d.


Member Function Documentation

this ILogger  logger  )  [inline]
 

Definition at line 1126 of file Cluster.d.

References ILogger, nodes, and random.

ILogger getLogger  )  [inline]
 

Definition at line 1136 of file Cluster.d.

synchronized void addNode Node  node  )  [inline]
 

Add a node to the list of servers, and sort them such that all clients will have the same ordered set

Definition at line 1148 of file Cluster.d.

References HashMap::get(), HashMap::put(), and Node::toString().

void optimize  )  [inline]
 

Definition at line 1164 of file Cluster.d.

References nodes.

synchronized void enable char[]  name,
ushort  port1,
ushort  port2
[inline]
 

Definition at line 1189 of file Cluster.d.

Referenced by Cluster::notify().

IPayload request ProtocolWriter  writer,
ProtocolReader  reader,
char[]  key = null
[inline]
 

Definition at line 1207 of file Cluster.d.

Referenced by Cluster::getCache(), Cluster::putCache(), and Cluster::putQueue().

final Node selectNode uint  index  )  [inline, private]
 

Select a cluster server based on a starting index. If the selected server is not currently enabled, we just try the next one. This behaviour should be consistent across each cluster client.

Definition at line 1227 of file Cluster.d.

References Node::isEnabled(), and nodes.

Referenced by Cluster::loadCache(), and selectNode().

Node selectNode char[]  key = null  )  [inline, private]
 

Select a cluster server based on the specified key. If the selected server is not currently enabled, we just try the next one. This behaviour should be consistent across each cluster client.

Definition at line 1257 of file Cluster.d.

References selectNode().

bool scan bool(*  dg)(Node)  )  [inline, private]
 

Sweep the cluster servers. Returns true if the delegate returns true, false otherwise. The sweep is aborted when the delegate returns true. Note that this scans nodes in a randomized pattern, which should tend to avoid 'bursty' activity by a set of clients upon any one cluster server.

Definition at line 1278 of file Cluster.d.

References Node::isEnabled(), nodes, and random.

Referenced by Cluster::getQueue().


Member Data Documentation

HashMap map [private]
 

Definition at line 1117 of file Cluster.d.

Node [] nodes [private]
 

Definition at line 1118 of file Cluster.d.

Referenced by optimize(), scan(), selectNode(), and this().

Node [] random [private]
 

Definition at line 1119 of file Cluster.d.

Referenced by scan(), and this().

ILogger logger [private]
 

Definition at line 1120 of file Cluster.d.


The documentation for this class was generated from the following file:
Generated on Sat Apr 9 20:11:42 2005 for Mango by doxygen 1.3.6