Search in sources :

Example 36 with TestGatewayAllocator

use of org.elasticsearch.test.gateway.TestGatewayAllocator in project crate by crate.

the class GatewayServiceTests method createService.

private GatewayService createService(final Settings.Builder settings) {
    final ClusterService clusterService = new ClusterService(Settings.builder().put("cluster.name", "GatewayServiceTests").build(), new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), null);
    final AllocationService allocationService = new AllocationService(new AllocationDeciders(new HashSet<>(Arrays.asList(new SameShardAllocationDecider(Settings.EMPTY, new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS)), new ReplicaAfterPrimaryActiveAllocationDecider()))), new TestGatewayAllocator(), new BalancedShardsAllocator(Settings.EMPTY), EmptyClusterInfoService.INSTANCE);
    return new GatewayService(settings.build(), allocationService, clusterService, null, null, null);
}
Also used : TestGatewayAllocator(org.elasticsearch.test.gateway.TestGatewayAllocator) SameShardAllocationDecider(org.elasticsearch.cluster.routing.allocation.decider.SameShardAllocationDecider) ClusterService(org.elasticsearch.cluster.service.ClusterService) ClusterSettings(org.elasticsearch.common.settings.ClusterSettings) BalancedShardsAllocator(org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator) AllocationDeciders(org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders) ReplicaAfterPrimaryActiveAllocationDecider(org.elasticsearch.cluster.routing.allocation.decider.ReplicaAfterPrimaryActiveAllocationDecider) AllocationService(org.elasticsearch.cluster.routing.allocation.AllocationService) HashSet(java.util.HashSet)

Aggregations

TestGatewayAllocator (org.elasticsearch.test.gateway.TestGatewayAllocator)36 ClusterState (org.elasticsearch.cluster.ClusterState)34 BalancedShardsAllocator (org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator)28 RoutingTable (org.elasticsearch.cluster.routing.RoutingTable)26 AllocationService (org.elasticsearch.cluster.routing.allocation.AllocationService)19 IndexMetaData (org.elasticsearch.cluster.metadata.IndexMetaData)18 MetaData (org.elasticsearch.cluster.metadata.MetaData)18 ClusterSettings (org.elasticsearch.common.settings.ClusterSettings)18 Settings (org.elasticsearch.common.settings.Settings)17 IndexRoutingTable (org.elasticsearch.cluster.routing.IndexRoutingTable)16 IndexShardRoutingTable (org.elasticsearch.cluster.routing.IndexShardRoutingTable)16 AllocationDeciders (org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders)14 ClusterInfo (org.elasticsearch.cluster.ClusterInfo)13 ClusterInfoService (org.elasticsearch.cluster.ClusterInfoService)13 DiskUsage (org.elasticsearch.cluster.DiskUsage)13 DiskThresholdSettings (org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings)13 ImmutableOpenMap (org.elasticsearch.common.collect.ImmutableOpenMap)13 Matchers.containsString (org.hamcrest.Matchers.containsString)13 DiscoveryNode (org.elasticsearch.cluster.node.DiscoveryNode)12 IndexMetadata (org.elasticsearch.cluster.metadata.IndexMetadata)9