Directly pass acceptableOverheadRatio to PackedInts.getWriter.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1436460 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrien Grand 2013-01-21 16:31:40 +00:00
parent ab0e1e76e0
commit 275b1caa00
1 changed files with 3 additions and 5 deletions

View File

@ -37,7 +37,6 @@ import org.apache.lucene.util.fst.FST.INPUT_TYPE;
import org.apache.lucene.util.fst.PositiveIntOutputs;
import org.apache.lucene.util.fst.Util;
import org.apache.lucene.util.packed.PackedInts;
import org.apache.lucene.util.packed.PackedInts.FormatAndBits;
/**
* Writes numbers one of two ways:
@ -142,15 +141,14 @@ class Lucene41DocValuesConsumer extends DocValuesConsumer {
}
data.writeLong(minValue);
FormatAndBits formatAndBits = PackedInts.fastestFormatAndBits(count, bitsPerValue, PackedInts.COMPACT);
final PackedInts.Writer writer = PackedInts.getWriter(data, count, formatAndBits.bitsPerValue, 0);
final PackedInts.Writer writer = PackedInts.getWriter(data, count, bitsPerValue, PackedInts.COMPACT);
for(Number nv : values) {
writer.add(nv.longValue() - minValue);
}
writer.finish();
}
@Override
public void close() throws IOException {
// nocommit: just write this to a RAMfile or something and flush it here, with #fields first.