當前位置: 首頁>>代碼示例>>Java>>正文


Java IndexEventListener類代碼示例

本文整理匯總了Java中org.elasticsearch.index.shard.IndexEventListener的典型用法代碼示例。如果您正苦於以下問題:Java IndexEventListener類的具體用法?Java IndexEventListener怎麽用?Java IndexEventListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IndexEventListener類屬於org.elasticsearch.index.shard包,在下文中一共展示了IndexEventListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createIndexService

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:41,代碼來源:IndicesService.java

示例2: CompositeIndexEventListener

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
CompositeIndexEventListener(IndexSettings indexSettings, Collection<IndexEventListener> listeners) {
    for (IndexEventListener listener : listeners) {
        if (listener == null) {
            throw new IllegalArgumentException("listeners must be non-null");
        }
    }
    this.listeners = Collections.unmodifiableList(new ArrayList<>(listeners));
    this.logger = Loggers.getLogger(getClass(), indexSettings.getSettings(), indexSettings.getIndex());
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:10,代碼來源:CompositeIndexEventListener.java

示例3: shardRoutingChanged

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
@Override
public void shardRoutingChanged(IndexShard indexShard, @Nullable ShardRouting oldRouting, ShardRouting newRouting) {
    for (IndexEventListener listener : listeners) {
        try {
            listener.shardRoutingChanged(indexShard, oldRouting, newRouting);
        } catch (Exception e) {
            logger.warn((Supplier<?>) () -> new ParameterizedMessage("[{}] failed to invoke shard touring changed callback", indexShard.shardId().getId()), e);
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:11,代碼來源:CompositeIndexEventListener.java

示例4: afterIndexShardCreated

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
@Override
public void afterIndexShardCreated(IndexShard indexShard) {
    for (IndexEventListener listener : listeners) {
        try {
            listener.afterIndexShardCreated(indexShard);
        } catch (Exception e) {
            logger.warn((Supplier<?>) () -> new ParameterizedMessage("[{}] failed to invoke after shard created callback", indexShard.shardId().getId()), e);
            throw e;
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:12,代碼來源:CompositeIndexEventListener.java

示例5: afterIndexShardStarted

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
@Override
public void afterIndexShardStarted(IndexShard indexShard) {
    for (IndexEventListener listener : listeners) {
        try {
            listener.afterIndexShardStarted(indexShard);
        } catch (Exception e) {
            logger.warn((Supplier<?>) () -> new ParameterizedMessage("[{}] failed to invoke after shard started callback", indexShard.shardId().getId()), e);
            throw e;
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:12,代碼來源:CompositeIndexEventListener.java

示例6: beforeIndexShardClosed

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
@Override
public void beforeIndexShardClosed(ShardId shardId, @Nullable IndexShard indexShard,
                                   Settings indexSettings) {
    for (IndexEventListener listener : listeners) {
        try {
            listener.beforeIndexShardClosed(shardId, indexShard, indexSettings);
        } catch (Exception e) {
            logger.warn((Supplier<?>) () -> new ParameterizedMessage("[{}] failed to invoke before shard closed callback", shardId.getId()), e);
            throw e;
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:13,代碼來源:CompositeIndexEventListener.java

示例7: afterIndexShardClosed

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
@Override
public void afterIndexShardClosed(ShardId shardId, @Nullable IndexShard indexShard,
                                  Settings indexSettings) {
    for (IndexEventListener listener : listeners) {
        try {
            listener.afterIndexShardClosed(shardId, indexShard, indexSettings);
        } catch (Exception e) {
            logger.warn((Supplier<?>) () -> new ParameterizedMessage("[{}] failed to invoke after shard closed callback", shardId.getId()), e);
            throw e;
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:13,代碼來源:CompositeIndexEventListener.java

示例8: onShardInactive

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
@Override
public void onShardInactive(IndexShard indexShard) {
    for (IndexEventListener listener : listeners) {
        try {
            listener.onShardInactive(indexShard);
        } catch (Exception e) {
            logger.warn((Supplier<?>) () -> new ParameterizedMessage("[{}] failed to invoke on shard inactive callback", indexShard.shardId().getId()), e);
            throw e;
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:12,代碼來源:CompositeIndexEventListener.java

示例9: indexShardStateChanged

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
@Override
public void indexShardStateChanged(IndexShard indexShard, @Nullable IndexShardState previousState, IndexShardState currentState, @Nullable String reason) {
    for (IndexEventListener listener : listeners) {
        try {
            listener.indexShardStateChanged(indexShard, previousState, indexShard.state(), reason);
        } catch (Exception e) {
            logger.warn((Supplier<?>) () -> new ParameterizedMessage("[{}] failed to invoke index shard state changed callback", indexShard.shardId().getId()), e);
            throw e;
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:12,代碼來源:CompositeIndexEventListener.java

示例10: 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

示例11: afterIndexCreated

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
@Override
public void afterIndexCreated(IndexService indexService) {
    for (IndexEventListener listener : listeners) {
        try {
            listener.afterIndexCreated(indexService);
        } catch (Exception e) {
            logger.warn("failed to invoke after index created callback", e);
            throw e;
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:12,代碼來源:CompositeIndexEventListener.java

示例12: beforeIndexShardCreated

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
@Override
public void beforeIndexShardCreated(ShardId shardId, Settings indexSettings) {
    for (IndexEventListener listener : listeners) {
        try {
            listener.beforeIndexShardCreated(shardId, indexSettings);
        } catch (Exception e) {
            logger.warn((Supplier<?>) () -> new ParameterizedMessage("[{}] failed to invoke before shard created callback", shardId), e);
            throw e;
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:12,代碼來源:CompositeIndexEventListener.java

示例13: beforeIndexRemoved

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
@Override
public void beforeIndexRemoved(IndexService indexService, IndexRemovalReason reason) {
    for (IndexEventListener listener : listeners) {
        try {
            listener.beforeIndexRemoved(indexService, reason);
        } catch (Exception e) {
            logger.warn("failed to invoke before index removed callback", e);
            throw e;
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:12,代碼來源:CompositeIndexEventListener.java

示例14: afterIndexRemoved

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
@Override
public void afterIndexRemoved(Index index, IndexSettings indexSettings, IndexRemovalReason reason) {
    for (IndexEventListener listener : listeners) {
        try {
            listener.afterIndexRemoved(index, indexSettings, reason);
        } catch (Exception e) {
            logger.warn("failed to invoke after index removed callback", e);
            throw e;
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:12,代碼來源:CompositeIndexEventListener.java

示例15: beforeIndexShardDeleted

import org.elasticsearch.index.shard.IndexEventListener; //導入依賴的package包/類
@Override
public void beforeIndexShardDeleted(ShardId shardId,
                                    Settings indexSettings) {
    for (IndexEventListener listener : listeners) {
        try {
            listener.beforeIndexShardDeleted(shardId, indexSettings);
        } catch (Exception e) {
            logger.warn((Supplier<?>) () -> new ParameterizedMessage("[{}] failed to invoke before shard deleted callback", shardId.getId()), e);
            throw e;
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:13,代碼來源:CompositeIndexEventListener.java


注:本文中的org.elasticsearch.index.shard.IndexEventListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。