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 |
Definition at line 1115 of file Cluster.d.
|
|
|
|
|
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(). |
|
Definition at line 1164 of file Cluster.d. References nodes. |
|
Definition at line 1189 of file Cluster.d. Referenced by Cluster::notify(). |
|
Definition at line 1207 of file Cluster.d. Referenced by Cluster::getCache(), Cluster::putCache(), and Cluster::putQueue(). |
|
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(). |
|
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(). |
|
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(). |
|
|
|
Definition at line 1118 of file Cluster.d. Referenced by optimize(), scan(), selectNode(), and this(). |
|
|
|
|