Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
jimczi committed Nov 22, 2019
1 parent edd4cb6 commit e8aa2c4
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public Set<Entry<String, NamedAnalyzer>> entrySet() {
try (IndexAnalyzers fakeIndexAnalzyers =
new IndexAnalyzers(analyzerMap, analyzerMap, analyzerMap)) {
MapperService mapperService = new MapperService(indexSettings, fakeIndexAnalzyers, xContentRegistry, similarityService,
mapperRegistry, () -> null);
mapperRegistry, () -> null, () -> false);
mapperService.merge(indexMetaData, MapperService.MergeReason.MAPPING_RECOVERY);
}
} catch (Exception ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ public MapperService newIndexMapperService(NamedXContentRegistry xContentRegistr
ScriptService scriptService) throws IOException {
return new MapperService(indexSettings, analysisRegistry.build(indexSettings), xContentRegistry,
new SimilarityService(indexSettings, scriptService, similarities), mapperRegistry,
() -> { throw new UnsupportedOperationException("no index query shard context available"); });
() -> { throw new UnsupportedOperationException("no index query shard context available"); }, () -> false);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,6 @@ public enum MergeReason {

private final BooleanSupplier idFieldDataEnabled;

public MapperService(IndexSettings indexSettings, IndexAnalyzers indexAnalyzers, NamedXContentRegistry xContentRegistry,
SimilarityService similarityService, MapperRegistry mapperRegistry,
Supplier<QueryShardContext> queryShardContextSupplier) {
this(indexSettings, indexAnalyzers, xContentRegistry, similarityService, mapperRegistry, queryShardContextSupplier, () -> false);
}


public MapperService(IndexSettings indexSettings, IndexAnalyzers indexAnalyzers, NamedXContentRegistry xContentRegistry,
SimilarityService similarityService, MapperRegistry mapperRegistry,
Supplier<QueryShardContext> queryShardContextSupplier, BooleanSupplier idFieldDataEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private CodecService createCodecService() throws IOException {
IndexAnalyzers indexAnalyzers = createTestAnalysis(settings, nodeSettings).indexAnalyzers;
MapperRegistry mapperRegistry = new MapperRegistry(Collections.emptyMap(), Collections.emptyMap(), MapperPlugin.NOOP_FIELD_FILTER);
MapperService service = new MapperService(settings, indexAnalyzers, xContentRegistry(), similarityService, mapperRegistry,
() -> null);
() -> null, () -> false);
return new CodecService(service, LogManager.getLogger("test"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ public static MapperService newMapperService(NamedXContentRegistry xContentRegis
xContentRegistry,
similarityService,
mapperRegistry,
() -> null);
() -> null, () -> false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public TranslogHandler(NamedXContentRegistry xContentRegistry, IndexSettings ind
SimilarityService similarityService = new SimilarityService(indexSettings, null, emptyMap());
MapperRegistry mapperRegistry = new IndicesModule(emptyList()).getMapperRegistry();
mapperService = new MapperService(indexSettings, indexAnalyzers, xContentRegistry, similarityService, mapperRegistry,
() -> null);
() -> null, () -> false);
}

private DocumentMapperForType docMapper(String type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ private static class ServiceHolder implements Closeable {
similarityService = new SimilarityService(idxSettings, null, Collections.emptyMap());
MapperRegistry mapperRegistry = indicesModule.getMapperRegistry();
mapperService = new MapperService(idxSettings, indexAnalyzers, xContentRegistry, similarityService, mapperRegistry,
() -> createShardContext(null));
() -> createShardContext(null), () -> false);
IndicesFieldDataCache indicesFieldDataCache = new IndicesFieldDataCache(nodeSettings, new IndexFieldDataCache.Listener() {
});
indexFieldDataService = new IndexFieldDataService(idxSettings, indicesFieldDataCache,
Expand Down

0 comments on commit e8aa2c4

Please sign in to comment.