本文整理汇总了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);
}
示例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());
}
示例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);
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}