use of org.elasticsearch.transport.TransportService in project elasticsearch by elastic.
the class ClusterStateHealthTests method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
clusterService = createClusterService(threadPool);
transportService = new TransportService(clusterService.getSettings(), new CapturingTransport(), threadPool, TransportService.NOOP_TRANSPORT_INTERCEPTOR, x -> clusterService.localNode(), null);
transportService.start();
transportService.acceptIncomingRequests();
}
use of org.elasticsearch.transport.TransportService in project elasticsearch by elastic.
the class DynamicMappingDisabledTests method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
Settings settings = Settings.builder().put(MapperService.INDEX_MAPPER_DYNAMIC_SETTING.getKey(), false).build();
clusterService = createClusterService(threadPool);
Transport transport = new MockTcpTransport(settings, threadPool, BigArrays.NON_RECYCLING_INSTANCE, new NoneCircuitBreakerService(), new NamedWriteableRegistry(Collections.emptyList()), new NetworkService(settings, Collections.emptyList()));
transportService = new TransportService(clusterService.getSettings(), transport, threadPool, TransportService.NOOP_TRANSPORT_INTERCEPTOR, x -> clusterService.localNode(), null);
IndicesService indicesService = getInstanceFromNode(IndicesService.class);
ShardStateAction shardStateAction = new ShardStateAction(settings, clusterService, transportService, null, null, threadPool);
ActionFilters actionFilters = new ActionFilters(Collections.emptySet());
IndexNameExpressionResolver indexNameExpressionResolver = new IndexNameExpressionResolver(settings);
AutoCreateIndex autoCreateIndex = new AutoCreateIndex(settings, new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), indexNameExpressionResolver);
UpdateHelper updateHelper = new UpdateHelper(settings, null);
TransportShardBulkAction shardBulkAction = new TransportShardBulkAction(settings, transportService, clusterService, indicesService, threadPool, shardStateAction, null, updateHelper, actionFilters, indexNameExpressionResolver);
transportBulkAction = new TransportBulkAction(settings, threadPool, transportService, clusterService, null, shardBulkAction, null, actionFilters, indexNameExpressionResolver, autoCreateIndex, System::currentTimeMillis);
}
use of org.elasticsearch.transport.TransportService in project elasticsearch by elastic.
the class GlobalCheckpointSyncActionTests method setUp.
public void setUp() throws Exception {
super.setUp();
threadPool = new TestThreadPool(getClass().getName());
transport = new CapturingTransport();
clusterService = createClusterService(threadPool);
transportService = new TransportService(clusterService.getSettings(), transport, threadPool, TransportService.NOOP_TRANSPORT_INTERCEPTOR, boundAddress -> clusterService.localNode(), null);
transportService.start();
transportService.acceptIncomingRequests();
shardStateAction = new ShardStateAction(Settings.EMPTY, clusterService, transportService, null, null, threadPool);
}
use of org.elasticsearch.transport.TransportService in project crate by crate.
the class TransportKillJobsNodeActionTest method testKillIsCalledOnJobContextService.
@Test
public void testKillIsCalledOnJobContextService() throws Exception {
TransportService transportService = mock(TransportService.class);
JobContextService jobContextService = mock(JobContextService.class, Answers.RETURNS_MOCKS.get());
TransportKillJobsNodeAction transportKillJobsNodeAction = new TransportKillJobsNodeAction(Settings.EMPTY, jobContextService, new NoopClusterService(), transportService);
final CountDownLatch latch = new CountDownLatch(1);
List<UUID> toKill = ImmutableList.of(UUID.randomUUID(), UUID.randomUUID());
transportKillJobsNodeAction.nodeOperation(new KillJobsRequest(toKill), new ActionListener<KillResponse>() {
@Override
public void onResponse(KillResponse killAllResponse) {
latch.countDown();
}
@Override
public void onFailure(Throwable throwable) {
latch.countDown();
}
});
latch.await(1, TimeUnit.SECONDS);
verify(jobContextService, times(1)).killJobs(toKill);
}
use of org.elasticsearch.transport.TransportService in project crate by crate.
the class SrvUnicastHostsProviderTest method mockTransportService.
@Before
public void mockTransportService() throws Exception {
String localHostName = InetAddress.getLocalHost().getCanonicalHostName();
isLocalHost = anyOf(is(localHostName), is("localhost"));
threadPool = new TestThreadPool("dummy", Settings.EMPTY);
TransportService transportService = MockTransportService.createNewService(Settings.EMPTY, Version.CURRENT, threadPool, null);
srvUnicastHostsProvider = new SrvUnicastHostsProvider(Settings.EMPTY, transportService);
}
Aggregations