add END to the end of SimpleText's points data file

This commit is contained in:
Mike McCandless 2016-03-05 04:51:14 -05:00
parent a15845ea59
commit 9c8cbefbff
1 changed files with 5 additions and 2 deletions

View File

@ -23,10 +23,10 @@ import java.util.Map;
import org.apache.lucene.codecs.PointReader; import org.apache.lucene.codecs.PointReader;
import org.apache.lucene.codecs.PointWriter; import org.apache.lucene.codecs.PointWriter;
import org.apache.lucene.index.PointValues.IntersectVisitor;
import org.apache.lucene.index.PointValues.Relation;
import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.IndexFileNames;
import org.apache.lucene.index.PointValues.IntersectVisitor;
import org.apache.lucene.index.PointValues.Relation;
import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.index.SegmentWriteState;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
@ -53,6 +53,7 @@ class SimpleTextPointWriter extends PointWriter {
final static BytesRef MAX_VALUE = new BytesRef("max value "); final static BytesRef MAX_VALUE = new BytesRef("max value ");
final static BytesRef POINT_COUNT = new BytesRef("point count "); final static BytesRef POINT_COUNT = new BytesRef("point count ");
final static BytesRef DOC_COUNT = new BytesRef("doc count "); final static BytesRef DOC_COUNT = new BytesRef("doc count ");
final static BytesRef END = new BytesRef("END");
private IndexOutput dataOut; private IndexOutput dataOut;
final BytesRefBuilder scratch = new BytesRefBuilder(); final BytesRefBuilder scratch = new BytesRefBuilder();
@ -210,6 +211,8 @@ class SimpleTextPointWriter extends PointWriter {
@Override @Override
public void finish() throws IOException { public void finish() throws IOException {
SimpleTextUtil.write(dataOut, END);
SimpleTextUtil.writeNewline(dataOut);
SimpleTextUtil.writeChecksum(dataOut, scratch); SimpleTextUtil.writeChecksum(dataOut, scratch);
} }