Inheritance diagram for Cluster:
Public Member Functions | |
this (ILogger logger=null) | |
this (ILogger logger, IConduit conduit) | |
this (ILogger logger, uint serverPort) | |
void | notify (IEvent event, IPayload payload) |
IChannel | createChannel (char[] channel) |
ILogger | getLogger () |
synchronized void | broadcast (IChannel channel, IPayload payload=null) |
IConsumer | createConsumer (IChannel channel, IEvent.Style style, IEventListener notify) |
IPayload | getCache (IChannel channel, char[] key, bool remove) |
IPayload | putCache (IChannel channel, char[] key, IPayload payload) |
IPayload | putQueue (IChannel channel, IPayload payload) |
IPayload | getQueue (IChannel channel) |
void | loadCache (IChannel channel, char[] key, IPayload payload) |
synchronized InternetAddress | getGroup (char[] channel) |
Static Public Member Functions | |
this () | |
Private Attributes | |
ILogger | logger |
NodeSet | nodeSet |
Buffer | mBuffer |
ProtocolWriter | mWriter |
MulticastSocket | mSocket |
ushort | groupTTL = 1 |
ushort | groupPort = 3333 |
ubyte | groupPrefix = 225 |
Static Private Attributes | |
HashMap | groups |
import mango.cluster.NetworkCache; import mango.cluster.qos.socket.Cluster; ICluster cluster = new Cluster (...); NetworkCache cache = new NetworkCache (cluster, ...); cache.put (...); cache.get (...); cache.invalidate (...);
Please see the cluster clients for additional details. Currently these include CacheInvalidator, CacheInvalidatee, NetworkMessage, NetworkTask, NetworkQueue, NetworkCache, NetworkCombo, plus the Client base-class.
Definition at line 95 of file Cluster.d.
|
Setup a hashmap for multicast group addresses |
|
Setup a Cluster instance. Currently the buffer & writer are shared for all bulletin serialization; this should probably change at some point such that we can support multiple threads broadcasting concurrently to different output ports. Definition at line 129 of file Cluster.d. References Buffer, mBuffer, mSocket, mWriter, nodeSet, and ProtocolWriter. |
|
Setup a Cluster instance. Currently the buffer & writer are shared for all bulletin serialization; this should probably change at some point such that we can support multiple threads broadcasting concurrently to different output ports. |
|
Setup a Cluster instance. Currently the buffer & writer are shared for all bulletin serialization; this should probably change at some point such that we can support multiple threads broadcasting concurrently to different output ports. |
|
IEventListener interface method for listening to RollCall responses. These are sent out by cluster servers both when they get a RollCall request, and when they begin execution. Reimplemented from IEventListener. Definition at line 224 of file Cluster.d. References NodeSet::enable(), RollCall::name, nodeSet, RollCall::port1, RollCall::port2, and RollCall::request. |
|
Create a channel instance. Our channel implementation includes a number of cached IO helpers (ProtolcolWriter and so on) which simplifies and speeds up execution. Reimplemented from ICluster. Definition at line 241 of file Cluster.d. Referenced by ClusterQueue::put(), and ClusterServer::this(). |
|
Return the logger instance provided during construction. Reimplemented from ICluster. Definition at line 252 of file Cluster.d. Referenced by ClusterServer::addCacheLoader(), and ClusterQueue::this(). |
|
Broadcast a payload on the specified channel. This uses IP/Multicast to scatter the payload to all registered listeners (on the same multicast group). Note that the maximum payload size is limited to that of an Ethernet data frame, minus the IP/UDP header size (1472 bytes). Reimplemented from ICluster. Definition at line 267 of file Cluster.d. References Buffer::clear(), getGroup(), IChannel::getName(), Buffer::getPosition(), mBuffer, mSocket, mWriter, ProtocolWriter::put(), and DatagramSocket::write(). Referenced by ClusterServer::notify(), ClusterQueue::run(), and ClusterServer::start(). |
|
Create a listener of the specified type. Listeners are run within their own thread, since they spend the vast majority of their time blocked on a Socket read. Would be good to support multiplexed reading instead, such that a thread pool could be applied instead. Reimplemented from ICluster. Definition at line 291 of file Cluster.d. References ClusterEvent, IChannel::getName(), IEvent::getStyleName(), and ILogger::info(). Referenced by ClusterServer::this(). |
|
Return a entry from the network cache, and optionally remove it. This is a synchronous operation as opposed to the asynchronous nature of an invalidate broadcast. Reimplemented from ICluster. Definition at line 318 of file Cluster.d. References Channel::getName(), nodeSet, ProtocolWriter::put(), Channel::reader, NodeSet::request(), and Channel::writer. |
|
Place an entry into the network cache, replacing the entry with the identical key. Note that this may cause the oldest entry in the cache to be displaced if the cache is already full. Reimplemented from ICluster. Definition at line 336 of file Cluster.d. References Channel::getName(), nodeSet, ProtocolWriter::put(), Channel::reader, NodeSet::request(), and Channel::writer. |
|
Add an entry to the specified network queue. May throw a QueueFullException if there's no room available. Reimplemented from ICluster. Definition at line 351 of file Cluster.d. References Channel::getName(), nodeSet, ProtocolWriter::put(), Channel::reader, NodeSet::request(), and Channel::writer. |
|
Query the cluster for queued entries on the corresponding channel. Returns, and removes, the first matching entry from the cluster. Note that this sweeps the cluster for matching entries, and is synchronous in nature. The more common approach is to setup a queue listener, which will grab and dispatch queue entries asynchronously. Reimplemented from ICluster. Definition at line 372 of file Cluster.d. References Node::cache, Channel::getName(), nodeSet, ProtocolWriter::put(), Channel::reader, Node::request(), NodeSet::scan(), and Channel::writer. Referenced by MessageConsumer::invoke(). |
|
Load a network cache entry remotely. This sends the given Payload over the network to the cache host, where it will be executed locally. The benefit of doing so it that the host may deny access to the cache entry for the duration of the load operation. This, in turn, provides an elegant mechanism for gating/synchronizing multiple network clients over a given cache entry; handy for those entries that are relatively expensive to construct or access. Reimplemented from ICluster. Definition at line 405 of file Cluster.d. References Channel::getName(), nodeSet, ProtocolWriter::put(), Channel::reader, Node::request(), NodeSet::selectNode(), Node::tasks, and Channel::writer. |
|
Return an internet address representing the multicast group for the specified channel. We use three of the four address segments to represent the channel itself (via a hash on the channel name), and set the primary segment to be that of the broadcast prefix (above). Definition at line 424 of file Cluster.d. References HashMap::get(), groupPort, groupPrefix, groups, HashMap::jhash(), and HashMap::put(). Referenced by broadcast(), and BulletinConsumer::this(). |
|
Definition at line 97 of file Cluster.d. Referenced by getGroup(), and this(). |
|
|
|
Definition at line 99 of file Cluster.d. Referenced by getCache(), getQueue(), loadCache(), notify(), putCache(), putQueue(), and this(). |
|
Definition at line 100 of file Cluster.d. Referenced by broadcast(), and this(). |
|
Definition at line 101 of file Cluster.d. Referenced by broadcast(), and this(). |
|
Definition at line 102 of file Cluster.d. Referenced by broadcast(), and this(). |
|
|
|
Definition at line 105 of file Cluster.d. Referenced by getGroup(). |
|
Definition at line 106 of file Cluster.d. Referenced by getGroup(). |