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 1110 of file Cluster.d.


Member Function Documentation

this ILogger  logger  )  [inline]
 

Definition at line 1121 of file Cluster.d.

References nodes, and random.

ILogger getLogger  )  [inline]
 

Definition at line 1131 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 1143 of file Cluster.d.

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

void optimize  )  [inline]
 

Definition at line 1159 of file Cluster.d.

References nodes.

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

Definition at line 1184 of file Cluster.d.

Referenced by Cluster::notify().

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

Definition at line 1202 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 1222 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 1252 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 1273 of file Cluster.d.

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

Referenced by Cluster::getQueue().


Member Data Documentation

HashMap map [private]
 

Definition at line 1112 of file Cluster.d.

Node [] nodes [private]
 

Definition at line 1113 of file Cluster.d.

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

Node [] random [private]
 

Definition at line 1114 of file Cluster.d.

Referenced by scan(), and this().

ILogger logger [private]
 

Definition at line 1115 of file Cluster.d.


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:08 2004 for Mango by doxygen 1.3.6