public interface Cluster
Cluster interface is the part of "Coordination part", which plays next roles:
- Connect/Disconnect to other nodes
- Keep track of current cluster members via ClusterView
- Perform leadership election in case of any cluster membership changes
- Prevent cluster from "split-brain" phenomen.
- Provide internal system messaging between nodes.| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Connects to the current Reveno group of nodes.
|
void |
disconnect()
Marks itself as detached from the cluster, and frees all allocated resources and connections
for it.
|
ClusterConnector |
gateway()
Provides gateway instance which provides with communication ability between nodes via
sending
Messages to each other. |
boolean |
isConnected()
Checks whether current node is included in current group of hosts.
|
void |
listenEvents(java.util.function.Consumer<ClusterEvent> consumer)
Subscribes to the set of events, which can eventually be issued, reflecting some changes in
membership, etc.
|
void |
marshallWith(Marshaller marshaller)
Sets the marshaller instance, which will be used to marshall/unmarshall all incoming/outgoing
messages.
|
ClusterView |
view()
Returns the current Reveno Cluster View.
|
void connect()
void disconnect()
boolean isConnected()
ClusterConnector gateway()
Messages to each other.void marshallWith(Marshaller marshaller)
marshaller - void listenEvents(java.util.function.Consumer<ClusterEvent> consumer)
consumer - ClusterView view()
Copyright © 2015 Artem Dmitriev. All Rights Reserved.