Skip to content

Commit

Permalink
Load the slowLogFieldProviders at construction time
Browse files Browse the repository at this point in the history
  • Loading branch information
joegallo committed Oct 23, 2024
1 parent 291ced7 commit ed147dd
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ public class IndicesService extends AbstractLifecycleComponent
private final CheckedBiConsumer<ShardSearchRequest, StreamOutput, IOException> requestCacheKeyDifferentiator;
private final MapperMetrics mapperMetrics;
private final PostRecoveryMerger postRecoveryMerger;
private final List<? extends SlowLogFieldProvider> slowLogFieldProviders;

@Override
protected void doStart() {
Expand Down Expand Up @@ -381,6 +382,8 @@ public void onRemoval(ShardId shardId, String fieldName, boolean wasEvicted, lon
this.timestampFieldMapperService = new TimestampFieldMapperService(settings, threadPool, this);

this.postRecoveryMerger = new PostRecoveryMerger(settings, threadPool.executor(ThreadPool.Names.FORCE_MERGE), this::getShardOrNull);

this.slowLogFieldProviders = pluginsService.loadServiceProviders(SlowLogFieldProvider.class);
}

private static final String DANGLING_INDICES_UPDATE_THREAD_NAME = "DanglingIndices#updateTask";
Expand Down Expand Up @@ -1438,7 +1441,6 @@ int numPendingDeletes(Index index) {

// pkg-private for testing
SlowLogFieldProvider loadSlowLogFieldProvider() {
List<? extends SlowLogFieldProvider> slowLogFieldProviders = pluginsService.loadServiceProviders(SlowLogFieldProvider.class);
return new SlowLogFieldProvider() {
@Override
public void init(IndexSettings indexSettings) {
Expand Down

0 comments on commit ed147dd

Please sign in to comment.