LUCENE-3622: push this to the impl, its in the perdocwritestate if an impl chooses to buffer

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene3622@1211301 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-12-07 04:50:37 +00:00
parent fd47d1464e
commit fe6d400765
2 changed files with 3 additions and 16 deletions

View File

@ -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}

View File

@ -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;
}
/**