Search in sources :

Example 1 with IndexModule

use of org.elasticsearch.index.IndexModule in project elasticsearch by elastic.

the class IndicesService method createIndexService.

/**
     * This creates a new IndexService without registering it
     */
private synchronized IndexService createIndexService(final String reason, IndexMetaData indexMetaData, IndicesQueryCache indicesQueryCache, IndicesFieldDataCache indicesFieldDataCache, List<IndexEventListener> builtInListeners, Consumer<ShardId> globalCheckpointSyncer, IndexingOperationListener... indexingOperationListeners) throws IOException {
    final Index index = indexMetaData.getIndex();
    final IndexSettings idxSettings = new IndexSettings(indexMetaData, this.settings, indexScopeSetting);
    logger.debug("creating Index [{}], shards [{}]/[{}{}] - reason [{}]", indexMetaData.getIndex(), idxSettings.getNumberOfShards(), idxSettings.getNumberOfReplicas(), idxSettings.isShadowReplicaIndex() ? "s" : "", reason);
    final IndexModule indexModule = new IndexModule(idxSettings, analysisRegistry);
    for (IndexingOperationListener operationListener : indexingOperationListeners) {
        indexModule.addIndexOperationListener(operationListener);
    }
    pluginsService.onIndexModule(indexModule);
    for (IndexEventListener listener : builtInListeners) {
        indexModule.addIndexEventListener(listener);
    }
    return indexModule.newIndexService(nodeEnv, xContentRegistry, this, circuitBreakerService, bigArrays, threadPool, scriptService, clusterService, client, indicesQueryCache, mapperRegistry, globalCheckpointSyncer, indicesFieldDataCache);
}
Also used : IndexingOperationListener(org.elasticsearch.index.shard.IndexingOperationListener) IndexEventListener(org.elasticsearch.index.shard.IndexEventListener) IndexSettings(org.elasticsearch.index.IndexSettings) Index(org.elasticsearch.index.Index) IndexModule(org.elasticsearch.index.IndexModule)

Example 2 with IndexModule

use of org.elasticsearch.index.IndexModule in project crate by crate.

the class IndicesService method createIndexMapperService.

/**
 * creates a new mapper service for the given index, in order to do administrative work like mapping updates.
 * This *should not* be used for document parsing. Doing so will result in an exception.
 *
 * Note: the returned {@link MapperService} should be closed when unneeded.
 */
public synchronized MapperService createIndexMapperService(IndexMetadata indexMetadata) throws IOException {
    final IndexSettings idxSettings = new IndexSettings(indexMetadata, this.settings, indexScopedSettings);
    final IndexModule indexModule = new IndexModule(idxSettings, analysisRegistry, getEngineFactory(idxSettings), directoryFactories);
    pluginsService.onIndexModule(indexModule);
    return indexModule.newIndexMapperService(xContentRegistry, mapperRegistry);
}
Also used : IndexSettings(org.elasticsearch.index.IndexSettings) IndexModule(org.elasticsearch.index.IndexModule)

Example 3 with IndexModule

use of org.elasticsearch.index.IndexModule in project elasticsearch by elastic.

the class IndicesService method createIndexMapperService.

/**
     * creates a new mapper service for the given index, in order to do administrative work like mapping updates.
     * This *should not* be used for document parsing. Doing so will result in an exception.
     *
     * Note: the returned {@link MapperService} should be closed when unneeded.
     */
public synchronized MapperService createIndexMapperService(IndexMetaData indexMetaData) throws IOException {
    final IndexSettings idxSettings = new IndexSettings(indexMetaData, this.settings, indexScopeSetting);
    final IndexModule indexModule = new IndexModule(idxSettings, analysisRegistry);
    pluginsService.onIndexModule(indexModule);
    return indexModule.newIndexMapperService(xContentRegistry, mapperRegistry);
}
Also used : IndexSettings(org.elasticsearch.index.IndexSettings) IndexModule(org.elasticsearch.index.IndexModule)

Example 4 with IndexModule

use of org.elasticsearch.index.IndexModule in project crate by crate.

the class IndicesService method createIndexService.

/**
 * This creates a new IndexService without registering itcreateIndex
 */
private synchronized IndexService createIndexService(IndexCreationContext indexCreationContext, IndexMetadata indexMetadata, IndicesQueryCache indicesQueryCache, List<IndexEventListener> builtInListeners, IndexingOperationListener... indexingOperationListeners) throws IOException {
    final IndexSettings idxSettings = new IndexSettings(indexMetadata, this.settings, indexScopedSettings);
    // we ignore private settings since they are not registered settings
    indexScopedSettings.validate(indexMetadata.getSettings(), true, true, true);
    LOGGER.debug("creating Index [{}], shards [{}]/[{}] - reason [{}]", indexMetadata.getIndex(), idxSettings.getNumberOfShards(), idxSettings.getNumberOfReplicas(), indexCreationContext);
    final IndexModule indexModule = new IndexModule(idxSettings, analysisRegistry, getEngineFactory(idxSettings), directoryFactories);
    for (IndexingOperationListener operationListener : indexingOperationListeners) {
        indexModule.addIndexOperationListener(operationListener);
    }
    pluginsService.onIndexModule(indexModule);
    for (IndexEventListener listener : builtInListeners) {
        indexModule.addIndexEventListener(listener);
    }
    return indexModule.newIndexService(indexCreationContext, nodeEnv, xContentRegistry, this, circuitBreakerService, bigArrays, threadPool, indicesQueryCache, mapperRegistry);
}
Also used : IndexingOperationListener(org.elasticsearch.index.shard.IndexingOperationListener) IndexEventListener(org.elasticsearch.index.shard.IndexEventListener) IndexSettings(org.elasticsearch.index.IndexSettings) IndexModule(org.elasticsearch.index.IndexModule)

Aggregations

IndexModule (org.elasticsearch.index.IndexModule)4 IndexSettings (org.elasticsearch.index.IndexSettings)4 IndexEventListener (org.elasticsearch.index.shard.IndexEventListener)2 IndexingOperationListener (org.elasticsearch.index.shard.IndexingOperationListener)2 Index (org.elasticsearch.index.Index)1