当前位置: 首页>>代码示例>>Java>>正文


Java IndexEventListener.beforeIndexCreated方法代码示例

本文整理汇总了Java中org.elasticsearch.index.shard.IndexEventListener.beforeIndexCreated方法的典型用法代码示例。如果您正苦于以下问题:Java IndexEventListener.beforeIndexCreated方法的具体用法?Java IndexEventListener.beforeIndexCreated怎么用?Java IndexEventListener.beforeIndexCreated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.index.shard.IndexEventListener的用法示例。


在下文中一共展示了IndexEventListener.beforeIndexCreated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: beforeIndexCreated

import org.elasticsearch.index.shard.IndexEventListener; //导入方法依赖的package包/类
@Override
public void beforeIndexCreated(Index index, Settings indexSettings) {
    for (IndexEventListener listener : listeners) {
        try {
            listener.beforeIndexCreated(index, indexSettings);
        } catch (Exception e) {
            logger.warn("failed to invoke before index created callback", e);
            throw e;
        }
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:CompositeIndexEventListener.java

示例2: newIndexService

import org.elasticsearch.index.shard.IndexEventListener; //导入方法依赖的package包/类
public IndexService newIndexService(
    NodeEnvironment environment,
    NamedXContentRegistry xContentRegistry,
    IndexService.ShardStoreDeleter shardStoreDeleter,
    CircuitBreakerService circuitBreakerService,
    BigArrays bigArrays,
    ThreadPool threadPool,
    ScriptService scriptService,
    ClusterService clusterService,
    Client client,
    IndicesQueryCache indicesQueryCache,
    MapperRegistry mapperRegistry,
    Consumer<ShardId> globalCheckpointSyncer,
    IndicesFieldDataCache indicesFieldDataCache)
    throws IOException {
    final IndexEventListener eventListener = freeze();
    IndexSearcherWrapperFactory searcherWrapperFactory = indexSearcherWrapper.get() == null
        ? (shard) -> null : indexSearcherWrapper.get();
    eventListener.beforeIndexCreated(indexSettings.getIndex(), indexSettings.getSettings());
    final String storeType = indexSettings.getValue(INDEX_STORE_TYPE_SETTING);
    final IndexStore store;
    if (Strings.isEmpty(storeType) || isBuiltinType(storeType)) {
        store = new IndexStore(indexSettings);
    } else {
        Function<IndexSettings, IndexStore> factory = storeTypes.get(storeType);
        if (factory == null) {
            throw new IllegalArgumentException("Unknown store type [" + storeType + "]");
        }
        store = factory.apply(indexSettings);
        if (store == null) {
            throw new IllegalStateException("store must not be null");
        }
    }
    final QueryCache queryCache;
    if (indexSettings.getValue(INDEX_QUERY_CACHE_ENABLED_SETTING)) {
        BiFunction<IndexSettings, IndicesQueryCache, QueryCache> queryCacheProvider = forceQueryCacheProvider.get();
        if (queryCacheProvider == null) {
            queryCache = new IndexQueryCache(indexSettings, indicesQueryCache);
        } else {
            queryCache = queryCacheProvider.apply(indexSettings, indicesQueryCache);
        }
    } else {
        queryCache = new DisabledQueryCache(indexSettings);
    }
    return new IndexService(indexSettings, environment, xContentRegistry, new SimilarityService(indexSettings, similarities),
            shardStoreDeleter, analysisRegistry, engineFactory.get(), circuitBreakerService, bigArrays, threadPool, scriptService,
            clusterService, client, queryCache, store, eventListener, searcherWrapperFactory, mapperRegistry,
            indicesFieldDataCache, globalCheckpointSyncer, searchOperationListeners, indexOperationListeners);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:50,代码来源:IndexModule.java


注:本文中的org.elasticsearch.index.shard.IndexEventListener.beforeIndexCreated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。