diff --git a/lucene/src/java/org/apache/lucene/index/codecs/DocValuesConsumer.java b/lucene/src/java/org/apache/lucene/index/codecs/DocValuesConsumer.java index 75d8cf6e623..b2e89456448 100644 --- a/lucene/src/java/org/apache/lucene/index/codecs/DocValuesConsumer.java +++ b/lucene/src/java/org/apache/lucene/index/codecs/DocValuesConsumer.java @@ -23,7 +23,6 @@ import org.apache.lucene.index.MergeState; import org.apache.lucene.index.values.IndexDocValues; import org.apache.lucene.index.values.PerDocFieldValues; import org.apache.lucene.util.Bits; -import org.apache.lucene.util.Counter; /** * Abstract API that consumes {@link PerDocFieldValues}. @@ -36,20 +35,6 @@ import org.apache.lucene.util.Counter; */ public abstract class DocValuesConsumer { - protected final Counter bytesUsed; - - /** - * Creates a new {@link DocValuesConsumer}. - * - * @param bytesUsed - * bytes-usage tracking reference used by implementation to track - * internally allocated memory. All tracked bytes must be released - * once {@link #finish(int)} has been called. - */ - protected DocValuesConsumer(Counter bytesUsed) { - this.bytesUsed = bytesUsed == null ? Counter.newCounter() : bytesUsed; - } - /** * Adds the given {@link PerDocFieldValues} instance to this * {@link DocValuesConsumer} diff --git a/lucene/src/java/org/apache/lucene/index/codecs/lucene40/values/Writer.java b/lucene/src/java/org/apache/lucene/index/codecs/lucene40/values/Writer.java index 53173fc3fdc..7aae0f0f6fc 100644 --- a/lucene/src/java/org/apache/lucene/index/codecs/lucene40/values/Writer.java +++ b/lucene/src/java/org/apache/lucene/index/codecs/lucene40/values/Writer.java @@ -42,6 +42,8 @@ import org.apache.lucene.util.Counter; */ public abstract class Writer extends DocValuesConsumer { protected Source currentMergeSource; + protected final Counter bytesUsed; + /** * Creates a new {@link Writer}. * @@ -51,7 +53,7 @@ public abstract class Writer extends DocValuesConsumer { * once {@link #finish(int)} has been called. */ protected Writer(Counter bytesUsed) { - super(bytesUsed); + this.bytesUsed = bytesUsed; } /**