in src/main/java/org/opensearch/search/asynchronous/service/AsynchronousSearchService.java [132:158]
public AsynchronousSearchService(AsynchronousSearchPersistenceService asynchronousSearchPersistenceService,
AsynchronousSearchActiveStore asynchronousSearchActiveStore, Client client,
ClusterService clusterService, ThreadPool threadPool,
AsynchronousSearchContextEventListener contextEventListener,
NamedWriteableRegistry namedWriteableRegistry) {
this.contextEventListener = contextEventListener;
this.client = client;
Settings settings = clusterService.getSettings();
clusterService.getClusterSettings().addSettingsUpdateConsumer(MAX_KEEP_ALIVE_SETTING, this::setKeepAlive);
setKeepAlive(MAX_KEEP_ALIVE_SETTING.get(settings));
clusterService.getClusterSettings().addSettingsUpdateConsumer(MAX_WAIT_FOR_COMPLETION_TIMEOUT_SETTING,
this::setMaxWaitForCompletionTimeout);
setMaxWaitForCompletionTimeout(MAX_WAIT_FOR_COMPLETION_TIMEOUT_SETTING.get(settings));
clusterService.getClusterSettings().addSettingsUpdateConsumer(MAX_SEARCH_RUNNING_TIME_SETTING, this::setMaxSearchRunningTime);
setMaxSearchRunningTime(MAX_SEARCH_RUNNING_TIME_SETTING.get(settings));
clusterService.getClusterSettings().addSettingsUpdateConsumer(PERSIST_SEARCH_FAILURES_SETTING, this::setPersistSearchFailure);
setPersistSearchFailure(PERSIST_SEARCH_FAILURES_SETTING.get(clusterService.getSettings()));
this.threadPool = threadPool;
this.clusterService = clusterService;
this.persistenceService = asynchronousSearchPersistenceService;
this.currentTimeSupplier = System::currentTimeMillis;
this.asynchronousSearchActiveStore = asynchronousSearchActiveStore;
this.asynchronousSearchStateMachine = initStateMachine();
this.asynchronousSearchPostProcessor = new AsynchronousSearchPostProcessor(persistenceService, asynchronousSearchActiveStore,
asynchronousSearchStateMachine, this::freeActiveContext, threadPool, clusterService);
this.namedWriteableRegistry = namedWriteableRegistry;
}