diff --git a/server/src/main/java/org/elasticsearch/plugins/internal/DocumentSizeAccumulator.java b/server/src/main/java/org/elasticsearch/plugins/internal/DocumentSizeAccumulator.java index c4c835f60e370..27bce3c637c65 100644 --- a/server/src/main/java/org/elasticsearch/plugins/internal/DocumentSizeAccumulator.java +++ b/server/src/main/java/org/elasticsearch/plugins/internal/DocumentSizeAccumulator.java @@ -8,6 +8,8 @@ package org.elasticsearch.plugins.internal; +import org.apache.lucene.index.SegmentInfos; + import java.util.Map; /** @@ -20,8 +22,8 @@ public interface DocumentSizeAccumulator { public void add(long size) {} @Override - public Map getAndReset(Map map) { - return map; + public Map getAsCommitUserData(SegmentInfos segmentInfos) { + return Map.of(); } }; @@ -32,10 +34,11 @@ public Map getAndReset(Map map) { void add(long size); /** - * Adds an entry to a map with a value being the current state of the accumulator. + * Returns a map with an entry being the current state of the accumulator + previously commited value for that key * Then resets the accumulator. - * @param map a map with previous value of size + * + * @param segmentInfos a shard's previously comited SegmentInfos * @return an map with a new value of size */ - Map getAndReset(Map map); + Map getAsCommitUserData(SegmentInfos segmentInfos); }