當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。