Search in sources :

Example 1 with PrimaryReplicaSyncer

use of org.opensearch.index.shard.PrimaryReplicaSyncer in project OpenSearch by opensearch-project.

the class IndicesClusterStateServiceRandomUpdatesTests method createIndicesClusterStateService.

private IndicesClusterStateService createIndicesClusterStateService(DiscoveryNode discoveryNode, final Supplier<MockIndicesService> indicesServiceSupplier) {
    final ThreadPool threadPool = mock(ThreadPool.class);
    when(threadPool.generic()).thenReturn(mock(ExecutorService.class));
    final MockIndicesService indicesService = indicesServiceSupplier.get();
    final Settings settings = Settings.builder().put("node.name", discoveryNode.getName()).build();
    final TransportService transportService = new TransportService(settings, mock(Transport.class), threadPool, TransportService.NOOP_TRANSPORT_INTERCEPTOR, boundAddress -> DiscoveryNode.createLocal(settings, boundAddress.publishAddress(), UUIDs.randomBase64UUID()), null, Collections.emptySet());
    final ClusterService clusterService = mock(ClusterService.class);
    final RepositoriesService repositoriesService = new RepositoriesService(settings, clusterService, transportService, Collections.emptyMap(), Collections.emptyMap(), threadPool);
    final PeerRecoveryTargetService recoveryTargetService = new PeerRecoveryTargetService(threadPool, transportService, null, clusterService);
    final ShardStateAction shardStateAction = mock(ShardStateAction.class);
    final PrimaryReplicaSyncer primaryReplicaSyncer = mock(PrimaryReplicaSyncer.class);
    return new IndicesClusterStateService(settings, indicesService, clusterService, threadPool, recoveryTargetService, shardStateAction, null, repositoriesService, null, null, null, primaryReplicaSyncer, s -> {
    }, RetentionLeaseSyncer.EMPTY);
}
Also used : ClusterService(org.opensearch.cluster.service.ClusterService) PeerRecoveryTargetService(org.opensearch.indices.recovery.PeerRecoveryTargetService) TransportService(org.opensearch.transport.TransportService) RepositoriesService(org.opensearch.repositories.RepositoriesService) TestThreadPool(org.opensearch.threadpool.TestThreadPool) ThreadPool(org.opensearch.threadpool.ThreadPool) ExecutorService(java.util.concurrent.ExecutorService) ShardStateAction(org.opensearch.cluster.action.shard.ShardStateAction) Transport(org.opensearch.transport.Transport) PrimaryReplicaSyncer(org.opensearch.index.shard.PrimaryReplicaSyncer) Settings(org.opensearch.common.settings.Settings)

Aggregations

ExecutorService (java.util.concurrent.ExecutorService)1 ShardStateAction (org.opensearch.cluster.action.shard.ShardStateAction)1 ClusterService (org.opensearch.cluster.service.ClusterService)1 Settings (org.opensearch.common.settings.Settings)1 PrimaryReplicaSyncer (org.opensearch.index.shard.PrimaryReplicaSyncer)1 PeerRecoveryTargetService (org.opensearch.indices.recovery.PeerRecoveryTargetService)1 RepositoriesService (org.opensearch.repositories.RepositoriesService)1 TestThreadPool (org.opensearch.threadpool.TestThreadPool)1 ThreadPool (org.opensearch.threadpool.ThreadPool)1 Transport (org.opensearch.transport.Transport)1 TransportService (org.opensearch.transport.TransportService)1