Hi, Ravi,

I used your NullDirectory.java, and found it works fine for smaller indexes, but when it comes to larger indexes(I am not quite sure, just observation), it always throws this exception at here:

 private void refill() throws IOException {
   long start = bufferStart + bufferPosition;
   long end = start + BUFFER_SIZE;
   if (end > length)                  // don't read past EOF
     end = length;
   bufferLength = (int)(end - start);
   if (bufferLength == 0)
     throw new IOException("read past EOF");
  ....

The print out and stack trace are:
merging segments _2io (50 docs) _2k3 (50 docs) _2li (50 docs) _2mx (50 docs) _2oc (50 docs) _2pr (50 docs) _2r6 (50 docs) _2sl (50 docs) _2u0 (50 docs) _2u4 (3 docs) into _0 (453 docs)
merging segments _25x (50 docs) _27c (50 docs) _28r (50 docs) _2a6 (50 docs) _2bl (50 docs) _2d0 (50 docs) _2ef (50 docs) _2fu (50 docs) _2h9 (50 docs) _0 (453 docs)ERROR 44|java.io.IOException: read past EOF|...
java.io.IOException: read past EOF
at org.apache.lucene.store.InputStream.refill(InputStream.java:154)
at org.apache.lucene.store.InputStream.readByte(InputStream.java:43)
at org.apache.lucene.store.InputStream.readVInt(InputStream.java:83)
at org.apache.lucene.index.CompoundFileReader.<init>(CompoundFileReader.java:66)
at org.apache.lucene.index.SegmentReader.initialize(SegmentReader.java:104)
at org.apache.lucene.index.SegmentReader.<init>(SegmentReader.java:94)
at org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:480)
at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:366)
at org.apache.lucene.index.IndexWriter.addIndexes(IndexWriter.java:389)




Chris

Ravi Rao wrote:

From: [EMAIL PROTECTED]
Sent: Fri 3/18/2005 11:34 PM





Is there any way to detect the index's integrity?
Sometimes I came upon exceptions like these. If it happens, my only way is to delete the corrupted index.





* Exception in thread "main" java.io.IOException : read past EOF
* java.lang.ArrayIndexOutOfBoundsException





[ ... ]



I did too, which is why I wrote NullDirectory. You can find the sources and a description in bugzilla.

  http://issues.apache.org/bugzilla/show_bug.cgi?id=33851

Look at the tests for examples of use. I would value your feedback.


------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Reply via email to