Package org.apache.ignite.configuration
Interface TopologyValidator
- 
- All Superinterfaces:
- Serializable
 
 public interface TopologyValidator extends Serializable Topology validator is used to verify that cluster topology is valid for further cache operations. The topology validator is invoked every time the cluster topology changes (either a new node joined or an existing node failed or left).If topology validator is not configured, then the cluster topology is always considered to be valid. Whenever the validate(Collection)method returnstrue, then the topology is considered valid for a certain cache and all operations on this cache will be allowed to proceed. Otherwise, all update operations on the cache are restricted with the following exceptions:- CacheExceptionwill be thrown for all update operations (put, remove, etc) attempt.
- IgniteExceptionwill be thrown for the transaction commit attempt.
 falseand declaring the topology not valid, the topology validator can return to normal state whenever the next topology change happens.ExampleThe example below shows how a validator can be used to allow cache updates only in case if the cluster topology contains exactly 2 nodes:new TopologyValidator() { public boolean validate(Collectionnodes) { return nodes.size() == 2; } } ConfigurationThe topology validator can be configured either from code or XML viaCacheConfiguration.setTopologyValidator(TopologyValidator)method.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanvalidate(Collection<ClusterNode> nodes)Validates topology.
 
- 
- 
- 
Method Detail- 
validateboolean validate(Collection<ClusterNode> nodes) Validates topology.- Parameters:
- nodes- Collection of nodes.
- Returns:
- truein case topology is valid for specific cache, otherwise- false
 
 
- 
 
-