public class CompleteGraphAdvisor extends Object implements ClusterAdvisor
ClusterType
where the ideal state
of the Corfu cluster is a fully connected network (i.e. complete graph) in which there is an
active link amongst all nodes in the cluster. Failed and Healed nodes are recommended so that
the cluster remains fully connected.
Created by Sam Behnam on 10/27/18.
Constructor and Description |
---|
CompleteGraphAdvisor(String localEndpoint) |
Modifier and Type | Method and Description |
---|---|
Optional<NodeRank> |
failedServer(ClusterState clusterState,
List<String> unresponsiveServers)
Provides list of servers from a given layout(epoch) that this implementation of
COMPLETE_GRAPH algorithm has determined as failed.
|
ClusterGraph |
getGraph(ClusterState clusterState)
Returns a new cluster graph from the cluster state
|
ClusterType |
getType()
Get the corresponding
ClusterType used in the current instance of
ClusterAdvisor . |
Optional<NodeRank> |
healedServer(ClusterState clusterState,
List<String> unresponsiveServers)
Provide a server considered to have healed in the Corfu cluster according to
the COMPLETE_GRAPH implementation of algorithm for
ClusterType . |
public CompleteGraphAdvisor(@NonNull String localEndpoint)
public ClusterType getType()
ClusterAdvisor
ClusterType
used in the current instance of
ClusterAdvisor
. This strategy represents the characteristics of the
underlying algorithm used for making a decision about the failed or healed status of
Corfu servers.getType
in interface ClusterAdvisor
ClusterType
public Optional<NodeRank> failedServer(ClusterState clusterState, List<String> unresponsiveServers)
The failed node is the recommendation of this strategy which their removal from cluster will lead to a fully connected cluster.
To find a failed node: - get decision maker - find a failed node. Check if decision maker is not equal to failed node and failed node is not in unresponsive servers already.
failedServer
in interface ClusterAdvisor
clusterState
- represents the state of connectivity amongst the Corfu cluster
nodes from a node's perspective.unresponsiveServers
- list of unresponsive servers.public Optional<NodeRank> healedServer(ClusterState clusterState, List<String> unresponsiveServers)
ClusterType
.
The node can heal only itself. The node responsible only for itself, can't heal other nodes. It simplifies healing algorithm and guaranties that if node became available it mark itself as a responsible node in the layout. It helps us to simplify analysis/debugging process and brings simple and reliable algorithm for healing process.
healedServer
in interface ClusterAdvisor
clusterState
- represents the state of connectivity amongst the Corfu cluster
nodes from a node's perspective.unresponsiveServers
- unresponsive servers in a layout.List
of servers considered as healed according to the underlying
ClusterType
.public ClusterGraph getGraph(ClusterState clusterState)
getGraph
in interface ClusterAdvisor
clusterState
- a cluster stateCopyright © 2019 CorfuDB. All rights reserved.