mirror of https://github.com/apache/lucene.git
remove double-counting
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1439168 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
31407be62d
commit
d7ad96f234
|
@ -36,17 +36,12 @@ class BinaryDocValuesWriter extends DocValuesWriter {
|
||||||
private final FieldInfo fieldInfo;
|
private final FieldInfo fieldInfo;
|
||||||
private int addedValues = 0;
|
private int addedValues = 0;
|
||||||
private final BytesRef emptyBytesRef = new BytesRef();
|
private final BytesRef emptyBytesRef = new BytesRef();
|
||||||
private final Counter iwBytesUsed;
|
|
||||||
private long bytesUsed;
|
|
||||||
|
|
||||||
// nocommit this needs to update bytesUsed?
|
// nocommit this needs to update bytesUsed?
|
||||||
|
|
||||||
public BinaryDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed) {
|
public BinaryDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed) {
|
||||||
this.fieldInfo = fieldInfo;
|
this.fieldInfo = fieldInfo;
|
||||||
this.bytesRefArray = new BytesRefArray(iwBytesUsed);
|
this.bytesRefArray = new BytesRefArray(iwBytesUsed); // nocommit: test that this thing really accounts correctly
|
||||||
bytesUsed = bytesRefArray.bytesUsed(); // nocommit: totally wrong!!!!
|
|
||||||
this.iwBytesUsed = iwBytesUsed;
|
|
||||||
//nocommit WRONG iwBytesUsed.addAndGet(bytesUsed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addValue(int docID, BytesRef value) {
|
public void addValue(int docID, BytesRef value) {
|
||||||
|
@ -67,13 +62,6 @@ class BinaryDocValuesWriter extends DocValuesWriter {
|
||||||
}
|
}
|
||||||
addedValues++;
|
addedValues++;
|
||||||
bytesRefArray.append(value);
|
bytesRefArray.append(value);
|
||||||
updateBytesUsed();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateBytesUsed() {
|
|
||||||
final long newBytesUsed = bytesRefArray.bytesUsed();
|
|
||||||
// nocommit: WRONG iwBytesUsed.addAndGet(newBytesUsed - bytesUsed);
|
|
||||||
bytesUsed = newBytesUsed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue