Search in sources :

Example 1 with FakeThreadPoolMasterService

use of org.elasticsearch.cluster.service.FakeThreadPoolMasterService in project crate by crate.

the class NodeJoinTests method setupFakeMasterServiceAndCoordinator.

private void setupFakeMasterServiceAndCoordinator(long term, ClusterState initialState) {
    deterministicTaskQueue = new DeterministicTaskQueue(Settings.builder().put(Node.NODE_NAME_SETTING.getKey(), "test").build(), random());
    FakeThreadPoolMasterService fakeMasterService = new FakeThreadPoolMasterService("test_node", "test", deterministicTaskQueue::scheduleNow);
    setupMasterServiceAndCoordinator(term, initialState, fakeMasterService, deterministicTaskQueue.getThreadPool(), Randomness.get());
    fakeMasterService.setClusterStatePublisher((event, publishListener, ackListener) -> {
        coordinator.handlePublishRequest(new PublishRequest(event.state()));
        publishListener.onResponse(null);
    });
    fakeMasterService.start();
}
Also used : FakeThreadPoolMasterService(org.elasticsearch.cluster.service.FakeThreadPoolMasterService)

Aggregations

FakeThreadPoolMasterService (org.elasticsearch.cluster.service.FakeThreadPoolMasterService)1