Struct hyparview::Node[][src]

pub struct Node<T, R = ThreadRng> { /* fields omitted */ }

HyParView node.

Note on the guarantee of the connectivity of a HyParView cluster

Because HyParView is a probabilistic algorithm, there is no strong guarantee about the connectivity of the nodes which consist a cluster.

If the membership of a cluster changes drastically, there is a (usually very low) possibility that the cluster will be splitted to some sub-clusters.

For recovering the connectivity, an upper layer have to provide some kind of connectivity checking mechanism. And when the cluster division is detected, Node::join method should be called in some nodes.

Methods

impl<T, R> Node<T, R> where
    T: Clone + Eq,
    R: Rng
[src]

Makes a new Node instance with the default options.

Makes a new Node instance with the given options.

Returns a reference to the ID of the instance.

Returns a reference to the active view of the instance.

Returns a reference to the passive view of the instance.

Returns a reference to the options of the instance.

Returns a mutable reference to the options of the instance.

Starts joining the cluster to which contact_node_id belongs.

This method may be called multiple times for recovering cluster connectivity if an upper layer detects the cluster is splitted to sub-clusters.

Removes node from the active view of the instance.

If there is no such node, it is simply ignored.

If the active view is not full, a node randomly selected from the passive view will be promoted to the active view if possible.

This is equivalent to the following code:

let message = ProtocolMessage::Disconnect(DisconnectMessage{sender: node.clone()});
self.handle_protocol_message(message);

Handles the given incoming message.

Starts shuffling the passive view of the instance.

This method should be invoked periodically to keep the passive view fresh.

Promotes a node from the passive view to the active view if the latter is not full.

This method should be invoked periodically to keep the active view full.

Sends NEIGHBOR message to the members of the active view for maintaining the symmetry property of the view.

This method should be invoked periodically to keep the symmetry property of the active view.

Polls the next action that the node wants to execute.

For running the HyParView node correctly, this method must be called periodically and the resulting action must be executed by the caller.

Trait Implementations

impl<T: Debug, R: Debug> Debug for Node<T, R>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<T, R> Send for Node<T, R> where
    R: Send,
    T: Send

impl<T, R> Sync for Node<T, R> where
    R: Sync,
    T: Sync