Search in sources :

Example 11 with VotingConfigExclusion

use of org.elasticsearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion in project crate by crate.

the class GatewayMetaStatePersistedStateTests method createCoordinationMetadata.

private CoordinationMetadata createCoordinationMetadata(long term) {
    CoordinationMetadata.Builder builder = CoordinationMetadata.builder();
    builder.term(term);
    builder.lastAcceptedConfiguration(new CoordinationMetadata.VotingConfiguration(Set.of(generateRandomStringArray(10, 10, false))));
    builder.lastCommittedConfiguration(new CoordinationMetadata.VotingConfiguration(Set.of(generateRandomStringArray(10, 10, false))));
    for (int i = 0; i < randomIntBetween(0, 5); i++) {
        builder.addVotingConfigExclusion(new VotingConfigExclusion(randomAlphaOfLength(10), randomAlphaOfLength(10)));
    }
    return builder.build();
}
Also used : VotingConfigExclusion(org.elasticsearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion) CoordinationMetadata(org.elasticsearch.cluster.coordination.CoordinationMetadata)

Aggregations

VotingConfigExclusion (org.elasticsearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion)11 DiscoveryNode (org.elasticsearch.cluster.node.DiscoveryNode)6 ClusterState (org.elasticsearch.cluster.ClusterState)5 IOException (java.io.IOException)4 TimeValue (io.crate.common.unit.TimeValue)3 Set (java.util.Set)3 ActionListener (org.elasticsearch.action.ActionListener)3 ClusterName (org.elasticsearch.cluster.ClusterName)3 ClusterStateUpdateTask (org.elasticsearch.cluster.ClusterStateUpdateTask)3 Metadata (org.elasticsearch.cluster.metadata.Metadata)3 Collections (java.util.Collections)2 HashSet (java.util.HashSet)2 Predicate (java.util.function.Predicate)2 ElasticsearchException (org.elasticsearch.ElasticsearchException)2 ElasticsearchTimeoutException (org.elasticsearch.ElasticsearchTimeoutException)2 ClusterStateObserver (org.elasticsearch.cluster.ClusterStateObserver)2 CoordinationMetadata (org.elasticsearch.cluster.coordination.CoordinationMetadata)2 DiscoveryNodes (org.elasticsearch.cluster.node.DiscoveryNodes)2 Builder (org.elasticsearch.cluster.node.DiscoveryNodes.Builder)2 Priority (org.elasticsearch.common.Priority)2