From e01a6011d2c14862163c0da7adb924ca9a925249 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Fri, 7 Jun 2024 13:52:48 +0100 Subject: [PATCH] address review comment --- .../java/org/elasticsearch/index/mapper/SourceLoader.java | 7 ++++++- .../elasticsearch/index/mapper/MapperServiceTestCase.java | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/index/mapper/SourceLoader.java b/server/src/main/java/org/elasticsearch/index/mapper/SourceLoader.java index 1df1925e177a5..c9bea33852a20 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/SourceLoader.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/SourceLoader.java @@ -99,13 +99,18 @@ public Set requiredStoredFields() { }; /** - * Load {@code _source} from doc values. + * Reconstructs {@code _source} from doc values anf stored fields. */ class Synthetic implements SourceLoader { private final Supplier syntheticFieldLoaderLeafSupplier; private final Set requiredStoredFields; private final SourceFieldMetrics metrics; + /** + * Creates a {@link SourceLoader} to reconstruct {@code _source} from doc values anf stored fields. + * @param fieldLoaderSupplier A supplier to create {@link SyntheticFieldLoader}, one for each leaf. + * @param metrics Metrics for profiling. + */ public Synthetic(Supplier fieldLoaderSupplier, SourceFieldMetrics metrics) { this.syntheticFieldLoaderLeafSupplier = fieldLoaderSupplier; this.requiredStoredFields = syntheticFieldLoaderLeafSupplier.get() diff --git a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperServiceTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperServiceTestCase.java index 1583699284490..50436ad64c8af 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperServiceTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperServiceTestCase.java @@ -67,7 +67,6 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.internal.SubSearchContext; import org.elasticsearch.search.lookup.SearchLookup; -import org.elasticsearch.search.lookup.Source; import org.elasticsearch.search.lookup.SourceProvider; import org.elasticsearch.search.sort.BucketedSort; import org.elasticsearch.search.sort.BucketedSort.ExtraData;